I did not write this: we used this with wonderful success a few months ago, went looking for it again and couldn’t find it easily. In the event it never does come back online, I’d like to mirror it here for future reference. When the time comes for me to try it again, I will go through it and update if necessary. As it stands, I cannot vouch for its efficacy, only that it really did work wonderfully when we did it a while ago.
March 4th, 2007 by Cormac Moylan
I always get nervous whenever I need to transfer files. I get really nervous when that transfer involves a database. When you’re transferring files which are tied to a database you must ensure that everything syncs’ up properly on the other end.
I recently migrated my Wordpress blog from EuroVPS to Blacknight, while keeping the same domain name. I’m going to run thru the steps and areas that you should be aware of when you’re migrating your own blog.
Backup your Wordpress database using phpMyAdmin
First thing first, make a backup of your database using phpMyAdmin. phpMyAdmin is the most popular and common interface for accessing your database via a webpage. Generally you can access phpMyAdmin by navigating to yourdomain.com/phpmyadmin, but if this results in a ‘page can not be found error’ then you will need to either login to your admin panel, to find the correct path to phpMyAdmin, or contact your webhost for further assistance. Once you have successfully logged into phpMyAdmin, click on the name of the database which contains your wordpress blog. Then click on Export in the main navigation area, within the export screen you must complete the following steps:
- click on ’select all’ and ‘SQL’ from the Export menu
- select ‘add Drop Table’, ‘add Auto_Increment value’ and ‘enclosure table and field names with blackquotes’ from the Structure menu
- select ‘Complete inserts’ and ‘Use hexadecimal for binary files’ from Data
- you can leave all the other values at their defaults
Once all those settings are selected you simply click on ’save as file’, this will download a filenamed wordpress.sql to your desktop. And that is that. You have successfully backed up your database.
If you don’t have PHPmyadmin installed on your hosting account, you can use mySQLDump from a SSH terminal.
One thing to be wary of is Charset values.
Charset differences within mySQL databases can throw a spanner in the works for many migrations. The default charset for Wordpress is Latin1. When you’re exporting/importing your sql file you must ensure that you’re using Latin1 or that you’re using the same charset value between your old database and your new database. If use conflicting charsets you may encounter compatability issues with characters within your database. To check which charset you’re using you can check the column named Collation within phpMyAdmin or when you have completed your backup you can view the contents of the .sql file. Search for a file named ENGINE=MyISAM DEFAULT CHARSET=latin1.
Download/Upload all your Wordpress files using FTP.
You will need to download ALL your files from your old host and upload them to your new host. This includes files from your themes folder and plugins folder. Make sure you also download any folders which were referenced outside of your blog folder. For example I use a seperate folder called ‘images’ which is located outside of ‘blog’. If I didn’t copy and upload this folder to my new host I would have a lot of broken links to images within my blogpost. This is not a pretty sight.
The FTP client I use is Filezilla. By default Filezilla does not display your .htaccess file, probably for security reasons but I’m not too sure. To ensure that your .htaccess file is included in your download you must click on ‘View’ and then enable ‘Show Hidden Files’. If you neglect to upload your .htaccess file then your permalinks will get screwed up. That is of course if you are using permalinks.
Please note that you should not take this oppurtunity to update to a newer version of Wordpress. Your database may not sync’ as a result. Complete your migration before you consider upgrading.
Edit config.php and create a new Wordpress database.
Okay, so we are nearly there. You must now edit config.php to include the database settings of your new database. I’m going to presume you know how to setup a database ![]()
The majority of decent webhosts have tutorials on their site on how to use their hosting control panels. Blacknight have a video tutorial which illustrates how to create a mySQL datbase in DirectAdmin. If you are any bit unsure about how to create a database then you should contact your hosts support for further information.
Once you have edited the file with your new database settings, upload it to the root of your blog folder.
So now everything is set, expect that your new database does not contain any database tables.
Import your Wordpress blog to your new Database.
You can use either phpMyAdmin to import your database or you can use BigDump. BigDump is the preferred option if you have a large database (10mbs or more). There is a step by step guide on how to use BigDump on their website.
I’m going to use phpMyAdmin to import my database as it is less than 10mbs in size. Once you have logged in, you can choose between two methods to complete the import. You can click on ‘SQL’ and run a query or you can use the ‘Import’ link to upload your wordpress.sql file into your database. I recommend using the former as the query can take some time and can sometimes crash your browser. Using the import feature seems to be a lot less strenuous on the browser.
That’s all Folks!
The migartion of your Wordpress blog from one host to another host is complete. If you encounter any difficulties with your migration you should pop over to the Wordpress Support Forum for some assistance. You can also post a comment here if you have any questions about migrating hosts. I’m more than willing to help.
A plugin which you may find usefull is IL Filosofo’s Wordpress Backup plugin. I haven’t used this plugin as I don’t see the need to. Once you know your way around phpMyAdmin you can complete your own backups without the need for a plugin. I recommend you to keep regular backups of your database. AutomySQLbackup is a SourceForge project which backs up your database and emails you the backup in a compressed format. Very handy tool to have in your arsenal.


Twitter
Facebook
LinkedIn
Buzz