Step-by-Step: Migrate a WordPress Site to a New Host or Server

Move WordPress site to new host

...or how to move a website to a new host without problems.

If you’ve got a long experience with WordPress, you have probably realized that there's no easy way to transfer a WordPress site to a new host. Moving or migrating a website to a different server or domain is not a trivial task. Simply moving the files and database over to the server, isn't enough to transfer a website to a new hosting. Most likely you'll find lots of Error 500s and Internal Server Errors due to misconfigured .htaccess files or other redirects to your old domain or website. So here's a full guide on how to move a WordPress website to a fresh host without any problems.

The solution to these problems will vary depending on whether you’re moving WordPress but keeping the same domain name, or if you’re moving to a completely fresh domain as well. We've done this several times at www.collectiveray.com, so at this point, we're very familiar with the whole process.

The easy way out

If your current server is not cutting it and you need to transfer your website to a new hosting, you don't have to do it yourself or learn to do it using this tutorial. InMotion hosting can actually do the transfer for you for free. Not only that, but you can rest assured that your website will be much faster on InMotion. Have a look at our InMotion hosting review and our how our InMotion VPS performs (hint - very fast!). 

If you're interested in other WordPress tutorials, we feature in-depth articles often on this site.

Migrate site using WordPress Migration Plugins

If you are not confident in your ability to perform migrations the manual way, the easiest way to do a migration to a new host is using one of the existing plugins out there which are specifically written to be able to transfer websites cleanly from one hosting to another.

There are many plugins you can use, we will mention two which we know and have used and can reliably recommend.

BackupBuddy

Backup Buddy from iThemes Security is a plugin that can be used for both backups and restores of WordPress sites.

Backupbuddy backup page

 

Given that this tool performs all the necessary functions of backing up a website and then restoring that copy, this plugin can be used to perform a full WordPress migration.

We've reviewed BackupBuddy and created an Ultimate guide separately on CollectiveRay, so we would recommend you visit our review here.

Download Backup Buddy 

BlogVault

If you're pressed for time, you can follow these short instructions:

  1. Create a new blank installation of WordPress on the host where you want to migrate to (destination)
  2. Create an FTP user on the destination with access to the WordPress installation
  3. Download the Blogvault plugin
  4. Install and activate Blogvault on the site you want to transfer (source)
  5. In Blogvault on the source, perform a backup of the site
  6. In Blogvault enter the FTP details of the destination
  7. Enter the URL of the new site
  8. Click on Continue to start the transfer
  9. The site will be migrated completely automatically

Let's get into the details of the actual transfer of the WordPress site to the new host.

The first time we encountered this plugin was when we migrated one of our sites to WPEngine (in fact we have a full article here).

As you might have experienced (or not, as the case may be), a migration is not always a smooth experience, and given that this was a live site that was generating revenue for us, we were a bit hesitant about the move. Yet we were moving to a better, faster host, so we had to bite the bullet and get this done.

Fortunately, the host (WPEngine) actually offered a built-in service that helped us do the migration - this was essentially using the plugin BlogVault - essentially this is a backup and security plugin, which can duplicate as a migration plugin.

Our experience was the smoothest experience ever when it comes to performing a migration. We've also fully reviewed the service here, and we gave it an excellent rating, given the broad set of backup, migration, restore and security functions it provides.

A small pre-requisite of this plugin is that you have a clean installation of WordPress on your destination server.

1. Perform a backup on the source site

We simply installed the plugin on the source site, performed a full backup of the site and then clicked on the Migrate option as per below.

Backup module Migrate

2. Enter the FTP details of the destination

Once we had a backup ready for migration, you have to fill up the FTP details of the destination (i.e. where your new website will be migrated to - the new host in other words).

The details you’ll be required to fill in about the new host, are the below. You can get all of these details from your new hosting account.

  • The destination’s FTP Hostname or Server name
  • The type of the destination’s FTP hosting service (FTP, SFTP, or FTPS)
  • FTP username / password of the new hosting service

These details above are then used by BlogVault to get access the new domain, and be able to move your backup’s content automatically to your new location.

Migrate ftp details

3. Migrate the site (full or partial)

The third and final step of the transfer to the new site is the actual migration. You'll first need to select where you want to migrate the new site too, simply select the folder where you have setup the site (on the destination) and click on Continue.

