Migrating WordPress (and Multisite!) to a New Server

If your website has outgrown your basic hosting plan, it’s probably time to upgrade and move to a new, bigger and better server.

The WordPress Codex has a guide to moving WordPress, but it contains so much information that it’s overwhelming and difficult to follow.

Luckily, whether you’re trying to migrate a single site or a Multisite network, moving to a new server follows the same basic process. While it is a little fiddly and it does take some time, when you’re finished you will have more breathing space for your site to grow.

If you follow the steps below, you should be able to make the move error-free – and you may even find it fun. Let’s find out.

Basic Housekeeping

Before you do anything it’s a great idea to backup your entire site. If anything goes wrong, you can quickly restore your site and everything will be back to normal.

There are many ways to make an automatic backup, such as with our Snapshot plugin or manually using FTP.

If you need a bit more direction, you can take a look at the WordPress Codex’s Backup page.

Once you have your extra backup, you’re all set to start the migration.

Download Your Site’s Files

Fire up your favorite FTP program and enter in your site’s FTP details to connect to your server.

If you don’t have an FTP account, it’s easy enough to set one up. If you’re using cPanel, log in and click “FTP Accounts” in the “Files” section. Enter in your desired login information and make sure the directory you select includes the location of your site.

The username, password, directory and quota fields have been filled out to create a new FTP account in cPanel
I have selected an unlimited quota since I know my site isn’t big enough to pass my allotted monthly upload threshold. You can add a specific number of MB if you’re worried about it.

The site I’d like to move is in the root of my files so I have entered public_html under “Directory.” Once you have everything filled out, click the “Create FTP Account” button.

You’ll see your new account listed below the form along with any pre-existing accounts. You can now access your files through FTP.

Your “Host” is your site’s IP address which you can find listed under the “Stats” column on the main cPanel screen. You may need to click the “Expand Stats” link if you don’t see it listed. Enter 21 under “Port” and connect.

If you’re using FileZilla, you’ll see your site’s folders listed on the right. Select the files and folders of your entire site, then drag them over to the left of the screen to a folder on your computer.

This is going to take a while so get comfortable.

If you run into FTP issues and you’re not sure how to solve them, our article 3 Common WordPress FTP Upload Errors and How to Fix Them might help. Otherwise, get in touch with your FTP program’s tech support.

Download Your Database

In cPanel under “Databases,” click the phpMyAdmin button. Select the database from the menu on the left-hand side, then click “Export” at the top of the page.

On phpMyAdmin's "Export" screen, the quick export method is selected with a radio box and the format is automatically set to "SQL."
The quick export method that’s selected by default should be perfectly fine, but if you run into any issues, you may want to select the “Custom” option and change any necessary settings.

The default settings are usually fine so go ahead and click the “Go” button. Save the file to your computer and wait for the file to download. If you have a larger site, this may take a while.

Create a Fresh Install

Now you need to create a database on your new server and edit your site’s wp-config.php file to reflect the changes to your database.

You could do this manually, but the easiest way to do this is by creating a fresh install of WordPress automatically. Most hosts offer one-click WordPress installation.

So go ahead and install a fresh copy of WordPress. Add your desired URL and if you’re using Multisite don’t forget to select that option before you finish the installation.

If you need to change your domain as well, this is the point where you need to follow the instructions in our article Moving Multisite to a New Domain (Without Errors!). When you need to search for your old URL in your database, come back to these steps to finish up here before continuing.

Once your fresh install has completed, download the wp-config.php file using FTP or cPanel’s File Manager and save it to your computer, replacing your old copy.

Don’t forget – if you made any changes to your old wp-config.php file, be sure to edit your new one to add in those changes to avoid errors.

Upload Your Site

Login to your new server through FTP and select all your site files from your computer and move them to the folder that contains your fresh install. You’ll need to make sure you’ve created an FTP account for your new server as you did for your old one.

