Rice Blogger

Malaysia Internet Marketing, Blogging Tips, SEO, Make Money Online and Internet Entreprenuer.

Export Large MySQL to Move your WordPress

Posted by Adi Wong On June - 18 - 2010

Other than files, you need to also move your database. If you are use to the GUI, you know that there is limitation exporting and importing. This is especially true when you have a large database. Through phpmyadmin, it is also a lot slower compare to method whereby you export large MySQL via SSH.

The command:-

mysqldump -u [username] -p [DB name] | gzip > [dbname].sql.gz

It will prompt for password, type in the password for this access to the database. You will get a file name exactly like what you have typed at the end of above command ([dbname].sql.gz).

Use an ftp program to download the file.

Because the file is compress, you are downloading it even faster, and you can un-compress it on your new webhosting.

To Import the large MySQL

gzip [dbname].sql.gz

then

mysql -u [username] -p [DB name] < [dbname].sql

** If you uses a different username and DB name in your new webhost, use the new value in the bracket

I hope this this will actually make moving your wordpress or your website to another webhosting much easier.

Moving WordPress to Another Host via SSH

Posted by Adi Wong On March - 22 - 2010

This trick actually works well with most php scripts. There is lots of benefit to this rather than ftp out the file from your old host then ftp back all the files to new host. The better I would suggest is to zip your folder for the particular domain whereby you can use the following command:-

tar -zcvf zipfilename.tar.gz foldername/

ie. You moving a domain at riceblogger.com/. use command: tar -zcvf riceblogger.tar.gz riceblogger.com/

then move the zip file to your new host via ftp. To extract .tar.gz, you use this command

tar -zxvf riceblogger.tar.gz

I had no other choice to expore these command because I have a classifieds that contain few thousands of picture in a folder, with Filezilla, I could only display 2000, and I kept missing pictures. With zipping, I can download and upload much faster.

There is also ways to extract large MySQL via SSH. I will post them later. Since I start learning more SSH for my 9 to 6 job, I found it so useful, and it also helps in my experience as a webmaster/blogger/internet marketer. Not to forget my previous post Upgrading WordPress via SSH, it is still useful when we want to install a new blog, or the automatic upgrade is not working.