The final step before migration is choosing what you want to actually transfer:

  • The whole site
  • The files only
  • The database only

Most people will (and should) migrate the whole site, but if you have specific use-cases where you only need to migrate the database or just the files, as you can see this is also possible.

Migration details confirmation and selection of transfer options

Once you have confirmed that everything looks right, click on the Continue and the transfer will start. You'll see that from this point onwards, there is no other intervention required - once the plugin gives you a "Migration completed successfully" message, you can visit your new site and confirm that everything was moved correctly.

You'll notice that there is absolutely no downtime, neither of the sites needs to be put in maintenance mode, or any tweaking for files or databases needs to be done manually. This is because any required changes are down as the files are being transferred through BlogVault's servers.   

Need help getting your website migrated? Try these top-rated affordable gigs on Fiverr!

fiverr logo

 

Click here to find experts on WordPress speed optimization.

Click here to create a full WordPress website.

UpDraft Plus Migrator

updraftplus

Another great option to migrate a site with a plugin is using UpdraftPlus's Migrator plugin. With 2+ Million active installations and 4.8/5 star rating, this is a plugin you can use without any concerns.

The Migrator plugin from UpdraftPlus allows you to clone or migrate a website to a different URL in minutes from the UpdraftPlus dashboard.

As the price of just $30 for a one-off migration, with 60 days of support this price is a steal and we couldn't recommend it more. 

Use the Migrator plugin Now

So how do you perform a migration using Updraft Plus?

1. Create a new WordPress install on the destination URL

This can be done either manually by uploading a WordPress installation to the hosting and running through the set up process, or using an automatic software that installs software such as Softaculous or otherwise.

2. Install Updraft Migrator to the destination WordPress

Install and activate the Updraft Backup plugin from here. You'll need to install this and activate it using the normal procedure of installing a WordPress plugin, either by downloading the plugin and installing it manually or by searching for the plugin from the plugin directory.

You'll also need to install the Migrator plugin on the destination site which you can get from here.

3. Install the Migrator plugin on the source website

Now that we have the destination ready for the migration, we need to prepare the backup from the source WordPress site. 

Once again this is a pretty regular procedure. You'll need to install the Updraft Migrator plugin to the source installation and then click on the Clone / Migrate button. You will be presented with a list of easy instructions to follow.

During this process, you will take a backup of the current (source) site and then connect it to the destination site. The transfer of the files can either by done automatically by the Migrator plugin, or you can move the files manually yourself by downloading them locally and then uploading them to the destination file.

The migration process then starts with the database, and then performs a search and replace to make sure any old URLs have been migrated correctly.

migration database

Once the restore completes, you can login to the destination WordPress admin with the credentials of the old site.

If on the other hand, you know how to tinker around with databases and are happy to perform a manual migration or transfer of WordPress, the instructions follow guide you through the whole procedure.

Manually Migrate WordPress Site

If you just need to move WordPress website to a newly created hosting account while keeping the same domain name, then the process is fairly simple.

You will first need to export the WordPress database content from the old server and import it to the one where you are moving, and then migrate/copy the files with a file manager or FTP.

This is a fairly simple process which we will show in detail below :

1. Export the Database from the old host

First, we need to migrate the database.

The easiest way to do this is through your cPanel account or another hosting account, specifically by using phpMyAdmin - the DB management tool. 

phpmyadmin

Once you are in phpMyAdmin, select the name of the database that contains the website you want to migrate. Be careful if you have more than one website on the same hosting account, and make sure that you are selecting the correct database to export.

If you are not sure, you can find out the name of the database of a particular installation by opening the wp-config.php file - details can be found below:

define('DB_NAME', 'wordpress_wp1_db'); 
define('DB_USER', 'wordpress_wp1_user'); 
define('DB_PASSWORD', '********'); 
define('DB_HOST', 'localhost');

The first line contains the name of the database. Open this database in phpMyAdmin and then click on the Export button.

The options to select are as follows:

  • Export Method: Custom
  • Table(s): Select All
  • Output: Save output to a file
  • Output Compression: gzipped

phpmyadmin export of database to prepare for WordPress transfer to new host

Click the Go button at the bottom of the page to start the export and download the file which is generated.

Save this file to a safe place, we are going to need it soon to import to the new database server.

2. Import the database to the new host

The next step in transferring the website to a new host is replicating the WordPress database content to the new server account where you will now be hosting the site.

