Categories
Blogging Content Marketing Create HTML Email Learn Web Development

How to Move a WordPress Website to a New Hosting Provider in 4 Easy Steps

I’ve recently decided, after several years at another hosting provider, to move this website to Bluehost.  I’ve hosted a number of websites at Bluehost for various purposes, but just never got around to actually moving my personal blog until now.  This post will walk you through the 4 steps to move your site!

Just a note about Bluehost.  I’ve personally used several webhosting companies and all the reputable ones are pretty good.  But Bluehost is definitely my preferred hosting provider on the basis of price and how easy they make it to set up a new site.  In addition, I’ve always had good technical support when a problem has come up, which to me is a lot more important than just getting the cheapest price.  I will also freely disclose that I do have an affiliate relationship with them so if (and only if) you find my tutorial helpful and want to sign up for a Bluehost account, please consider using one of the links found here.

You can also use this same process to move to any hosting provider, just keep in mind that the hosting tools may look a little different than the images below.

On to the process… First, while it’s not hard, you do have to pay attention to the details.  Second, there are a handful of moving parts to a project like this, but if you’ll follow my instructions, it’s really not as intimidating as it may seem.

For starters, here’s a general overview of the steps that we’ll take.  We’ll get into the details below

Overview of the Process

Step 1 – Copy your website and Export your MySQL database

Step 2 – Set up your domain on Bluehost

Step 3 – Upload your website to Bluehost, create a database and import your .sql file.

Step 4 – Edit your configuration files and change the Nameservers.

You’ll need a few things before you get started (in addition to some coffee & some patience):

  • A Bluehost account (this is sort of a given, but someone’s going to ask…)
  • An FTP program such as Filezilla
  • Access to your existing hosting account.
  • Access to your domain registrar.  If you bought your domain through your original hosting provider, that’s fine.
  • An HTML editor.  In this post, I’m using Dreamweaver, but it’s an expensive program and there are plenty of cheap and free options out there, such as Komodo Edit (for Mac) or Notepad++ (for Windows).

So… let’s get started!

Step 1 – Copy your website and Export your MySQL database

If you’re used to working with an FTP program, this part is easy.  Just establish a connection with your current hosting provider, navigate to the folder containing your site files and copy everything down to a place on your local computer.  I like to create a folder on my desktop and use that so I have all my files together.  This will also create a backup of your site that you can use to restore your site if anything gets messed up.  Depending on your internet connection, this may take a while.

Not in the habit of making site backups?  Assuming that your hosting provider is doing that for you?  Don’t.  Make regular backups of your website!  With most hosting providers, you can ask their support and they will make a compressed backup for you.

Exporting the MySQL database has a little more to it, but hang with me… it’s not that hard.

From the admin panel or cPanel of your existing hosting provider, find the database tools area.  You should have an icon for accessing the MySQL databases and another icon for phpMyAdmin.

Here's the admin panel from my original hosting provider.
Here’s the admin panel from my original hosting provider.  In the databases section you can see MySQL Server, phpMyAdmin and other tools.

You’ll start with with the MySQL database area.  This will give you a list of all the databases on your account (if you have more than one).  If you have several, you’ll need to make sure you pick the right one for your site.  Below, I have a number of databases and the login icon to the right will launch phpMyAdmin.

In this example, I have a number of databases to pick from.
In this example, I have a number of databases to pick from.

If you don’t know the name of your database (assuming you have several and they have generic names), finding it is easy.  You simply need to use your FTP client to find the wp-config.php file on your site, open it and you will see the database name, the database user name and the user password.

Above is the wp-config.php file for my original hosting provider. Here you can see all of the necessary information: database name, db user, db user password and host name.
Above is the wp-config.php file for my original hosting provider. Here you can see all of the necessary information: database name, db user, db user password and host name.

Using either a link to launch phpMyAdmin or go to the phpMyAdmin icon on the cPanel.  You may need to login to phpMyAdmin and then select the appropriate database or you may be able to launch phpMyAdmin directly from your database setup link on your hosting provider.  They’re all a little different.  Here’s an example of what it may look like:

