Introduction
This guide explains how to move your WordPress site to a new web host. You might want to do this to save money on hosting, improve the performance of the site, or take advantage of the features available with another web host.
This is a fairly lengthy process, so this guide acts as an overview with the details explained in the linked How To guides.
These instructions assume that the services which control your domain registration or DNS are not changing. If these are changing, you should transfer control of them before following these instructions.
Requirements
- Admin access to the service which controls the DNS for your domain (e.g. your domain registrar).
- Admin access to the web host that you’re transferring to (e.g. cPanel admin access).
- A WordPress admin account.
- An FTP Client like Cyberduck or CoreFTP.
For reference, these instructions were followed using:
- cPanel version 88.0.11.
- Cyberduck version 7.4.1.
- WordPress version 5.4.2.
- Duplicator plugin version 1.3.34.
- Restricted Site Access plugin version 7.2.0.
Skill Level
Intermediate knowledge of:
- cPanel.
- FTP.
- WordPress.
- Domain management.
Instructions
Time needed: 6 hours.
- Reduce the TTL for the site’s domain.
Reduce the Time to Live (TTL) setting for the site’s domain to the minimum possible (e.g. 5 minutes). This is normally controlled by the service responsible for your Name Servers (e.g. your domain registrar).
- Prepare the new host for the site’s domain.
Prepare the new web host to handle the site’s existing domain.
If your web host uses cPanel, and the site will be using an Addon domain, see How to create an Addon Domain in cPanel. - Confirm the DNS settings for the new host.
Check the DNS settings which should be used for your site’s domain on the new host. This might be an IP Address for an A Record, or a URL for a www. CNAME. If this information isn’t available on the admin site for your new host, or in their support documentation, contact them directly to confirm. It’s also a good idea to make a note of the existing DNS settings that you’re changing, in case you need to revert them if you run into problems.
Some hosts might prefer you to use them as the Name Server (controlling the DNS) for the domain, which may require additional changes to be made (e.g. existing DNS settings to be copied). If this is the case, you should change the Name Server first (and point the DNS to your existing web host) before completing the rest of this process. - Purchase an SSL certificate on the new host.
If your site requires an SSL certificate, purchase a new one for the site’s domain on the new web host. Although it’s possible to transfer an SSL certificate between servers, or generate a new one with your existing certificate provider, it isn’t guaranteed to work and can easily go wrong.
It’s best to use the method of purchasing an SSL certificate recommended by your new web host. - Create a database on the new host.
Create a new MySQL database on the new host and save the access details securely.
If your new host uses cPanel, see How to create a MySQL database in cPanel. - Create an FTP account on the new host.
Create an FTP account on the new host and save the access details securely.
If your new host uses cPanel, see How to create an FTP account in cPanel. - Install the Restricted Site Access plugin on the site.
On your site install the Restricted Site Access plugin using the instructions in How to install a plugin in WordPress.
If you have another method of displaying maintenance pages, you could use that instead. The following instructions assume that you’re using Restricted Site Access, but you could just apply the equivalent changes (e.g. enabling and disabling the maintenance page) at the appropriate steps using your own method. - Install the Duplicator plugin on the site.
On your site install the Duplicator plugin using the instructions in How to install a plugin in WordPress.
If you have another method of backing up and restoring the site, you could use that instead. The following instructions assume that you’re using Duplicator, but you could just apply the equivalent changes (e.g. backing up and restoring the site) at the appropriate steps using your own method. - Complete a test run of the site backup and restore.
It’s highly recommended (though not essential) to test the site backup and restore before committing to the move. As well as ironing out any problems, it’ll also give you an idea of how long your site will be unavailable for during the move.
You could either test the process on a test environment (if you have one available), or as a dry run on the new web host.
If completing the test on the new web host, you’ll either need them to provide a temporary URL which can be used for the test site (they should be able to provide this), or you could set up a new domain or subdomain for testing purposes.
To test the backup and restore, see How to backup your WordPress site and How to restore your WordPress site from a backup, making sure to use the test or temporary URL during the restore process. - Schedule the site move.
Estimate the time required for the remaining steps required to move the site (see below).
Schedule the site move during a period of low activity. For example, this should be outside peak sales hours on your site, on the quietest day of the week, and when no promotions or sales are being run. You should also check the normal hours that technical support is available from your new and existing web hosts.
It’s normally a good idea to start the move early in the day and avoid Fridays and weekends. This means that technical support should be available to help you, and you’ll have time to fix any problems which come up. - Inform key customers and partners about the site maintenance.
You might want to inform key customers (who use your site frequently) that the site will be unavailable during the move of web host.
You might also want to contact partners who integrate with your site (e.g. online payment services like PayPal) to make sure the move will not affect their integration. For example, some payment services might block transactions if an existing merchant account is being used on a new web host, or there are lots of test transactions being made in a short period of time.
If any of your partners use your site’s existing IP address (e.g. for whitelists or direct connections) instead of the URL / domain, confirm what updates will be required when the site’s IP changes and factor that into the rest of the process.
You should also let your new and existing web hosts know about the change so they’re ready to support you if you run into problems. - Check for broken links on the site.
Check for broken links on the site using a service like Dr. Link Check. Comparing the results after the move is one of the easiest ways to check that the site is still working.
- Enable the maintenance page on the site.
To avoid any changes being made to the site (e.g. customers completing orders), enable the maintenance page on the site. For more info, see the first steps in How to enable and disable a maintenance page on your WordPress site.
You should also avoid making any changes to the site after this point. - Backup the site.
Backup the site files and database. For more info, see How to backup your WordPress site.
- Upload the backup to the new host.
To complete the process as quickly as possible, start the upload of the backup files to your new host.
You can do this by following the first 3 steps on How to restore your WordPress site from a backup to upload the files. Do not complete the steps after this (e.g. going to the installer page) until after the DNS update has propagated. - Update the DNS to use the new host.
Update the DNS settings (confirmed previously) for your site’s domain to use the new host.
After the DNS settings have propagated (hopefully within the time set by the TTL), the new web host will be used for the domain, whether or not your site has been moved successfully. This might lead to an error or 404 page being shown until the site has been moved.
If you run into business critical problems later in the process (e.g. the site doesn’t work at all, or you’re unable to complete an order), and can’t quickly fix them, you can revert this change and disable the maintenance page. Doing this will mean the existing host will continue to be used, and customers can continue to use your site while you investigate the problem. - Check the DNS update has been propagated.
Check that the new DNS settings have been propagated by using a service like DNS Checker.
- Complete the site restore on the new host.
As soon as the backup files have been uploaded, and the DNS has propagated, complete the rest of the installation process. You can do this by completing the rest of the steps on How to restore your WordPress site from a backup.
- Clear any caches.
If your site uses a CDN with cached content (like Cloudflare), clear the entire cache for the site to ensure all content is being served from the new host.
Also make sure to completely clear your browser cache (or use a different browser) before completing any tests. - Check the functionality of the site on the new host.
Check all the business critical features on the site (e.g. completing an order and viewing it in the Admin site).
- Disable the maintenance page.
See the last steps in How to enable and disable a maintenance page on your WordPress site.
- Check for broken links.
Run another broken link check using a service like Dr. Link Check and compare it to the results before the move. If there are differences, investigate and fix them as quickly as possible.
The image used in the Introduction is based on illustrations by Lukasz Adam, provided under an MIT License.