Migrating a WordPress site from one hosting provider to another can be stressful! Use this step-by-step guide to make it seamless.
Thinking of changing hosts but not sure how to migrate a WordPress site from one host to another?
They say that moving house, getting married, and changing jobs are the three most stressful things in life… but I would argue that there’s another strong contender for the top three.
Migrating your WordPress website from one host to another!
Well, I have some good news and some bad news.
The bad news first… migrating a website to a new host will always make your heart race and your palms sweat, no matter how many times you’ve done it.
Good news: Migrating a WordPress site to a new host is essentially a series of steps that you can repeat each and every time.
It’s practically the same for every website you migrate.
This step-by-step guide to seamlessly migrate your WordPress website will make the entire process a little less stressful.
3 Options For Migrating Your WordPress Site To A New Host
There are three main options for migrating a WordPress website from one hosting provider to a new hosting provider.
- Get your host to do it for you.
- Use a WordPress migration plugin.
- Go old school and use SFTP/FTP.
The best option for you will depend on your current hosting provider and new hosting provider and the size of the WordPress site you want to migrate.
1. Get Your Host To Do WordPress Site Migration For You
The first option for migrating a WordPress site is by far the easiest (and least stressful!) but whether this is an option will depend on which hosting provider you are migrating to.
Many managed WordPress hosting providers, such as Flywheel or SiteGround, will either do a free migration or will provide a plugin to install on your site to perform the migration (more on that in a moment).
Flywheel offers either a DIY plugin for you to complete the migration or they will do the migration for free.
All you have to do is fill out a brief form on their website with the current hosting details and ask them to conduct the migration.
This can take one – to three days but will save you so much time (and stress).
2. Move To A New Host Using A WordPress Migration Plugin
As I mentioned above, if your fully managed host will not do the migration for you, they will usually provide a plugin that you can install on your site to perform the migration.
Using this migration plugin is easy.
These plugins typically work as an installation wizard to guide you seamlessly through the process of moving the WordPress files and database from one location to another.
They also automatically install WordPress on the new site in preparation for the files and database to be uploaded.
If you are not using a fully managed host, there is another plugin option.
Enter the All-In-One WP Migration plugin.
To migrate a WordPress site using this plugin, follow these steps:
Step 1: Log in to the backend of the WordPress site that you want to migrate.
Step 2: From the WordPress dashboard, navigate to plugins and click on Install New.
Step 3: Search for All-In-One WP Migration and install the All-In-One WP Migration plugin by ServMask.
Step 4: Activate the plugin.
Step 5: Repeat steps one to four on the new WordPress site (the one you want to migrate to) so you have the plugin installed on both the new and old site.
Step 6: Install the plugin Regenerate Thumbnails by Alex Mills (Viper007Bond) to the site you’re wanting to migrate to.
Step 7: Update ALL plugins, themes & WordPress core files on BOTH the new site and the old site (Note: the WordPress version must be the same on both sites).
Step 8: Create an export file using the “All-in-One WP Migration” plugin
Step 9: Optional: Add a rule to “Find” your new site database prefix and “Replace” with your old site database prefix (only if necessary)
Step 10: Export to File and download the file to your computer.
Step 11: On the new site, open the ‘‘All-in-One Migration’ plugin and import the file from the previous step.
Step 12: Once the file uploads, apply the uploaded export file to the new site when prompted.
Step 13: Go to Setting > Permalinks and save multiple times.
Step 14: Check all your plugins and make sure they’re activated.
Step 15: Check the media library. If the images aren’t there, use the Regenerate Thumbnails plugin to re-activate them if necessary.
Step 16: Check all pages/posts/etc. to make sure everything looks as it should. Then you can refresh your newly migrated WordPress site to see how everything looks.
Step 17: Install the Better Search Replace plugin by Delicious Brains on the new site.
Step 18: In the WordPress dashboard, go to Tools > Better Search Replace.
Step 19: Add your old site URL (i.e. oldwebsite.com) to the “Search for” field.
Step 20: Add your new site URL (i.e. newwebsite.com) to the “Replace with” field.
Step 21: Run a dry run. If you’re happy with the dry run, run the plugin for real.
Step 22: Go through theme files (primarily style.css, but maybe PHP files) to make sure all instances of “oldwebsite.com” are replaced with “newwebsite.com.”
Step 23: Check your new site. If the changes haven’t taken effect, clear your browser cache. If the changes still haven’t taken effect, clear your server cache.
The All-In-One WP Migration plugin has a limit on the size of the site that it can migrate (128MB).
If you have a very large site, these alternative plugins may help you migrate your WordPress site from one host to another:
Be sure to read all of the instructions for the plugin that you choose, to make sure that it is appropriate for the type of migration you want to do.
3. Old School WordPress Site Migration With SFTP/FTP
For many migrations, using a plugin should work fine.
However, for more complex migrations, you may need to manually migrate your WordPress site.
This can be done using either the File Manager in the cPanel of your hosting provider or by using an FTP or SFTP connection.
To use an SFTP/FTP client such as Filezilla or Cyberduck, you should consult with your hosting provider(s) for the correct configuration of this connection, but you typically need the username and password for your hosting account, the FTP or SFTP address, and the correct port number.
Once you have this information, follow these steps:
Step 1: Using File Manager in the cPanel or the SFTP/FTP connect, navigate to the root folder (public_html is the usual location) of the site you are migrating to. If you aren’t sure where the root folder is, you may want to contact your hosting provider, as it may be in a folder by a different name for security reasons.
Step 2: If you’re using the File Manager located in the cPanel, select public_html and download it to your computer.
If you’re using the SFTP/FTP client, select the public_html folder and download it to your computer. To make it easier to migrate, you can create a zip file of the downloaded folder.
Step 3: You now need to download your WordPress databases. Log into phpMyAdmin on the hosting where the site is currently located.
Step 4: Export the database. (Note: You may need to reach out to your hosting provider to find out which database to use if you see more than one listed in phpMyAdmin).
Step 5: Select the database to export. Click Export and then Quick for the type of export, and SQL as the file type. Click Go.
Step 6: If you are going to use phpMyAdmin to import the site, you can create a zip file once the database is downloaded to your computer. Alternatively, you can select compressed in phpMyAdmin to compress the database before it downloads.
Step 7: Make sure there is nothing installed on the site you are migrating to.
Step 8: Go to the new hosting provider and create a new empty database. In the cPanel, navigate to MySQL Databases and click on it, name the new database appropriately and click Create Database.
Step 9: Create a new user in the MySQL Users section. Create a username and password and select Create User. Note that all usernames and passwords you use to create the database and user. You will need to update those in the wp-config.php file.
Step 10: Add the user to the database by going to the Add User to Database, selecting the new user and the database, and clicking Add.
Step 11: You next need to edit the wp-config.php file from the WordPress files that you downloaded. Make sure, if you created a new database name “DB_NAME”, username “DB_USER, and/or password “DB_PASSWORD“, you will want to update them here and save the file.
It is wise to first create a copy of the original wp-config.php and store it elsewhere on your computer.
This is a precaution in case something happens and you need the database information from the current site location.
Step 12: Log into the new site’s phpMyAdmin. Select the new empty database you just created. Import the SQL database that was exported from the current location, by selecting the new database in the left window, hit the Import tab, choose the file to import, and click Go.
Choose the database zip file you have exported and make sure it is ready to import as an SQL file and hit Start Import.
Step 13: Next, you will want to upload the WordPress files to the new installation. Log into the File Manager of the cPanel of the new site installation or connect to SFTP/FTP for the new site location. Upload the public_html folder to the new location.
Step 14: If you are migrating from a staging site, subdomain, or different domain name, install a plugin such as Better Search Replace on the migrated site in order to switch all of the old site URLs to the new domain name URLs.
Pointing Your Domain Name To The New Website
Once you have migrated your WordPress site to a new host, you will need to connect the new site to your domain name.
Update the new IP address in the DNS records or if you prefer to maintain the DNS records on your web hosting, you can update the nameserver on your domain hosting account.
Step 1: Log in to your domain hosting account. (I’m using Namecheap for this demonstration.)
Step 2: Select the domain you will use for the new site.
Step 3: Click Manage Domain and Advanced DNS.
Step 4: In the A Record, use @ for Host, and add the new IP address provided by the new web hosting provider under Value. TTL should be automatic.
Step 5: In the CNAME record, use www for Host, put your new domain name under Value, and Automatic for TTL.
Step 6: Save Changes.
Follow the instructions from your specific domain hosting provider to make sure that all DNS records are present and updated to point to your new website location.
Allow 24 to 72 hours for complete internet propagation.
The Stress-Free Way To Migrate A WordPress Site
Migrating a WordPress website doesn’t have to be stressful.
If your host can’t do it for you, there are plugins that make the migration process stress-free.
In some rare instances, you might have to use SFTP/FTP to migrate a more complex site.
That being said, the steps are always similar when it comes to WordPress migration.
Allow plenty of time for the migration process.
With enough practice, you’ll be a pro at moving WordPress sites from one host to another!
You can find original article by Julia Taylor here