There are several reasons why you may choose to migrate your WordPress website to a new domain. Perhaps you’re looking to revitalise your brand, or are changing hosting provider to scale up your website. Whatever the reason, there are certain steps you need to take to ensure the process goes smoothly, and your website doesn’t experience any downtime.
What is a WordPress domain migration?
A WordPress domain migration is the process of moving a WordPress website from one domain name to another. This involves transferring the databases, content, files and functionality of your WordPress website while maintaining its functionality.
WordPress domain migration: Step-by-step
Steps to take to migrate your WordPress website to a new domain include:
- Step 1: Back up your existing website
- Step 2: Set up the new domain
- Step 3: Transfer files to the new domain
- Step 4: Import the database
- Step 5: Update WordPress configuration
- Step 6: Test the new website
- Step 7: Set up redirects
- Step 8: Update external references
- Step 9: Go live
- Step 10: Update your website visitors/customers
Step 1: Back up your existing website
Begin by backing up your website, which you will use to upload it to your new domain. A backup is also important to reduce the risk of data loss when you complete the transfer.
Creating a backup will involve downloading all of your files onto a local drive, including a database that contains the entirety of your website content and data, and static files like your WordPress core and themes files.
There are three main ways to backup a WordPress website, manually with a file manager or File Transfer Protocol (FTP) client, using your web hosting’s backup feature, or through using a plugin, such as the Duplicator plugin.
Step 2: Set up the new domain
The next step is to set up the new domain. Purchase the new domain name if you haven’t already and set up the hosting. Then, create a new database for the WordPress installation on the new domain.
Step 3: Transfer files to the new domain
Then, it’s time to transfer your files to the new domain. You can do this either via an FTP or through using a migration plugin such as Duplicator. If done correctly, this will transfer your entire WordPress installation.
Step 4: Import the database
The next step is to import your database to the new domain’s database you created earlier (to phpMyAdmin). This will move all your settings, users and content.
Step 5: Update WordPress Configuration
If there are any error messages, you may need to update the WordPress configuration, for example if within the SQL dump there are references to the old database name or username, which need to be updated.
You can edit the wp-config.php file on the new domain to use the new database credentials. Any hardcoded URLs in the database should be updated to use the new domain name.
Step 6: Test the new website
Testing the new migrated website is important to make sure everything on the new domain is working correctly. Check links and images and fix any that are broken.
Step 7: Set up redirects
Redirects are important to maintain SEO value, as well as user experience. Implement 301 redirects from the old domain to the new domain. Adding these will automatically redirect users and search engines to your new domain, instead of seeing a 404 error.
There are two mains to set up redirects, either through using a plugin such as All in One SEO, or through manually setting up redirects to the new domain.
In order to keep the redirects in place, you will need to keep your old WordPress installation active so it can redirect to the new one.
All in One SEO is an excellent WordPress SEO plugin that will allow you to optimise your website with ease.
To set up redirects using All in One SEO:
- Install and activate the All in One SEO plugin on your old domain.
- Navigate to the All in One SEO > Redirects page and click on the ‘Activate Redirects’ button.
- Navigate to the ‘Full Site Redirect’ tab and switch on the ‘Relocate Site’ toggle.
- Enter the new domain name next to the ‘Relocate to domain’ option.
- Save changes.
To set up redirects manually:
- Connect to your old site using FTP and edit the .htaccess file (this will be located in the same directory as the wp-includes or wp-admin folder).
- Open the .htaccess file
- Paste the following lines of code at the top:
#Options +FollowSymLinks
RewriteEngine on
Unchanged: RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]
- Make sure to replace yourdomain.com with your new domain in the code!
- Once these changes have been made, visit your old domain name to check they have been implemented correctly. Your old domain name should automatically redirect you to the new domain.
If this doesn’t work, it may be because your server doesn’t support redirect rules, in which case you’ll need to contact the support team at your web hosting company to request that RewriteEngine is turned on.
Step 8: Update external references
Update any external references like Google Analytics to use the new domain. You can also notify Google of the domain change in Search Console.
To notify Google in Search Console, take the following steps:
- Log in to Google Search Console
- Add and verify the old and new domains within the same account
- Navigate to the old domain property in Search Console
- Navigate to Settings in the left navigation
- Select ‘Change of Address’ from the settings options
- Select the new domain name from the drop-down list of verified properties
- Click ‘Validate & Update’
- Google will perform validation checks, such as verifying 301 redirects for the top 5 URLs of your site
- Once validation checks pass, click ‘Confirm Move’
Step 9: Go live
It’s time to go live!
If you’ve changed hosts, make sure to update your domain’s DNS to point to the new host.
Monitor your site and analytics closely after going live, to identify any potential issues.
Step 10: Update your customers
This step isn’t necessary, but you may wish to take the opportunity to remind potential customers about your business. The last step is to update your website visitors or customers regarding your new domain, and new website if applicable. You can do this through contacting your newsletter mailing list, if you have one.
We hope that this article has provided you with a comprehensive overview of how to migrate your WordPress website to a new domain. We understand that this is a lot to take in, especially if migrating a website is an uncharted territory for your organisation.
Find out more about the SEO implications of a site migration in our guides, SEO Site Migration Strategy and Website Migration SEO Checklist, and discover How to improve SEO on your WordPress website.
If you’re planning on migrating your website, the team at Yellowball are on hand to provide expert advice. If you’ve reached a point where you need to migrate your website, using our professional SEO migration services not only saves you time, but helps you to protect your online authority and search engine rankings. Need a hand? Contact us today and let’s work together!
Our London digital web agency works with companies across all sectors, with a diverse range of skills we’re sure could be used to your benefit. Get in touch today.