The thought of migrating your entire website to a new host may send shivers down your spine. The logistics, the data, the timeframe - how are you possibly going to pull it all off disaster-free?

Well, you’ll be pleased to know that despite the looming dread of such a task, there’s actually very little to worry about. By following a few simple, straightforward steps, your site migration can be a smooth and painless affair.

Why migrate a WordPress site?

Migrating to a new hosting provider can improve the performance of your WordPress site, especially if what they’re offering is better than your current plan. Plus, if you’ve outgrown your old hosting plan or you don’t get the features you need, migrating your WordPress site may be the best option.

This may sound like more trouble than it’s worth, but it could potentially be a fantastic opportunity for your business. If you’ve noticed slow page loading times, too much downtime, a lack of desirable features or too little tech support with your current web host, this could all be holding your site back from its full potential. On the other hand, the right hosting provider for you could help you reach new heights of success.

Alternatively, you may have simply outgrown your current web hosting plan. A more powerful dedicated hosting plan from another provider could give you the performance you need, or you may benefit from WordPress web hosting that’s specifically designed and optimised for your WordPress website.

Our WordPress migration service

As part of our WordPress Hosting, we actually offer a free migration service for customers that already have a website. So if you're looking to move your WordPress site to a new host, why not let us do all the heavy lifting?

Migrate a WordPress site in ten simple steps

Migrating a WordPress site over to a new host doesn’t need to be complicated. Especially if you follow our ten steps for a painless website migration.

Step 1: Ensure PHP version compatibility with host

Before you go storming ahead, there are a couple of compatibility points that you need to read up on and factor into your choice of host. The first of which is your PHP version, because if your scripting language is incompatible or outdated, then you’re likely to Have issues with parts of your website, or in worse cases the entire website will fail to load.

Step 2: Ensure MySQL/MariaDB version compatibility

The next thing to check is your MySQL/MariaDB database version. Your database contains most of your site’s content, from blog posts to plugin information. It’s vital that you know which version you are currently using, and that it’s compatible with your potential choice of host to avoid major issues when attempting to migrate your site.

Step 3: Choose a new host

Once you know your necessary requirements, it’s time to choose your host. So what do you need to look for?

Everyone is different, so you need to work out which features are a priority for you. An easy place to start is to assess why you decided to leave your previous host. What were you lacking before, and what are you hoping to gain? Once you’ve worked this out, you can identify which kind of hosting solution would fit you best, from shared hosting, dedicated hosting and cloud hosting to a managed hosting solution.

Step 4: Back up your site using FTP

To move your website you’ll need to make a copy of your site files, it’s also very important to have a backup copy of your website just in case something doesn’t go to plan along the way. How do you do this?

  1. Connect to your site server via FTP
  2. Navigate to the folder on your server that contains your website files
  3. Download your backup files
  4. Stash it somewhere safe and secure

You can also back up your files using a WordPress plugin like Duplicator. This migration and backup plugin can be installed from the WordPress dashboard and used to build a backup file for your entire site. Store this file safely during migration in case something goes wrong and you need to restore your data. 

One more thing to note is that you’ll speed up the migration process if you have less content. Therefore, before getting started, we would recommend combing through your site and identifying unused plugins, themes, images and other files. Clean up everything you don’t need to make it easier to back up your website.

Step 5: Back up and export your WP database

Once you’ve made a copy of the actual site content, you need to do the same for your WordPress database. As this contains all the information about your users, content, and more, you wouldn’t really want to lose this, would you? There are a couple of ways to do this:

If your host is using cPanel

cPanel is the control panel of choice for many sites, and it provides a safe and secure way of creating a backup copy of your WordPress database. By using the ‘Download a MySQL Database Backup’ function within the control panel, A *.gz file will be downloaded to your device containing a full backup.

Using phpMyAdmin

phpMyAdmin is a free administration tool that can be used to backup your WordPress database. It offers several different methods within the software, all with different output formats. Most hosting providers will offer the ability to use this tool.

A full breakdown of the backup process using phpMyAdmin can be found at the source of all WordPress knowledge - the WordPress website itself.

Step 6: Create a new SQL database and import old contents

You’ve got all of your old data, but where are you going to put it? It’s time to create a new SQL database within your new host where you can import your backups, and get your site up and running again.

If you want to learn more about this process, check out How to access a MySQL database using PHPMyAdmin over on our support site.

Step 7: Upload your FTP files to your new hosting provider

For this next step, you'll need to log into your new server via File Transfer Protocol (FTP). Then, you need to navigate to its root folder. Once you're there, right-click, and select Upload. Find all the files and directories within your backed up database, and start the process. This can take quite a while, particularly for larger sites.

Using FTP can be intimidating for a beginner. That's why we created a handy guide on How to use FTP over on our support site.

Step 8: Edit your wp-config.php file

Next on your list is editing your wp-config.php file. Your wp-config.php is extremely important and contains some crucial information that you need to understand and change accordingly if you want your site to actually work at all post-migration.