A pop up that appears in FileZilla when uploading your site to replace the fresh install. The "Overwrite" radio button is selected under "Action" and the check boxes "Always use this action" and "Apply to current queue only" are checked.
You don’t have to keep the “Apply to current queue only” box checked, but if you leave it unchecked, all your future file uploads will use this setting unless you change it manually in the settings.

You’ll quickly see a pop-up appear if you’re using FileZilla that will let you know you already have a file that exists with the same name. We want to replace the files of the fresh install with the ones for your original site.

Keep the default “Overwrite” option selected and also select the checkboxes for “Always use this action” and “Apply to current queue only.”

The first checkbox will prevent you from having this pop-up appear separately for all the other files to save you time. The second option will delete these settings once your current FTP session has closed to prevent future errors.

Once you have made these selections, click the “OK” button.

It will take a while for your site to upload, but don’t feel you need to be glued to your computer screen the whole time. You can even finish the rest of the steps while you wait.

Drop Your New Database Tables

Login to phpMyAdmin on your new server and select the name of the new database that was created with your fresh install from the menu on the left. The page should populate with tables.

Click the “Check All” box at the bottom and in the dropdown box next to it, select “Drop.”

The "Check All" box is selected in phpMyAdmin and the "Drop" option is being selected in the dropdown box next to it.
Since this is a fresh install, you don’t need to backup everything, but you can if you’d like. Keep in mind if something goes wrong it may be faster to delete the fresh install and make a new one depending on your backup method.

A new page will load asking you if you’d like to drop all the tables. Go ahead and click the “Yes” button.

Upload Your Database

Once that’s done, click the “Import” button at the top of the page.

Your now empty database should still be highlighted from the menu on the left. If it’s not, be sure to click it again or this step won’t work.

Click the “Choose file” button that appears on the page and select your database file you saved on your computer. The other default settings should be fine.

In phpMyAdmin's "Import" tab, the "Choose file" button has been clicked and a database file has been selected and opened.
I have an upload limit of 2.5 GB which is more than enough, but if you have a much smaller limit, your upload will fail. This can be changed in your php.ini file. If you don’t have one, you can create one.

Click the “Go” button at the bottom of the page to complete the upload.

Update Your Nameservers

The only thing left to do is ensure your domain is pointed to your new server. You will need to locate your nameservers which are usually under your account settings and could have been emailed to you when you opened your hosting account.

Each hosting company and domain registrar is a little different so check with yours to find out exactly how to complete this step if you’re not sure.

Once this has been done, it will typically take up to 48 hours for your settings to propagate and for your site to appear from your new server. If you’re not sure if it worked, you can lookup your site through WHOis.net and check to make sure your new nameservers are listed.

Conclusion

These steps should make a daunting task quick and painless. If you would like an easier option still, there are many plugins available that can automatically migrate your site, such as Duplicator and WP Migrate DB.

There’s also Backup Buddy, which can help you migrate your sites with no downtime.

If you need to migrate many single sites into a Multisite, check out our handy guide: Migrating Multiple Blogs into WordPress Multisite. If you just need to move your site from a subdirectory to the root of your server, take a look at our post How to Safely Move Your WordPress Site (Without Losing Anything!).

Were you able to successfully migrate your site? Share your experience in the comments below.

