Wednesday, May 14, 2014

How To Clone And Migrate Your WordPress Blog To New Server

Here’s how you can clone and migrate your WordPress blog to a new server in 10 steps:
  1. Download the wp-db-backup plugin.
  2. Upload to your existing server and activate it via the ‘Plugins‘ menu.
  3. 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.
  4. In your computer, extract the gzip backup file. You should now have a sql file.
  5. 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.
  6. 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.
  7. Log in to the PhpMyAdmin in the new server (here is the instruction to access your PhpMyAdmin)
  8. Create a new database for your wordpress and import the sql file to the database
  9. Change the database configuration in the wp-config file in the WordPress folder that you have downloaded
  10. 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.

No comments: