In this post we are going to demonstrate how to migrate a wordpress site from one host to another. Without tears, rage or self harm! The first thing you will need is time. This is not a job to be rushed!

We’re going assume that you’re migrating the web site, leaving your domain name at the same registrar. We’ll explain how to migrate the domain name to a new registrar at the end.

Firstly we look at the prerequisites. These are the things you need to be prepared to do.

  • Alter the Name Server setting in your domain name registrar settings. Don’t do that yet, just know that you’re going to have to change them to avoid any downtime.
  • Have web space arranged for the new host – write down the name servers for that new host
  • A period of time to test the new site
  • Redirect the traffic from old to new host
  • Turn off the old site

Lets go through these steps and explain them.

The name server is held by the registrar of your domain name and propagated all over the internet so that when somebody types “helterskelterdesign.co” into their web browser, it goes away and looks up the Name Server and from there the IP address of the web site. This will need to be changed but first, you’ll need to migrate the web site content.

  1. Please, please please…Backup your files before you get started. If anything goes wrong during the migration process you will still have your content intact.
  2. Use FTP to download the entire wp-content folder. This contains amongst other things all of the pictures you have uploaded to your site.
  3. Export the database files. Easier than it sounds! Go to the cPanel, open phpMyAdmin, and click on the “Export” tab. Then click on “Go”. The output is a file that you can import into your new database.Break for Coffee…
  4. Install WordPress in your new host.
  5. Import the database. Go to the cPanel, open phpMyAdmin, and click on the “Import” tab. Then click on “Go”, use the output file from step 3. You will import your old set of tables to the new database.
  6. Upload the wp-content folder. Overwrite the wp-content folder on your new host with the version you downloaded in step 2.
  7. Update Database references in wp-config.php – table prefix, user name, password to point to your new set of tables.

You’re done.

N.B. Some wordpress security plugins create a file for firewall rules – you’ll need to disable this feature before you export the database/copy the filesystem, then re-enable it afterwords.

Now remember when we said you’d leave your domain name with the old registrar? That was because you’ll need to test your new site. Thoroughly. Over a period of days to be sure that the migration was successful.

First you need to change the hosts file (etc/hosts on OSX or Linux) on the computer you are using so that the domain name you are using points to the new host. You should be able to find the IP address of your new site in the admin panel. The new entry at the end of your hosts file should look like helterskelterdesign.co 123.456.789.012 where helterskelterdesign.co is your domain name and 123.456.789.012 is the IP address of the server you are migrating to.

Empty your browser cache at this stage to be absolutely sure that the content you are viewing is being served from the new install and not your local cache.

Once you have tested everything to your satisfaction, go to your old host and change the Nameserver entries in the DNS settings for your domain name to point to the Nameservers of your new host – you should be able to find these in the admin panel too. This may take several hours to be fully effective, during which time content may be served from both sites. Leave it for 24 hours to be sure. Now your site is migrated and all traffic will be coming to your new site.

Optionally at this stage, you may want to bring the domain name over to your new provider. You’ll need an EPP code from your old provider to do this, but most will have a screen in domains that allows you to unlock the domain (to make it available for transfer) and generate the EPP code. Copy the EPP code and at your new hosts admin screen for domains, check “Import Domain” and follow the prompts, inputting your domain name and the EPP code.

Don’t forget that your email is associated with your domain – so if you’re going to migrate the domain name too then you’ll also need to change the MX record to reflect the new mail server address.

Now you’re completely migrated. Another brew…

If you’re not confident to tackle this process on your own, we can help. We provide WordPress site migrations as part of our service.

Related Posts