As the world moves to digital platforms to carry out everyday activities, right from purchasing their groceries to the latest ‘gossip’ party between friends, the need for a business to own a website has increased exponentially. However, building a website can be a daunting task, especially if you don’t have any prior experience in that field. But, a user-friendly platform, known as WordPress has made website creation fairly simple. With its drag-and-drop functionality, even people with no background in the field can create a website. In fact, a survey from Global Internet states that more than 1.1 million new registered WordPress domains every 6 months.
That being said, while creating a website on WordPress can be easy, the more technical tasks like when you want to move a wordpress site to a new domain, needs some prior knowledge and precision.
If you’re wondering how to copy a WordPress site from one domain to another, don’t sweat! We’ve got you protected. Here’s how to transfer WordPress to a different server or host, step by step, without any downtime in between.
Steps to migrate your website from one domain to another
Step 1: Duplicate the site
The first thing you would require to do anytime you plan to switch WordPress to a different server is to make a backup of the site (which then can be taken to the new host and restored there).
There are a lot of approaches to get it done. There are also providers on the market that can take care of the operation for you, not to mention hundreds of different plugins that offer a seamless backup/recovery experience.
Today, we’re going to concentrate on one of the better options of all of them; Duplicator – a WordPress plugin. It’s been attracting a lot of positive coverage, and for a very good cause, on the media. A few reasons why this approach works best are:
- Can be used on all hosts
- It’s free of cost
- It works without any glitches or unnecessary steps
All right, so get your duplicator installed to get started. The method of installation is fairly straightforward and similar to how other plugins need to be downloaded, so no surprises.
With the plugin downloaded, go to Duplicator and press the “Create New” tab beside “Packages”:
You can check the backup conditions on the next screen if you would like to, but that’s not necessary. If you are in a rush, just press the next button.
The next segment is where Duplicator checks your new hosting system and assesses how compliant the setup is to make the backup hassle-free.
You may see a warning or access request in a few places depending on your host, but in most situations you don’t need to think about it. Duplicator also gives you some advice about how to clear all of these and start with the backup.
If you see any warnings, search for the ‘Yes’ field and press the ‘Build’ button. If there are no warnings, you should press the ‘Build’ button right away.
This is where the Duplicator is performing its magic. The backup method can take a little while depending on the type of your site. You ought to leave the window open before it’s over!
Activate the Installer File and the Backup Folder. You’ll need that when you’re moving to the next steps while migrating your wordpress site.
Step 2: Get your new host ready
Before you start launching your backed-up website on the new host, you need to get it organised by taking care of a few things:
- Link a domain name to your server
- Build a blank web database
The majority of web hosts use cPanel to encourage users to set up their own hosting environments without having to know what’s going on under the hood. If a certain control panel is used for your current host, you may want to contact support so that they can do these tasks for you.
When signing up, your host should also have provided you with login information for cPanel. Check in your mailbox for the text. Usually, most hosts will let you go straight from the main client region to cPanel. Once you’re in, here’s how to manually complete the steps mentioned above:
Link your domain name to your new server
If you have signed in to cPanel, go to the DOMAINS section and select Domains: addon.
Enter the domain name in an area called New Domain Name. They would immediately fill out the other two fields. Click the Add Domain tab.
You’ll notice your latest domain on the list after just a second. The server is ready at this point to host your domain name and site.
Create a new database
The following thing we need to do in order to transfer WordPress to a new server is to create a blank database. This would be the current home for your site’s data.
To link a new database to cPanel, scroll to the bottom to the DATABASES tab and select MySQL Database Wizard.
This is a useful step-by-step framework that will direct you through the method of establishing a new database.
- Phase 1 is about having a name for your database.
- Phase 2 is for building user accounts that would then be ready to use the new database. The new user profile is how WordPress authenticates the new database. Fill out the appropriate fields and remember to save your username and password carefully, you’re going to need those later on.
- Phase 3 is the last one, and this is where you will need to assign your current user profile to the new database. Simply pick All PRIVILEGES and press Next Step.
A new database has been added!
Step 3: Upload the website to the brand-new host
Now that your domain name and database are activated, you can now upload your whole site backup to the new server.
To execute this, scroll to the bottom to the FILES section in cPanel and press File Manager:
Move to the directory that was created with the current domain name – the one you’re switching to.
Once there, just upload the directory to your site – the one you’ve received from the Duplicator. Remember to import both the archive (zip) and the installer.php data. This is the directory in which everything comes to an end when you switch WordPress to a different server.
Step 4: Edit your local hosts file
At this stage, you are nearly ready to make the ultimate import of your website and migrate all its data and information. But, your domain has not been formally redirected to a different site – we have not yet done that to avoid downtime, and we’re just going to do so until the absolute last minute. This is all well and good, though that also means that the current server is practically inaccessible to the public (along with you) and cannot be reached directly.
To get around this, you need to customise your computer to go to the new server manually while searching for a domain on your website.
Here’s how to do this:
Go back to cPanel and see what the IP address of your new server is. Typically, this piece of knowledge is available in the sidebar.
Then, as you attempt to navigate from your web browser to your tab, you will be taken to the new server. However, it’s important to note that only you can visit your new server in this way. Other users are still seeing the old server, and from their point-of-view, there are no changes made to the website.
Step 5: Install site via online installer
Launch your browser and move to YOURDOMAIN.com/installer.php.
You will see the main interface of the installer once you do that. All you require to do is accept the terms and then click Next.
The next stage is where you need to enter the connection details of your new database – the blank one you created a few minutes ago.
The host value must be set to localhost for most hosts. Click on the Test Database after all fields have been filled in.
You should press Next to continue, and then check that the installer will be running the popup message.
Select Next again on the next page to check the title and URL of the site. It should be installed within a few seconds. It’s also recommended to search the “Auto delete installer files…” box.
To view the WordPress dashboard of the website on the new server, click Admin Login. Both your WordPress accounts are about the same as they were when you transferred the domain to a different server.
After signing in, you can see a confirmation that the installer files have been deleted. You actually no longer need the Duplicator plugin, so if you want, you can disable it.
When you switch to YOURDOMAIN.com, you will see your website on a new server in all its glory. Only remember that even though you can access it, your visitors cannot access the site. In the final stage, let’s change this!
Step 6: Redirect the domain name
At this point, your website has been completely transferred to the new server. The last step we need to take now is redirected the entire world (web) to the new server when they search for your site – instead of the old server.
This is normally accomplished by modifying the nameservers allocated to your domain name setup. To alter it, you’ll have to go back to where you first signed the domain.
When you change the name server configuration, you will need to include the DNS addresses of your current name servers – those registered to your new host. You will find the nameserver addresses in the user panel of your current host.
For instance, at SiteGround, you might notice those when you go to My Accounts, by clicking the Details & Settings tab of the DNS account.
If you are running the Bluehost domain, they generally use the same DNS addresses for both domains. These addresses can be found here.
In case you have any issues figuring out what the right DNS addresses are, you could always approach the assistance on your new host. They’ll help you identify or fix any problems.
When you configure your domain’s DNS settings to point to a different host, you’ll have to wait a while until they expand across the entire network. This method typically takes about 48 hours.
Kudos, your website has been effectively transferred and now you’ve discovered how to switch WordPress to a new server!
What’s next after you move WordPress to a new server?
While the overload of information may seem daunting right now, if you do it step-by-step, it’s easily achievable. This is because WordPress ensures almost every task can be carried out with ease. This may be the leading cause as to why WordPress enjoys 61.8% of the total market share, as per the data compiled by W3techs.
However, while you’ve migrated your WordPress website, you should check for any glitches or errors. Often, you may want to double-check whether your email setup is still operating with your email tool. And if you may have the same email address, the exact setup information might have changed.
Submit a few test emails from another account to see how you’re receiving them. If you don’t, you’ll need to consult with your current host to figure out how to set up your email programme correctly.
You’ll also need to set up permanent 301 redirects to ensure if someone is trying to access your old site they’ll be redirected to the new one. To set this up, you need to connect your old site using FTP and edit the .htaccess file. You can find this in the same directory as the wp-includes or wp-admin folder. Once you’ve opened the file, you need to paste the following code:
RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L]
Note: Replace newsite.com with your new domain.
Once you have applied these changes, then visit your old domain name. It should automatically redirect you to the new domain.
That is it! You have successfully moved your WordPress site to a new domain. Don’t forget to update these details on Google Search Console to ensure Google can find your new domain name quickly and start showing it in search results.
Aslam loves solving complex problems by bringing out of the box solution approach. Aslam is the Co-Founder and COO at Multidots Inc. an Enterprise WordPress digital agency and one of the WordPress VIP partner agencies with a globally distributed team of WordPress experts helping Content Publishers around the world.