Internet Business

How to Migrate a Wordpress Blog to a different Web Host


This is an example of all the steps explained in the previous post: How to Migrate Website to Different Hosts

Let's say we are moving from an existing domain with the following information:

  • Domain Name: www.olddomain.com
  • MySQL Server: mysql.olddomain.com
  • MySQL Database Name: wordpress
  • MySQL Database Username: wp_admin
  • MySQL Database Password: olddomainpass
  • Document Root: /home/user/b1529/sl.olddomain/public_html

To the new domain with the following information:

  • Domain Name: www.newdomain.com
  • MySQL Server: localhost
  • MySQL Database name: To Be Created
  • MySQL Database Username: To Be Created
  • MySQL Database Password: To Be Created
  • Document Root: /home/public_html

 

Step 1: Download all the files of the Wordpress root folder.

Below is a screenshot of transfering all the files and folders within the Wordpress blog's root folder, demonstrated using FileZilla:

What is the root folder for a Wordpress blog?

The root folder is where the wp-admin, wp-content, and wp-includes folders are stored.

 

Step 2: Export a copy of the blog's MySQL database

Below is a screenshot of the export page in phpMyAdmin.

The screenshot illustrates exporting all the content of the blog's MySQL database to a file called "blogbackup"

 

Step 3: Create a MySQL Database on the new web host

Let's say we're not able to match the database name, username and password and we are forced to create a MySQL database with the following settings:

  • MySQL Database Name: xyz_wordpress
  • MySQL Database Username: xyz_admin
  • MySQL Database Password: newpassword

So now we have the following information:

Old Web Host

  • Domain Name: www.olddomain.com
  • MySQL Server: mysql.olddomain.com
  • MySQL Database Name: wordpress
  • MySQL Database Username: wp_admin
  • MySQL Database Password: olddomainpass
  • Document Root: /home/user/b1529/sl.olddomain/public_html

New Web Host

  • Domain Name: www.newdomain.com
  • MySQL Server: localhost
  • MySQL Database name: xyz_wordpress
  • MySQL Database Username: xyz_admin
  • MySQL Database Password: newpassword
  • Document Root: /home/public_html

 

Step 4: Open up blogbackup.sql and perform the necessary changes

  • Replace www.olddomain.com with www.newdomain.com, hit Replace All

  • Replace /home/user/b1529/sl.olddomain/public_html with /home/public_html
  • Replace mysql.olddomain.com with localhost, hit Replace All.
  • Replace wordpress with xyz_wordpress, hit Replace All.
  • Replace wp_admin with xyz_admin, hit Replace All.
  • Replace olddomainpass with newpassword, hit Replace All.

Some of the above are striked out because Wordpress does not store MySQL server, database, username, password information in its database.

 

Step 5: Open up wp-config.php within the Wordpress root directory that you downloaded and make the necessary changes.

The screenshot below is a wp-config.php with the changes applied.

Save the file.

 

Step 6: Upload all website files to the new web host and import the modified MySQL database file.

Use a FTP client to upload the entire modified wordpress folder to your new web host.

Login to phpMyAdmin and import the modified database file to your newly created database - xyz_wordpress. The import screen looks like this:

Open up your web browser and go to www.newdomain.com. You should see your blog displaying properly if you are moving a Wordpress to a new web host with a new domain.

(Optional) Step 7: Point your domain to the new web host

If you are changing to a new web host but not a new domain:

Modify the DNS information of your domain with your registrar and point to your new web host's primary and secondary DNS. Each registrar is different, contact your registrar for assistance.

Add your domain to your new web host. Each web host is different, contact your new web host for assistance.


Share it! IF YOU LIKE THIS ARTICLE

Twitter
Digg
Facebook
Delicious
Stumble

People Who Read This Article Also Liked:


Enable Commentluv | This site uses KeywordLuv