phpMyAdmin with the database selected.
phpMyAdmin with the database selected.

Here’s where you can see all of the tables in the database.  This is the guts of your website and all of the data in your WordPress site is here, so be careful.  Just follow the steps and don’t do anything crazy.

Select the database on the left side so that all tables are highlighted (see the left side drop down list in the image below).  Then find and select the Export button on the top navigation bar.  You’ll get something that looks like this:

phpMyAdmin Export Utility
phpMyAdmin Export Utility

Unless you are doing something advanced (and you’re probably not reading this post if you know how to do that), leave the default options as they are and select “go.”  You will begin downloading the SQL file.  Depending on the size of your database, this may take a little while and the file will (most likely) be in your downloads folder.

I've successfully downloaded the SQL file. Note the size of it... big! I'll go over what happens when the file size is too big to upload using the Bluehost utility.
I’ve successfully downloaded the SQL file. Note the size of it… 82.3MB! I’ll go over what happens when the file size is too big to upload using the Bluehost utility.

Once both of these processes (FTP & database export) are completed, you’re done with Step 1 and ready to move on to the next stage.

(If you find this tutorial helpful and need a hosting provider, please consider signing up with Bluehost through my affiliate link!)

Step 2 – Set up your Domain on Bluehost

You own the Domain, but it’s still associated with the original hosting provider.  Bluehost doesn’t know anything about your domain, so you need to tell them that the domain exists and you’ll need to validate it by getting the domain’s EPP key from the registrar.  In this video, I’ll go over the process.  Below you will find the same step-by-step instructions.

First, go to the Domains section and select Domain List and then select “Assign a domain to your cPanel account.”

Assign a domain to your cPanel account.
Assign a domain to your cPanel account.

Enter the domain name then you will need to verify the ownership of the domain.

Enter your domain name
Enter your domain name

There are several ways to verify the website.  In this example, I’m going to get the EPP code from my domain registrar and enter that into the appropriate field:

Enter the EPP Code to verify the domain name.
Enter the EPP Code to verify the domain name.

What’s an EPP Code, you ask?  The Extensible Provisioning Protocol is a unique code associated with your domain.  The bottom line is that you need this so that your domain can be verified as yours and someone else can’t steal it.  In my example, here’s are the settings for my domain, where to get an EPP/Auth Code and what the process looks like.  Keep in mind this will be different for each registrar, but the process is conceptually the same.

Domain settings. Under General Settings there's an option for getting the EPP key
Domain settings. Under General Settings there’s an option for getting the EPP key

In general settings, there’s a link to Email Auth Info to Registrant.

Email Auth Info to Registrant
Email Auth Info to Registrant

When I click the Email link, I receive an EPP Code.  Enter this code in the Bluehost validation field and keep going.

My email with my unique EPP key.
My email with my unique EPP key.

Next, you’ll pick where you want to put the domain name.  Bluehost will create a folder for the domain… you’ll want to use that.  You have the option to create a different location if you want to.  This is where you’ll be copying all of the website files that you downloaded in the previous step.  At this point, you’re ready to create the new database, import your SQL file and upload all your website files.

(If you find this tutorial helpful and need a hosting provider, please consider signing up with Bluehost through my affiliate link!)

Step 3 – Upload your website to Bluehost, Create a new Database and Import your SQL file

Now that we’ve added the domain (and verified it) to your Bluehost account, we need to upload the website files to the appropriate directory and then create a database and import the SQL database file.  When you assign the new add-on domain in Bluehost, Bluehost’s server will create a directory for the domain and populate that with some default web files.

Connect to your Bluehost account using FileZilla (or whatever FTP client you prefer).  If you haven’t set up an FTP user in Bluehost, follow the steps below to do that.  If you have, then skip down to the section on uploading the files and creating the database.

Creating an FTP user for Bluehost

