How To Move WordPress to a New Host

The process of moving WordPress to a new hosting company once seemed so daunting to me that I spent almost two years with a Web host I was very unhappy with. The site in question received a fair amount of traffic and was a consistent earner. I didn’t want to jeopardize those earnings by switching hosts and dealing with potential complications.

When I sold said site to a somewhat technically-challenged buyer, I had no choice but to dive right in. The simplicity of the move and lack of downtime amazed me, and I’ve since gone on to move the majority of my Web properties to a much faster, more reliable host.

RichWP recommends InMotion Hosting
Their servers are fast and the customer service is excellent. All RichWP Demos are hosted on InMotion servers.
» More Information

Clean Up and Get The Files

To get things started, you’ll need to download your site’s files. I recommended first going through your admin panel and deactivating/deleting unnecessary plugins and themes, as this gets rid of garbage files you don’t want to bring with you. Such files add to the time it takes to download and upload your site. As you’ll find out, the process is already tedious enough.

Connect to your server using an FTP program. I personally use FileZilla (WIN) and Cyberduck (Win & MAC), both are available for free, but any FTP client will do.

Tip: You’ll need your hostname, FTP username and FTP password to connect. If you haven’t done this before, contact your Web host.

Navigate to the folder containing the WordPress installation you want to move. You’ll usually find your site files in the <public_html> directory. Click on the sub-folder  in which your site resides, and then right-click the folder and select “Download.” If your site resides in the root directory (i.e. the primary hosted site), simply highlight all of the files in the root directory and download them to a folder on your computer. I prefer to set the target location as the desktop for easy access.
FTP Client - Move WordPress to New Host

Be patient. Depending on the number of themes, plugins, photos and other files you have, this process could take some time.

Get the Database

Now that the site files are downloading, it’s time to turn your attention to the true heart of your WordPress site: the database. The database is perhaps the most important part of your site, because it contains all of your posts and custom data.

Access MySQL through your Web hosting control panel. Here you should see a list of your databases and a link to manage them through phpMyAdmin.
You should now be at the database-management screen, which looks like this:

PHP My Admin Database Export to move wordpress to new host

Click on “Export,” and then check the selection boxes next to “SQL” and “Save as File.” Scroll down and click “Go” to export the SQL file. It should now automatically download to your computer.

Set Up a New Database and Import Data

In all likelihood, your site files are still downloading, so we’re going to move on to set up the database with your new Web host. Sign in to your new hosting control panel and open MySQL. You should see a link here to set up or create a new database.

Create a custom MySQL database username, and then set a password. Make sure both of these are uncommon and difficult to guess to protect your database against intruders. Once you’ve created the database, your host should assign a custom hostname. Make note of these values and do not lose them.

Tip: In addition to standard characters, use numbers and/or capitalization.

When the blank database is created, sign in to phpMyAdmin to manage it. Click on the “Import” link, and then click on “Choose File.” Select the database SQL file you exported from the previous database. Click on “Go” to import your data into the new database.

Change the wp-config.php

By the time you’ve finished this, your site files should be finished downloading.
Open the folder you’ve downloaded containing your site’s files. In the root directory, you’ll see a file named <wp-config.php>.

Open this file using a text/PHP editor such as NotePad++, TextPad or NotePad2. Do not use a word-processing program.
Scroll down to line 42. Here you’ll see the field containing your MySQL database hostname, username and password. Each of the values will be stored between single quotation marks.

wp-config changes to move wordpress to new host
Replace the present values with the custom values you previously assigned when you created your new database. Leave the single quotation marks in place and save the changes to the wp-config.php file. The WordPress installation will now be linked to your database when you upload the site files.

Upload the Files to the New Host

Now you’ll begin the process of uploading the files to your new hosting account, which is simply a reversal of downloading the files from your previous host. Access your server via FTP and select the downloaded folder containing the files. Set the target directory to the directory or folder you want your new site to reside in.

Tip: If your site will be hosted as the primary site, upload the contents of the folder, rather than the folder itself, to the <public_html> folder.

The transfer may be time consuming, just as the process of downloading the site’s files from the previous host was.
Tip: Verify the permission code for the wp-config.php file on your new server is set to 600 (some caching solutions might require different settings) to prevent unauthorized access. You can view and edit the file permission code by right-clicking on the file when accessing your site via FTP.

file permission settings on wp-config.php - to move wordpress to new host
When the files are finished uploading, you should have a complete working copy of your site on the new server.

Point your Domain to the New Host

It’s important to remember, that your domain is still pointing to the original copy of the site on the old server.

You’ll now need to complete the process by changing the DNS  (Domain Name Server) settings of your domain to point to the new host. Some hosts will also require further setup for your domain. This may result in a bit of downtime for your site while the changes propagate. For this reason, I recommend initiating the switch during a time your traffic is generally minimal.

Check Everything

Navigate through the copy of the site and verify the transfer went smoothly. Check links and post attachments to make sure everything is working correctly, and then browse through your admin panel to make sure it’s working.

Tip: The admin log-in name and password are the same as they were previously.

Once the transfer is complete, it’s safe to delete the files and database on your old server, as the domain permanently points to the files on the new server.

RichWP recommends InMotion Hosting
Their servers are fast and the customer service is excellent. All RichWP Demos are hosted on InMotion servers.
» More Information

About Edward R. Jenkins

Edward is a Florida-based webmaster, writer and photographer. He's built several well-trafficked WordPress based websites over the years. His current projects include TechBunk and The American Liberal.

11 Responses to How To Move WordPress to a New Host

  1. Jesse says:

    Great tutorial, thanks for the help!

  2. Carmia says:

    This is the best tutorial I’ve read about moving your site to a new host. It is more detailed than the others I’ve read and you’ve provided screenshots which help a lot. Thanks for writing it!

  3. Allen says:

    Hi,
    Thank you very much for your detailed instruction! I’ve seen a couple tutorials, yours is by far the best… I am moving my host this week, hopefully everything will be smooth!
    Thanks again!
    Allen

  4. Megan says:

    I followed these instructions as best I could. It was all first-time stuff for me, even at the FTP level. It seemed to be working yesterday, but now I’m getting a database connection error. Do you know how to trouble-shoot that?

    Thanks!

    • Felix says:

      The details for your database connection are in a file named wp-config.php. Check if they are correct. If unsure, I am sure that your hosting support is able to help you out.

  5. Superb… this is best and simplest tutorial. clearly mentioned each and everything….. Good Job!!!

  6. Mike says:

    Wow Allen. I screwed up the transfer myself but this tutorial saved me! Thank you so much. Please let me know if you have a donation link.

  7. Lior says:

    Hi, This is indeed a great “how to”. simple and clear.
    Just one question, at the database export part in the myphpadmin screen there are some check boxes, can you elaborate on which should be checked or should I just go with the defaults.

    THANKS!

  8. It is a perfect tutorial to move wordpress for new host. Thank you, Edward R. Jenkins, for this help.Sucess in your books.

  9. Asea T says:

    Thanks for the great tutorial – just migrated my site over to a new host in a matter of a couple of hours without a single wrinkle thanks to you!

Leave a Reply

Please use your real name instead of you company name or keyword spam.