When you want to move a WordPress Site to a new host, it doesn’t have to be difficult or risky. Even if you have zero experience migrating a WordPress site, you can do it on your first try.

This step-by-step tutorial will show you everything you need to get your new site up and running on the first try.

My WordPress Migration Process

If you read five blog posts on moving a WordPress site, you’re going to get five different ways of doing it. Is one way better than another? It depends.

How good are you at troubleshooting issues if something doesn’t go as outlined?

Not good you say? Even if you are, do you want to waste time fixing bugs immediately after a move or even later down the road?

I don’t, and I have moved over 100 WordPress sites.

The way I am going to outline in this post is the most efficient way I have found. It has worked every single time I have used it (25+ sites).

In fact, I just moved this website a week ago with this exact process.

I will also be using another one of my sites in this post to show a real site move.

Why Change to a New Web Host

The reasons for moving to a new web hosting platform are pretty obvious.

  • Pricing
  • Customer Service
  • Ease of Use
  • Performance (speed, website neighborhood, etc.)
  • Security
  • Traffic

Pricing is an obvious reason to switch hosting. I wouldn’t move a site on price alone, but many people like to hop around and take advantage of the introductory offers of hosting in the first year or two.

Customer service is one of the biggest reasons people move to a new host. If you read reviews on web hosts, that seems to be the biggest complaint about any company in question.

When I ran my digital marketing agency, I was on the phone/chat with at least one host, every single day. As someone who has logged countless support hours, I can promise you that there isn’t a single host that has perfect support.

Ease of use is an often overlooked factor when choosing a web host. The interface you will use to administer your website should be considered.

You have many different web panels such as cPanel, Plesk, and dozens more.

I prefer cPanel, so all things being equal, I will choose a host that has cPanel.

Performance and security are two huge reasons to move to a new host. It just isn’t worth it to be on a risky host or a poor performing host.

The final reason to move is traffic, which is a good problem to have. Your website might have so much traffic it warrants upgrading.

Choosing a New Web Host

When I ran my digital marketing agency, we did a ton of website migrations. We also did a lot of malware/link injection cleanup. Another popular service was WordPress speed optimization.

Having hands-on experience with well over a hundred web hosts gave me great insight into what is a good host and what is a bad host.

Following, I will share my preferred budget host and one to avoid.

siteground-logoMy top choice for budget hosting is SiteGround, which is where I host this site. They have great pricing, performance, outstanding customer service, and offer free SSL certificates from Let’s Encrypt.

A host to avoid would be GoDaddy. 90% of the sites we cleaned up for malware issues or moved to a new host because of performance issues were on SlowDaddy GoDaddy.

Steps to Move WordPress to a New Host

With preliminaries out of the way, let’s outline what we’re going to do to move a site.

  1. Backup your existing site
  2. Set up your new site
  3. Restore data from your old site to new site
  4. Point your website URL to the new host

Let’s get started.

Site for this Tutorial: Mountain Bike FAQ

Mountain Bike FAQ
For demonstration purposes, I am going to move an old website of mine called Mountain Bike FAQ.

The 30-second back story of this site is I created it years ago to have a place to store my notes when I was building bikes or wheels.

I had no intention of anyone ever seeing the site other than a few guys that I ride with that wanted to do similar upgrades. That is why the copy/theme/everything is dreadful.

One day, after only 3-4 posts on it, I noticed it was getting 2k visitors a month on it. It only gets 700-800 a month now, since it hasn’t been updated in years, so I am most likely deleting it after this case study.

We’ll see.

Google Analytics

In any event, this site is hosted with iPage (terrible). I will be moving it to my SiteGround account for this tutorial.

Move a WordPress Site: What Files to Backup

To begin, we’re going to start with your website files and then your WordPress database.

Login to your favorite FTP app and connect to your existing web server that you are leaving. It should look similar to the screenshot below.

WordPress Transfer

With any WordPress site, you have a basic file structure, so determining what needs backing up is simple.

You typically have six areas to review when connecting by FTP to your web server.

  • Files in the main directory
  • wp-admin directory
  • wp-includes directory
  • cgi-bin directory
  • Any extra directories
  • wp-content directory

Let’s start with all the loose files in the main directory. The good news is you can ignore all of the files that start with wp- except the wp-config.php.

The wp-config.php file is the most important files on your site, so back that one up to start.

Four more files you can ignore are:

  • index.php
  • license.txt
  • readme.html
  • xmlrpc.php

WordPress files for backup

Now we can take a look at all the directories (folders). You do not need to backup anything from the wp-admin, wp-includes, or cgi-bin (if you have one). We will come back to why, later, so let’s keep moving forward and recap.

In just a few minutes we have the following areas backed up or ignored.

  • Files in the main directory
  • wp-admin directory
  • wp-includes directory
  • cgi-bin directory
  • Any extra directories
  • wp-content directory

That leaves any extra directories you might have and the wp-content directory, which has most everything you need to backup.

In the case of the Mountain Bike FAQ site, there is a STATS folder I can backup, so I am going to do that now. I know I don’t need that folder, but we’ll assume this is my first time and copy it anyway.