In the cPanel, find the FTP icon.  It’s at the top in the File Management section:

Select the FTP icon to set up a new FTP user
Select the FTP icon to set up a new FTP user

Add a new user in the Add FTP Account area.  You can name that user whatever you want & set a secure password (make sure it’s one you will remember or write it down somewhere).  It will create a user ID for your FTP account.

Add an FTP user
Add an FTP user

Once you have your user set up, configure the site in the FileZilla site manager.

Configure the site manager to connect with your Bluehost account using the new user you just created.
Configure the site manager to connect with your Bluehost account using the new user you just created.

Upload Your Website Files and Create a New Database

Once you’ve configured your FTP client to connect to Bluehost using the user that you just created, navigate to the folder with your domain (this was created when you set up your add-on domain) and copy the website files, which you previously downloaded to your desktop, up to Bluehost.

Copy the website files from your desktop over to the domain folder on your Bluehost account.
Copy the website files from your desktop over to the domain folder on your Bluehost account.

While your files are uploading, you can go back to the Bluehost cPanel and create a database for your website.  Effectively what you’re doing is creating creating an empty database which you will then populate by importing your SQL file – the one that you exported back in Step 1.

Creating a new database is an easy step.  With Bluehost, you need to navigate to the Databases area.  You can get there by selecting the “Databases” link at the top navigation bar, or if you’re in the cPanel, you can find the “MySQL Databases” link in the Database Tools section.  They’ll both take you to the same place:

Creating a new database is as simple as naming it and assigning a database user.
Creating a new database is as simple as naming it and assigning a database user.

Enter your database name – it can be whatever you want.  Next, you will need to assign a database user to the database.  If you already have a user (this would be the case if you have other websites already), then you can use that.  If you don’t, creating a user is simple.

After you’ve created your database, scroll down to the Add New User area and create a new user and then assign that user to the database.  Bluehost will give you a permissions selection screen, and you’ll want to give your primary database user “all permissions” to the database.  Make sure you remember or write down your DB user password.  We’ll need that to connect your database to your WordPress files in Step 4.

Either create a new user and assign it to the database or assign an existing user to it if you have already created other users or other databases.
Either create a new user and assign it to the database or assign an existing user to it if you have already created other users or other databases.

Once you’ve created your database and assigned a user to it, it’s time to import your .sql file into the database.  To do that, we’ll go to the PHPMyAdmin area in Bluehost (remember this from your original host when we exported it in Step 1?).

Find phpMyAdmin in the Database Tools area of the Bluehost cPanel.
Find phpMyAdmin in the Database Tools area of the Bluehost cPanel.

Log into the phpMyAdmin area using your Bluehost account password:

Log into phpMyAdmin with your Bluehost account credentials.
Log into phpMyAdmin with your Bluehost account credentials.

Once inside phpMyAdmin, it will look similar to the administrative area from Step 1 (there may be some variations).  Find and select the import option on the top navigation menu.

Find and select the import option on the phpMyAdmin navigation menu.
Find and select the import option on the phpMyAdmin navigation menu.

The import process is pretty straightforward.  You select the .sql file that you previously exported in Step 1, leave the default settings alone (unless you know what you’re doing and purposely made changes when you exported the original file) and select go.  I’ll go through that in a minute but first make sure that the filesize isn’t too big…

This is important!  Note the file size limit of 50MB on the import screen.  You need to check your .sql file – the one you exported in Step 1 – to see how big it is.  If you have a large website and exceed the file size, there are a couple options to get your file imported.

Make sure to check your .sql file to see if you exceed the file size limits. In this case, my file is too big for a normal import.
Make sure to check your .sql file to see if you exceed the file size limits. In this case, my file is too big for a normal import.

If the file is over 50MB, you can either compress the file or you can upload the file to the TMP directory on the Bluehost server using the File Manager option in the cPanel (you can’t do it with the FTP client by default).  This might sound a little complex, but it’s really not hard.  Here’s how to do it:

Select the File Manager from the cPanel.

Select the File Manager in cPanel.
Select the File Manager in cPanel.

Select the domain that you are creating.

Select your domain in the document root area.
Select your domain in the document root area.

Then, in the file manager, find the TMP directory, select it and then use the upload icon to upload your .sql file to the file manager.  By doing this, phpMyAdmin will find the .sql file in the website upload directory and you can directly import it from there.  This effectively gets around the file size limit using the phpMyAdmin upload option.

Use the file manager to upload your .sql file to the website upload directory.
Use the file manager to upload your .sql file to the website upload directory.

Once the .sql file is imported, we’ll get the green light… or bar.

The .sql file has been successfully imported.
The .sql file has been successfully imported.

Now, it’s important to remember that just because the .sql file has been imported into the database, that doesn’t mean that the site is ready to go live.  If you recall, we did not make any changes when we downloaded the site from the original host.  That means that the WordPress files are still configured for the original hosting provider and original database.

In the final step, we’ll modify the wp-config.php file to connect the new database with the website files on the new hosting provider.  But before we go there, here’s the video step-by-step process that we just went over.

Step 4 – Edit your configuration files and change the Nameservers

Now that we have all the files uploaded to the new hosting environment and the .sql files imported into the database, we need to connect them together and then tell the internet where to find your new site by updating the name servers.

The file that controls how the database links to the website files is the wp-config.php file.  You can find this file by connecting to Bluehost with FileZilla, selecting wp-config.php and then selecting view/edit.

046-2

You will need to have a text editor to make changes.  In the video tutorial I’m using Dreamweaver, but there are excellent free options available such as Notepad++ for Windows users andKomodo Edit for Mac users.

Update the wp-config.php file with your new database and user credentials. Note that for Bluehost accounts, you will need to set the host as localhost.
Update the wp-config.php file with your new database and user credentials. Note that for Bluehost accounts, you will need to set the host as localhost.

Even though the “host name” for Bluehost is box484.bluehost.com, you will need to set the DB_Host variable as “localhost.”  If you miss this, you will get an internal server error when you try to connect to the site.

After you’ve made these changes, the next step is to update the nameservers at your domain registrar to point to Bluehost instead of the original hosting provider.  The registrar settings are what tells the internet where to find your website.  Until these are changed to Bluehost’s nameservers, your site URL will continue to point to your old website even if you have all the new files set up and connected.  This is the last step required to take your new website live and complete the migration.

Changing the Nameservers

BulkRegister is my domain registrar.  Each registrar is going to look different, but the process will be the same.  Find the DNS Server Settings.

Find the DNS Server Settings option in your registrar account. In this example, I'm using BulkRegister.com.
Find the DNS Server Settings option in your registrar account. In this example, I’m using BulkRegister.com.

You’ll find the Nameservers here.  This is where you will put the settings that Bluehost provides for their Nameservers.

Updating the nameserver records to point to Bluehost.
Updating the nameserver records to point to Bluehost.

Once you make these Name Server changes, it may take the internet some time for that information to “propagate.”  I’ve had the process take only moments, but in other cases a few hours.  Once this is done, your new website will be live.

Because you won’t be able to tell any visual difference between how your new site looks and how your old one did, you might wonder… did it work?  One way to check this out is to navigate to www.whois.com and look up your website and verify the information.

You can verify that your settings have been updated by going to www.whois.com.
You can verify that your settings have been updated by going to www.whois.com.

Enter your website in the lookup and check the settings:

Nameservers are pointing to Bluehost and the site is working.
Nameservers are pointing to Bluehost and the site is working.

Once your site is working and you’ve verified that the Name Server settings have been changed, congratulate yourself because you’ve successfully migrated your website!

If you’ve found this tutorial helpful and need a hosting provider, please consider signing up with Bluehost through my affiliate link.  Also, please post a comment if you have any helpful advice or observations that others might find useful.

Leave a Reply

Your email address will not be published. Required fields are marked *