15 Responses

    Stacey

    What about just using snapshot? Backup the site like you suggest, then on your new WP install – install Snapshot, then upload the your Snapshot backup?? Just wondering.

      Jenni McKinnon

      Hey Stacey!

      You could totally do that. You would still need to update the database tables and follow the rest of the instructions. That would be a great short cut, though! You wouldn’t need to wait for your FTP program to copy all the files.

      Best of luck,
      Jenni McKinnon

      P.S. Sorry, I just realized I wasn’t being clear. Yes, you could definitely do that. As long as the new install is completely replaced with the original, both files and database which should be the case. Then you would just need to update your nameservers. Just make an extra backup copy and keep it somewhere safe, just in case. :)

      Jenni McKinnon

      Hey Chuck,

      The instructions will be the same. You would just need to pay extra close attention when it comes to updating your database tables, since you’re hosting many blogs in one database. It will also be a bit trickier if you’re using domain mapping and each blog has its own domain.

      Using a search and replace plugin will likely make the whole thing easier for you. Just don’t forget to do a complete backup of your Multisite, just in case. :)

      Good luck!
      Jenni McKinnon

      P.S. Sorry, I thought you were commenting on a similar post I wrote about changing your Multisite’s domain name. It should be the same as long as your domain name isn’t changing. You will just need to make sure you install Multi-DB in your new install, the exact same way you did on your original site, then continue with the instructions after that.

      If your domain is changing, then you would need to be careful and update your database tables and the rest of what I wrote applies.

    Maurice Green

    Your article is very timely for me, but I only wish it were as simple as you say. I am in the process of moving a number of sites from shared Linux hosting to CPanel and have seen a number of issues. Having worked in Drupal before, the single thing I dislike about WordPress is the fact that the links in the database are NOT relative to a base URL. They are absolute and serialized. This means you can not simply use phpMyAdmin to transfer the database if either the URL or the file path change. I am very happy that there are plugins like Duplicator and WP-Migrate DB to make the necessary database changes.
    The most interesting problem I’ve seen is a sudden appearance of random ‘international’ characters replacing punctuation marks in a post or page. Cory Lamie (author of Duplicator) confirmed that this is a known problem, probably related to database encoding. Forewarned is forearmed.

      Jenni McKinnon

      Hey Maurice,

      I know exactly what you mean. It certainly can be tricky if you need to change the URL of your site while you’re also migrating it. I did write an article with instructions for that and I mentioned it in the section “Create a Fresh Install.” You should be able to use both to make the migration successful.

      You’re absolutely right, though – plugins make this process so much easier.

      Good luck on your site migration. Hope the articles are helpful!

      Cheers,
      Jenni McKinnon

    oncourssadmin

    Hey there Jenni, could you give me a quick overview of your preferred method of migrating a single site off of a multisite install (with multi DB) to a standalone, regular wordpress install? We have been playing around with different options but none are all that smooth and I just wonder if there may be a plugin available that takes this scenario into account.

    Thanks!

      Jenni McKinnon

      Hey,

      The way I would do it may not be the most efficient way so I’ve asked for a staff member to provide you with an overview of what you need to do since they’d have the best possible advice for you. They’ll reply here soon.

      Cheers,
      Jenni McKinnon

      Jude

      Hi there @oncourssadmin,

      I’m not sure if there is a one size fits all solution for this type of thing simply because there are too many variables. Also this type of migration is usually one way.

      The best way to do this would be is as follows

      1) Create a database for your single site with its access rules setup like you would for a single site.
      2) Identify the correct database which contains the site you want to move and export the table based on its blog_id. Either via a Query + mySQL dump or a tool like phpMyAdmin
      3) Now move this export like you would a normal WP migration. You may need to search and replace strings in the tables if you are moving site address as well.

      Consider writing a script to do this if you are repeating it for many sites.

      Hope that helps

    Smithwood

    Unfortunately this didn’t work at all for me. The theme is broken. I think it could be because I’m migrating from hsphere to cpanel but either way, not worth the trouble, will try plugin.

      Jenni McKinnon

      Hey Smithwood,

      I’m sorry to hear it didn’t work for you! You’re right, it’s a bit different when migrating from hsphere, but hopefully one of the plugins worked out well for you!

      Cheers,

      Jenni

    mpress

    Hi,
    Thanks for this tutorial. As a newbie I find this kind of tutorial really great. Otherwise I would not be able to have it done.

    When you mention “nameserver” here:
    “quote” The only thing left to do is ensure your domain is pointed to your new server. You will need to locate your nameservers which are usually under your account settings and could have been emailed to you when you opened your hosting account.”unquote”

    Do you mean the domain name [www…. or http://….]?

    Thanks

    Lesmes

    Hi,

    Talking about outgrown your basic hosting plan and multisite. What can we do if the success of our site outgrowns our server. What can we do? Create a cluster of servers?

    Thanks

Comments are closed.