We need to take the file we just exported and import it into our new hosting's database server. 

Start by logging into the cPanel account and creating a fresh database using the MySQL Wizard tool or whatever you prefer. Remember to take note of the database name (e.g. wordpress_db_new), username and password for your fresh WordPress website.

You will soon need them to connect the migrated database to the newly migrated installation.

On the destination hosting server, go to phpMyAdmin again. Select the database you have just created from the left sidebar again (above we named it wordpress_db_new), and then click on the Import tab at the top.

Browse to find the export file we have just exported and downloaded in the previous step (during the export), and click the Go button. Wait until you get a confirmation that your file has been successfully imported by seeing a message similar to the below.

phpmyadmin import success

3. Compress and Move WordPress Files with to the new hosting

Now that the database has been successfully transferred from the old website to the new hosting, we also need to move the WordPress install files.

Note that using this scenario, you do NOT need to perform a fresh WordPress install. This will be carried over from the old server.

 

There are many ways of moving files from one server to another including File Manager from the hosting account, FTP, SSH, and so on. Let's start by compressing all the files from the old installation.

Simply visit the root directory of the old installation, select all the files and click Compress. This will create a zip file with all of the files of the current installation.

select all files and compress

You can now either download the whole file directory from CPanel, or use an FTP program to download it. FTP will be more reliable if your file is large.

For the sake of keeping things simple, we’ll use FTP, since it’s a fairly standard way of uploading and download files between a computer and the server. 

The way to do this is to create a folder on your local computer, then login to your old web server via FTP using an FTP client such as Filezilla Client (for Windows or Mac). Browse to the folder where you created the file and download it to your local machine. 

Once you have a copy of the files on your local machine, you can then move/upload it with the FTP program, by connecting to the new hosting account and uploading it.

Alternatively, if the file is small, you can use the File Manager and upload the file manually.

Once the transfer is done, you are now ready to set up the new installation.

You need to find the file via File Manager and extract or uncompress to the directory where you will be hosting the new site.

Once this process is done, you should have a full copy of all of the files from the old installation. 

You now just need to update the database credentials using the details of the new hosting account.

4. Update WordPress Database Credentials

Once the files have been uploaded (and decompressed if you have compressed them), there is one last step to perform to complete the moving of WordPress to a new host.

We need to change the database credentials from the ones which were valid for the old site, to the newly created database which we have imported the database content into.

Open the file wp-config.php with a text editor (you can do this from File Manager itself) and change the following 3 values: DB_NAME, DB_USER, and DB_PASSWORD

Change these settings to the values of the database which you created in Step 2. Save the file, refresh the site and verify that it the fresh website is working ok!

Change database-credentials to that of new WordPress database you have transfered your site to

Note: If you have not yet changed the DNS settings on your domain to point to the migrated server, you will want to do that right now.

Migrate a WordPress site to a New Host with a Different Domain Name

The process of moving to a different domain name is a bit more complicated because the WordPress database name has many instances where the domain name is stored.  Without changing all those records, the migrated website would not work well.

1. Manual Migration

First, perform a full manual migration as per the above instructions. But don't try to refresh the site when you are ready, because the database will still reference the old domain.

After we do the import of the database on the newly setup server, we will also need to do perform a Find and Replace on the URL of the old domain. This is because, during the move to the fresh hosting, the domain name remains intact in the database content.

2. Run a Find and Replace on the Database

We will use a script that is built specifically for this purpose -  the Database Search and Replace Script in PHP. Download this script so that we can run it on our website. Upload the script to the same location on the newly created hosting server where you uploaded the fresh site.

To run this script, visit the location of it by typing in the browser, <www.newdomain.com>/Search-Replace-DB-master/. The script will present you with a page that allows you to specify the fresh database credentials.

php find replace

If it is able to find your wp-config.php file, it will auto-populate the database name, username, and password fields. If not, you will need to manually enter the details. You should also type your old domain name in the replace field and put the fresh domain in the search/replace field.

Before running the actual process, click on the dry run button. This will perform a test run. If everything is ok and there aren’t any errors, then you can proceed with the live run. This will now actually change the domain which will result in permanent changes to your database - it is advisable that you keep the old website export just in case.

Once it has completed successfully, you are ready to try to access your freshly-migrated website to make sure everything is working fine. If everything went well, you should now be able to use your migrated website on your fresh domain and your new hosting server!

