In the event that you need to migrate your current WordPress blog to a new server, or a new URL, the last thing that you want to do is to reinstall WordPress on your new server and reconfigure the setting all over again.
While you can use the export/import function under the ‘Manage‘ menu to migrate your database over, it is definitely not the best and ideal solution, especially if you have a huge database. In addition, if any of your plugins created their own databases, they aren’t going to be migrated by the export/import function.
To migrate your WordPress blog, the best and the easiest way is to clone it and plug it into the new server. Since WordPress is a database driven platform where all its configuration settings are kept in the database, we can achieve a cloning effect simply by backing up all its database tables (including those created by the plugins) and dump it into the new server database. There is no need for reinstallation or reconfiguration.
Here’s how you can clone and migrate your WordPress blog to a new server in 10 steps:
- Download the wp-db-backup plugin.
- Upload to your existing server and activate it via the ‘Plugins‘ menu.
- Go to the ‘Manage‘ -> ‘Backup‘ menu. Select all the tables (including those tables created by the plugins) and click the Backup button to download the gzip file to your computer.
- In your computer, extract the gzip backup file. You should now have a sql file.
- Open the sql file with a text editor. Search for the line
INSERT INTO `wp_options` VALUES (1, 0, 'siteurl'
You should see something of this format:
INSERT INTO `wp_options` VALUES (1, 0, 'siteurl', 'http://www.your-old-url.com', 'yes')
Replace the URL with your new server URL
Next, search for the line
INSERT INTO `wp_options` VALUES (39, 0, 'home',</code>
You should see
INSERT INTO `wp_options` VALUES (39, 0, 'home', 'http://www.your-old-url.com', 'yes')
Replace the url with your new URL. Save and exit.
- Using a FTP program, download the whole WordPress folder from your current server to your computer. Keep the folder structure intact, especially the wp-content folder.
- Log in to the PhpMyAdmin in the new server (here is the instruction to access your PhpMyAdmin)
- Create a new database for your wordpress and import the sql file to the database
- Change the database configuration in the wp-config file in the WordPress folder that you have downloaded
- Upload the whole WordPress folder to the new server.
Done. You can now proceed to your wp-login page at the new server and login with the same username and password. All the configuration and settings will be the same as before.
If your WordPress database (the sql file you have created) is more than 2MB, the above method might not work since PhpMyAdmin only allows a maximum of 2MB file import.
To overcome this, you can use bigdump to dump the sql file to your new database.
The instructions below are no longer required.
Download the bigdump file. Unzip the file. Open up config.php and change the database configuration. Copy and paste the sql file into the folder. Upload the ‘restore‘ folder to your new web URL On your browser, navigate to the url http://your-new-web-url.com/restore/bigdump.php Click on the “Start import” to import the sql file to the database Once completed, upload the whole WordPress folder to your new web server. Done. Update: for GoDaddy, ‘localhost’ will not work. But any user can access their account, access the control panel for hosting products and then see SQL databases. When in edit mode, the page will display the hosting path – this worked. – Mike Chung. Thanks to Mike Chung for the tips.