If you have more than one site on your host, you will see each website with its own directory in this root directory. Be sure to repeat the entire backup process for each site.

If you are uncertain about anything, grab a copy just to be safe.

Diving Into the wp-content Directory

Inside of the wp-content directory we want to backup at least three things:

  1. Your theme(s)
  2. Your uploads
  3. Your plugins

WP backup

You can backup the entire themes, uploads, and plugins folder (more on that in a second) and keep things simple.

I like to be a little tidier in my moves. It is kind of like moving your house or apartment…you can throw out stuff you no longer need along the way or just pack everything up.

Computer file hoarder

Taking the tidy approach, dive into your themes folder and review the themes inside of it. I only copy over the current theme (and previous theme if I recently updated). I ignore the default WordPress themes (twentyfifteen, twentyfourteen, and twentysixteen).

In the case of the Mountain Bike FAQ site, I will just copy over the ProSense theme, as that is the current theme.

Next, you can backup your uploads directory. This will be your assets you added to your site, like your pictures, so don’t forget this one.

Plugins Folder Special Consideration: Caching

Let’s now discuss the plugins directory. For the most part, you want to grab the whole folder and copy that over. Where it can get tricky is if you are using a caching plugin such as W3 Total Cache.

W3 Total Cache

I do not see this next point talked about much when moving to a new host. It is an important topic if you have a caching plugin on your site.

The settings in your caching plugin you used on one site might make your new site run slow.

When you move to a new host, you should do a Google search for “best W3 Total Cache settings for .” If you don’t find an article from your new host, you can always contact their support.

You have a couple of options when it comes to moving over your caching plugin.

  1. Keep everything in place for the migration and tweak the settings when you are up and running on the new host
  2. Uninstall your caching plugin for the move and then reinstall it once the new host is up and running

I choose not to move caching plugins when I am moving sites unless I have a CDN enabled in the caching plugin. If you are using a CDN with your plugin, it is sometimes easier to move over the plugin.

Since I am not running a CDN on Mountain Bike FAQ, but I do have W3 Total Cache installed, I am going to delete W3 Total Cache prior to the move.

Unfortunately, it isn’t just a matter of of ignoring the W3 Total Cache folder when copying over plugins. You have to perform a few additional steps.

To delete W3 Total Cache for the migration, follow these steps:

  1. Delete your cache within W3 Total Cache
  2. Deactivate the W3 Total Cache plugin
  3. Delete the W3 Total Cache plugin from the plugins folder
  4. In your wp-config.php file, remove the line define(‘WP_CACHE’, true)
  5. Delete advanced-cache.php, object-cache.php (if you have one), w3tc-config directory, and the cache folder from the wp-content directory
  6. Check your .htaccess file for any code added by W3 Total Cache and remove it

If I was moving the plugin over to the new site, the main files would already be inside of the copied plugins directory, but I would also need to copy over:

  • advanced-cache.php
  • cache (directory)
  • object-cache.php
  • w3tc-config (directory)

Recap of the Files Moved

  • Files in the main directory that aren’t a part of the default WordPress install
  • Any extra folders outside of the directories outlined above (in this case, STATS folder)
  • Uploads folder (inside of wp-content)
  • ProSense (my theme inside of themes folder in wp-content)
  • Plugins directory (minus W3 Total Cache since I won’t be moving it over)

Backing Up Your WordPress Database

Believe it or not, backing up your database is easier than the file backup we just performed.

In fact, this step will take less than five minutes. Here we go.

Login to cPanel on your old host and find phpMyAdmin.

phpMyAdmin

Once in phpMyAdmin you will see your databases on the left. If you only have one site on your hosting, then it should be easy to find. If you have more than one site, you need to select the database that is the site you are trying to move. If you are unsure, check your wp-config.php file, and it will tell you.

Once you have your database selected on the left, click Export in the menu options along the top.

Depending on what version you have of everything, you will either get the easy way of exporting or the long way.

The easy way will look like the following:

WordPress Database Backup

Go ahead and make sure Quick and SQL is selected and hit Go. Your database backup is complete.

WordPress Database Export Options

If your host doesn’t have the easy method for exporting, then you might have to select some options while exporting.

I have included a screenshot of one of the more difficult hosts, in this case the iPage host I am moving the Mountain Bike FAQ site from, in case you need them.

The easy method and the link above should cover 90% of the hosts out there and this screenshot should cover that final 10%.

Advanced WordPress Export Settings

You should now have a clean backup of your database.

Preparing Your New Web Host for Your Website

Setting up your new web host is easy. Since it is a blank slate, the first thing we want to do is add WordPress to it.

So let’s head on over to WordPress and download it. Once downloaded, you’ll want to unzip it.

wordpress install files

You should now have the core WordPress files ready to copy over to your new host.

This is why we didn’t back up those excluded files at the beginning. There is no need to copy them over when we can install a fresh version of the files.

Begin copying everything you downloaded from WordPress except the wp-config-sample.php. Skip that file.

You now have the latest version of WordPress on your new host.

Copy Your Website Data Files Over

