List of content you will read in this article:
The biggest risk when switching web hosting or migrating a website to a new server is data loss and downtime. Both of these can make your website temporarily inaccessible to users and search engines which can result in loss of sales and search engine rankings.
In this step by step tutorial, we will show you how to safely migrate your WordPress site to a new host without any downtime.
- Install and Setup the Duplicator Plugin for Easy Migration
- Getting back up by using Duplicator Plugin
- Transfer backup file and Import your WordPress site to the new host
Install and Setup Duplicator for Easy Migration
The first thing you need to do is install and activate the free Duplicator plugin on the website that you want to move. For more details, see our step by step guide on how to install a WordPress plugin.
Duplicator is a free plugin that we highly recommend. You can also use it to move your website to a new domain name without losing SEO.
However, in this article, we will walk you through how to use it to migrate your WordPress site from one host to another with zero downtime.
First thing you need to do is go to your WordPress admin area and click on Plugins » Add New.
Search for Duplicator plugin and install it.
Getting back up by using Duplicator Plugin
Once you have installed and activated Duplicator, go to the Duplicator » Packages page in your WordPress admin area.
Next, you need to click the ‘Create New’ button in the top right corner.
After that, click the Next button and follow the steps to create your package.
Make sure that your scan results check out (everything should say “Good”), and then click the Build button.
The process may take several minutes to complete, once the process is complete, you’ll see download options for Installer and the Archive package. You need to click on the ‘One click download’ link to download both files.
The archive file is a copy of your complete website, and the installer file will automate the installation process for you.
Transfer backup file and Import your WordPress site to the new host
Now go to your new hosting account’s cPanel dashboard and upload both installer.php file and your archive .zip file to the root directory of your website
This is usually-> File manager /username/public_html/
Make sure that your root directory is completely empty. Some web hosting companies automatically install WordPress when you sign up.
If you have WordPress installed in your root directory, then you need to delete WordPress first.
Before you run the installer on the new host, you will need to create a MySQL database on your new hosting account. If you have already created a MySQL database, then you can jump to the next step.
Go back to the main page of cPanel VPS, scroll down to Databases section and click on MySQL databases icon.
You will see a field to create a new database. Enter a name for your database, and click “Create Database” button.
After creating the MySQL database, you need to scroll down to the MySQL Users section.
Next, provide a username and password for your new user and click on the ‘Create a user’ button.
After that, you need to add this user to your database. This will give the username you just created, all the permissions to work on that database.
You can do this by scrolling down to ‘Add User to a Database’ section. Simply select the database user you created from the dropdown menu next to user, then select the database, and click on the add button.
Your database is now ready to be used with WordPress. Be sure to make note of the database name, username, and password. You’ll need that information in the next step.
Now we’re ready to run the installer. Navigate to the following address in your browser window, replacing example.com with your domain name:
The installer will run a few tests and will show you ‘Pass’ next to archive and validation tests.
You need to check the terms & conditions checkbox and continue by clicking on the Next button.
Now, you will be asked to enter your MySQL host, database name, username, and password.
Your host will likely be localhost. After that, you will enter the details of the database you created in the previous step.
You can click on the ‘Test Database’ button to make sure you entered the correct information.
If Duplicator is able to connect, then you will see a string starting with Pass. Otherwise, you will see the database connection error details.
Click on the next button to continue.
Duplicator will now import your WordPress database from the archive zip into your new database.
Next, it will ask you to update site URL or Path. Since you are not changing domain names, you DON’T need to change anything here.
Simply click on the next button to continue.
Duplicator will run the final steps and will show you the login button.
You can now login to your WordPress site on the new host to make sure that everything is working as expected.
At this point, you’ve created a complete copy of your WordPress database and files on your new hosting server, but your domain still points to your old web hosting account.
To update your domain, you need to switch your DNS nameservers. This ensures that your users are taken to the new location of your website when they type your domain into their browsers.