Find the wp-config.php file within your new root folder. Once you right-click on it, you can then select the View/Edit option which will open the file with your local text editor. You will need to make the following changes to the four lines of text you see:

define('DB_NAME, 'db_name');

define('DB_USER, 'db_user');

define('DB_PASSWORD, 'db_pass');

define(‘DB_HOST’,’localhost’);

Firstly, replace the lower case variables with the credentials of your new database. Then, when you save the changes and close the file, you will be able to access your new site, good as new.

Step 9: Test site using local host file

Entering a domain name into your web browser will cause your device to ask a remote DNS server where the domain is located. Once the DNS server gives your device an IP address, it will be able to locate your domain name’s content - in other words, your site can now be accessed.

If you want to test if your domain is working before making DNS changes, your host file can be used to tell your device to hook up to an IP address of your choosing. By bypassing the DNS server, you can view your website in testing, development and migration periods without changing DNS.

If you want to learn more about using host files, be sure to read How to use a host file to test your website over on our support site.

Step 10: Configure and change DNS

The last step to getting your newly migrated site up and running is to make sure that your DNS is able to connect with your new host. DNS tells your registrar where to point your URL, so if you're moving server, then you will need to change your DNS. If you’re moving everything including your domain registration, then you will need to update your nameservers, which you will be able to get from your new host. However, if it’s only web traffic that you’re pointing, then you may need to change DNS A records so that your email remains untouched.

Step 11: Check your website

As long as you carefully follow each step in this guide, you should be able to migrate your WordPress site to a new hosting provider without any issues. However, it’s still very important to check all of your web pages after the migration to ensure that there are no missing elements or errors.

If you do find any missing files or content, you should still have your website backups to retrieve the relevant files and get your site up to scratch. The quicker you can get your migrated site up and running, the better this will be for user experience and SEO.

Migrating to a different domain name

If you are migrating to a different domain name, a lot of the steps you need to take are quite similar, including backing up your website files, creating a new MySQL database, and uploading your files to the new database. Then, you need to change your site and home URL entries. This can be done within your WordPress database, or you can head to the WordPress Dashboard, where you can select ‘Settings’ and ‘General’. This will allow you to edit both fields.

Whether you’re rebranding or just switching to a more valuable and authoritative domain, migrating your WordPress site to a new domain can be a great move for your business. However, the migration can have a negative impact on your site’s search rankings and traffic in the short term, so it’s important to do it right to minimise the damage and hit the ground running.

Redirecting your old WordPress site to your new site

After all of the above is complete, you will need to send all visitors to your new domain. You can and should inform your customers that your domain has changed, but many people will still try to visit your old URL, leading to reduced site traffic and search engine rankings. So how can you minimise this negative impact on your website’s SEO and get back to normal as soon as possible?

The solution is to set up permanent 301 redirects on your old domain so that all visitors are automatically redirected to your new domain. Each web page should redirect to its updated version on the new site so that no potential visitors slip through the cracks. You can either set up these 301 redirects with the help of a WordPress plugin (such as All in One SEO, Redirection or Simple 301 Redirects), or you can do it manually with a bit of coding.

To do it yourself, you need to edit the .htaccess web server configuration file. First, back up this file before making any changes, and then connect to your website using an FTP client. You’ll find the .htaccess file in your WordPress site’s root directory. You can then download the file to your computer and edit it with a text editor like Notepad. Paste the following redirect code at the end of the file after the ‘# END WordPress’ line, making sure you change the URLs to the correct ones:

RewriteEngine On

Redirect 301 /old-post/ http://yoursite.com/new-post/

If you don’t set up these redirects, visitors to your old site will be faced with 404 errors. Not only is this bad for user experience, but it can also harm your WordPress SEO. Plus, if there are lots of broken links on your site due to incorrect or missing redirects, this can cause you to lose valuable backlinks and domain authority.

Cleaning up your site

Once you’ve implemented and tested your redirects, you can move onto the final touches. First, visit each web page to ensure that all content is present and all broken links are fixed. This is also when you should review all of your internal links and make sure they’re pointing to your new domain – you can speed up this process with a plugin like Better Search Replace.

Next, to minimise the negative impact on your site’s SEO, it’s vital that you inform Google of the migration so your site can be crawled and indexed as soon as possible. You can do this with the Change of Address tool in Google Search Console.

Now you've completed a WordPress site migration

Whilst there's a lot to consider, you should now know more about migrating your WordPress site to a new host or domain. If you take your time and follow these steps, the move should be swift and painless. If you're still unsure, contact our sales team, and they'll get you on the right track.

So whilst there’s a lot to consider, migrating your WordPress doesn’t need to be a headache. Follow these simple steps, and your move will be swift and painless. Why not take a look at our UK WordPress Hosting now?

Still unsure? Why not get in touch with our support team on 0333 014 2700.