The process for copying over your data files you backed up is as follows:

  1. Copy any file that was in your main directory (except the wp-config.php file) to your new host’s main directory
  2. Copy over any extra directories you had. In my case, the STATS folder was an extra one, so I am copying that one over to the main directory
  3. Next, move to your wp-content folder on the new host
  4. Copy over your uploads folder
  5. Now move into your themes folder on the new host
  6. Copy over your theme(s) you backed up
  7. You can now delete any extra WordPress default themes you do not wish to keep. It is a good idea to keep at least one, but the others can just present security risks.
  8. Go back to your new host’s wp-content folder and navigate to the plugins folder. Before you copy over your backed up plugins, delete the default hello.php file and Akismet folder (if you don’t use that plugin). Now go into your plugins folder you backed up and drag the contents of it into this plugin folder (not the whole folder itself)
  9. .

The only file we have to copy over still is the wp-config.php file, but we are not ready for that one yet.

Create a New Database

Now that the main system files are in place, it is time to create a new database to import your backed up database into.

From cPanel, go to MySQL Database Wizard.

MySQL Database Wizard

You will be prompted to complete three steps:

  1. Establish a database
  2. Create a user for the database
  3. Give a password for the user of the database

IMPORTANT: You must write down the database name, user name, and password that you create (including the predetermined prefix) as you will need this to configure your wp-config.php file.

Step 1: Database Creation

WP Database Container

Step 2: Database User

mysql db user

Step 3: Database User Password

WP DB User Password

You now have a fresh database to use with your website on your new host.

Import Your Old Database Into Your New Database

To import the data from your old database into your new database, you need to go back to phpMyAdmin. It is usually the icon right next to the MySQL Database Wizard you just used.

It takes four steps to import your database:

  1. Select your new database
  2. Navigate to your backup of your old database
  3. Uncheck partial import
  4. Make sure SQL is selected and hit GO

import mysql database

That completes the necessary work with databases.

Configure the wp-config.php for the New Host

Now it is time to configure your wp-config.php file you backed up, so it will work with your new host. I like to create a copy of it, so I have the original backup and the version I will edit for the new host.

Editing this file can take place in any plain text editor, so don’t let the .php extension scare you.

To modify, we need to edit and review four lines in the file. Once inside, I’ll also point out a couple of others areas of concern.

wp-config update

Action steps:

  1. When you set up the new database on your new host, you recorded your database name, database user, and database password. Insert the updated information into your file as outlined, making certain to keep the quotes.
  2. Next is the MySQL hostname to review. 90% of all hosts will have ‘localhost’ listed here. You will note in my screenshot that iPage uses something else. You can always do chat support with your new host to find out or Google “MySQL hostname WordPress ” which is what I do if I am uncertain.
  3. You could stop at this point, but I highly recommend you review the Authentication Unique Keys and Salts section. If you have something in this section, there is no need to change it. If it is empty, take the two seconds to go to the link outlined and get your keys and insert them into the file to improve your website’s security.
  4. The final note in the screenshot is the prefix to your database. Make sure you do not change this.

Once finished with the file, upload it to your new host’s main directory with the other WordPress files.

Flip DNS to New Host and Speed Tests

The final step in migrating a WordPress site is to point your domain name to the new host. Before I do that, I like to do a speed test of the old host and then a speed test of the new host to see if I upgraded in the performance department.

Here’s the results of the Mountain Bike FAQ site on iPage before the switch. You will note I did the first test with W3 Total Cache enabled and then again without W3 Total Cache turned on.

iPage Speed Test with W3 Total Cache

WP speed test 1

iPage Speed Test without W3 Total Cache

WP Speed test 2

It is now time to point the domain name to SiteGround for the Mountain Bike FAQ site.

DNS flip

Depending on where you have your domain name registered at could determine how long it takes to populate and show your new host.

I use NameCheap, which is really fast, but if you have GoDaddy or somewhere else, it might take up to 24 hours.

To check, just visit a “who hosts this” type of site and check.

Who Hosts This

Now that I see the site is comfortably on SiteGround, I will run another speed test to see if it improved or was worse than the two iPage speed tests above.

You will recall I did not move W3 Total Cache over, so this speed test will reflect with a caching plugin, which was significant in the results with iPage.

SiteGround Speed Test

Wow! Big difference.

From here, if I cared about this site, I could work on getting it under three seconds. SiteGround has their own cache system you can implement in cPanel which is a really nice benefit to their hosting. That would for sure speed the site up a little more.

And, of course, I could use a caching plugin as well such as W3 Total Cache. For what it is worth, I am moving away from using that plugin altogether, so I won’t be adding it.

Move a WordPress Site: Closing Thoughts

When it comes to moving your site to a new host, you have several options. You can use a plugin, your hosts full backup method, or even have the new host do the move for you.

The reason I choose to do the method outlined is just based off of reps. I have tried all of the other methods and find this outline proven for me.

Your mileage may vary.

The most important thing to remember is you cannot screw anything up if you just carefully backup everything.

Now that you have your new host set up, make sure you SEO optimize it. Sign-up for the FREE SEO series below to get started.

Grow Your Business with SEO

FREE 7-day email course on SEO, even if you have no experience. Proven strategies I have used with businesses of all sizes.

0 Be first