Update DNS to point to the new server 

Once you have confirmed with your testing that your new site is working correctly on its temporary URL, you can now perform the actual move of the live site to the new destination - because, in all likelihood, your domain currently still points to the old server.

This is done by updating the DNS settings to point to your new site address - note that you'll need to have access to the registrar where you have bought the domain.

Before you perform the updates, you will need to obtain the nameserver information from your new host. If you're not familiar with this, open a support call with your provider. As an example of nameservers, see below:

ns1.myawesomehost.com

ns2.myawesomehost.com

To update the DNS settings, look for the domain management area of your registrar, and you should find a section named Nameservers or something along those lines. See below examples, available on GoDaddy domain management.

Manage dns

Once you click on the Manage DNS you'll get to a section where you can update the nameservers for the new host. Click on the Change button and you'll get to the below screen - this is what it looks like on GoDaddy for our own domain:

Change nameservers new host

Enter the NEW nameservers of the new host i.e. the destination host of your transferred site and Save.

You will now need to wait from 2 up to 48 hours for these settings to propagate throughout all of the nameservers across the world (so don't switch of your old website for now).

To confirm whether the DNS has updated, you can check using this service here - which tells you exactly which locations around the world have updated to the new settings or not.

Since both the source and destination website are still up - you'll have no downtime whatsoever.

We would advise that you don't perform a lot of changes until you can confirm that you are completely on the new site, and especially any settings which need to be seen by ALL users. We would recommend that you keep your account for at least a week after you have migrated your site to the server (just in case something goes wrong and you have to revert).

Ideally, you should perform the migration or transfer during a low traffic time of your website (for example on the weekend). 

Frequently Asked Questions

How do I manually move a WordPress site?

To manually move a WordPress site is fairly simple. You need to export the site database from the old site and import it on the new hosting server using phpMyAdmin in a new database. You then need to compress, download and move all the WordPress install files from the old server to the new server. Uncompress the files on the new hosting server and update the wp-config.php to the database details of the new hosting server. If you are changing the URL, you also need to perform a Search and Replace in database operation using the script linked above. Detailed instructions can be found in this article.

How do I export my WordPress site?

To export the WordPress site you will need to export the database and then download all the WordPress files. To export the database, visit phpMyAdmin, find the database that hosts your current WordPress installation and click Export. This will create a full export of the database and prompt you to download this file. To export the files, you simply need to visit the File Manage on the hosting account, click Select All in the WordPress directory, Compress and then download the resulting archive file.

How do I move WordPress content from one site to another?

Moving content from a WordPress site to another is a different process than a migration. You can use the Tools > Export native WordPress tool to export existing content to a file, which you can then import to a new site, using Tools > Import from the WordPress backend.

Conclusion - how do you transfer WordPress sites to a new hosting?

There are many ways to transfer a WordPress site to a new host or server. Although there are many ways of doing it, there are few well-documented articles about moving WordPress and inexperienced developers or web designers often have problems with migrations. 

If you have another way to transfer a WordPress website to a new hosting server, we'd love to hear about it in the comments! 

Download the list of 101 WordPress tricks every blogger should know

101 WordPress tricks

Click here to Download Now
About the Author
David Attard
David has been working in or around the online and digital industry for the last 21 years. He has vast experience in the software and web design industries using WordPress, Joomla and niches surrounding them. He has worked with software development agencies, international software companies, local marketing agencies and now is Head of Marketing Operations at Aphex Media - an SEO agency. As a digital consultant, his focus is on helping businesses get a competitive advantage using a combination of their website and digital platforms available today. His blend of technology expertise combined with a strong business acumen brings a competitive edge to his writings.

One more thing... Did you know that people who share useful stuff like this post look AWESOME too? ;-)
Please leave a useful comment with your thoughts, then share this on your Facebook group(s) who would find this useful and let's reap the benefits together. Thank you for sharing and being nice!

Disclosure: This page may contain links to external sites for products which we love and wholeheartedly recommend. If you buy products we suggest, we may earn a referral fee. Such fees do not influence our recommendations and we do not accept payments for positive reviews.

Author(s) Featured On:  Inc Magazine Logo   Sitepoint logo   CSS Tricks logo    webdesignerdepot logo   WPMU DEV logo   and many more ...