Do you intend to relocate your WordPress site to a new hosting provider or a different server? When switching web hosting or migrating a website to a new server, the most significant risk is data loss and downtime.

Both of these can temporarily render your website inaccessible to users and search engines, resulting in a loss of sales and search engine rankings.

In this step-by-step tutorial, we’ll show you how to migrate your WordPress site to a new host safely and without downtime.

We’ll also address the most frequently asked questions about migrating a WordPress site to a new hosting provider, so you don’t make common mistakes.

Let’s go over the steps we’ll take to migrate WordPress to a new hosting server (without any downtime).

  • Select a new WordPress host.
  • Install the Duplicator Plugin for Simple Migration.
  • Transfer your WordPress website to the new host.
  • To avoid downtime, modify the Hosts file.
  • On your new host, create a MySQL database.
  • Run the website migration script Duplicator.
  • Changing the name server for your domain
  • Questions and Answers about Moving WordPress to a New Host

Ready? Let’s get this party started.

Step 1: Select a new WordPress host.

When looking for a new WordPress hosting provider, it is critical to choose wisely so that you do not have to relocate anytime soon.

Here are some people we recommend:

  • Bluehost is a good choice for dependable shared hosting. WordPress.org has officially recommended them. Your Blog Master users who use our Bluehost coupon receive a 60% discount and a free domain name.
  • If you’re looking for cloud hosting or a provider in a specific location, we recommend Siteground. They have data centers on three continents.
  • If you are looking for managed WordPress hosting, we recommend WP Engine. They are the industry’s best and most well-known provider.

DO NOT INSTALL WORDPRESS ON YOUR NEW HOSTING AFTER PURCHASING IT. That will be done in a later step.

For the time being, your new web hosting account should be completely empty, with no files or folders in the main directory.

Step 2: Install the Duplicator Plugin for Simple Migration.

The first step is to install and activate the free Duplicator plugin on the website you want to move.

We highly recommend Duplicator, a free plugin. It can also be used to transfer your website to a new domain name without losing SEO.

However, in this article, we’ll show you how to use it to move your WordPress site from one host to another with no downtime.

Once Duplicator has been installed and activated, navigate to the Duplicator » Packages page in your WordPress admin area.

Then, in the top right corner, click the ‘Create New’ button.

Then, click the Next button and proceed with the steps to create your package.

Check that your scan results are correct (everything should say “Good”) before clicking the Build button.

The process may take several minutes, so keep the tab open while the plugin works.

When the process is finished, you’ll see download options for the Installer and Archive packages. To download both files, click on the ‘One click download’ link.

The archive file contains a complete copy of your website, and the installer file will automate the installation process for you.

Step 3: Transfer your WordPress website to the new host.

After you’ve downloaded the archive and installer files, you’ll need to upload them to your new web host.

You can do this by using FTP to connect to your new web host.

When connecting your FTP client, you would normally enter your website’s domain name as the host.

However, because your domain name is still pointing to your old host, you must connect by entering your server’s IP address or hostname. This information can be found in the cPanel dashboard of your new hosting account.

If you are unable to locate this information, contact your new web hosting company and they will assist you.

Upload the installer.php file and your archive.zip file to the root directory of your website using an FTP client.

Typically, this is the /username/public html/ folder.

Again, if you are unsure, contact your web hosting provider.

Check to see if your root directory is completely empty. When you sign up for a web hosting account, some companies will automatically install WordPress.

If you have WordPress installed in your root directory, you must first delete it.

After that, upload both the archive zip file and the installer.php file to your site’s root directory.

Step 4: To avoid downtime, modify the Hosts file.

After uploading both files to your new host, open the installer.php file in a browser.

Normally, this file can be accessed via a URL similar to this:

http://www.example.com/installer.php

This URL, on the other hand, will take you to your old web host and result in a 404 error. This is due to the fact that your domain name is still pointing to your previous web host.

Other tutorials may tell you to change your domain nameservers and point it to your new hosting provider, but this is incorrect.

If you do this now, your visitors will see a broken website while it is being migrated.

We’ll show you how to temporarily access your new site on your computer without affecting your old site.

This is accomplished through the use of a hosts file on your computer.

Domain names can be mapped to specific IP addresses using the hosts file. In other words, it allows you to deceive your computer into believing that the website has been relocated when it has not.

Let’s look at how to add an entry in the hosts file for your domain name so that it points to your new hosting company.

By making these changes, you will be able to access the files on your new host using your own domain name, while the rest of the world will continue to access your site through the old host. This ensures that the system is always operational.

The first step is to determine the IP address of your new web hosting server. Log into your cPanel dashboard and click the expand stats link in the left-hand sidebar to find it. The address of your server will be listed as Shared IP Address.

This information is provided under the ‘Account Information’ heading on certain web hosting companies.

Windows users must then navigate to Programs » All Programs » Accessories, right-click on Notepad, and select Run as Administrator.

A Windows UAC prompt will appear, and you must click Yes to launch Notepad as administrator.

Navigate to the C:WindowsSystem32driversetc folder from the Notepad screen by selecting File » Open. Select and open the hosts file from this folder.

To edit the hosts file on a Mac, launch the Terminal app and type the following command:

/private/etc/hosts sudo nano

For both Windows and Mac users, you must enter the IP address you copied at the bottom of the hosts file, followed by your domain name. As an example:

www.example.com 192.168.1.22

Make sure to replace example.com with your own domain name and the IP address with the one you copied from cPanel.

When you’re finished, save your changes.

You can now access your files on the new host using your computer’s domain name.

Important: After you’ve completed the migration, don’t forget to undo any changes you made to the hosts file (step 6).

Step 5: On your new host, create a MySQL database.

You must generate a MySQL database on your new hosting account site before we would setup the installer on the new host. You can skip ahead to another step, if you have already developed a MySQL database.

Using cPanel to Create a Database

Go on to the cPanel dashboard of your new hosting account, read down to the Databases section, and select on MySQL databases icon.

You’ll notice a field for making a new database. Give your database a name and then click the “Create Database” button.

After you’ve created the MySQL database, navigate to the MySQL Users section.

After that, enter a username and password for your new user and press the ‘Create a user’ button.

Following that, you must add this user to your database. This will grant the newly created username complete access to the database.

Scroll down to the ‘Add User to a Database’ section to do so. Simply choose the database user you created from the dropdown menu next to user, then database, and finally add.

Your database is now complete and ready for use with WordPress. Make a note of the database’s name, username, and password. That information will be required in the following step.

Step 6: Run the website migration script Duplicator.

We’re now ready to run the installer. In your browser window, navigate to the following address, replacing example.com with your domain name:

http://www.example.com/installer.php

The installer will run a few tests and display ‘Pass’ next to the archive and validation tests.

You must check the terms and conditions checkbox before proceeding by clicking the Next button.

You will now be prompted to enter your MySQL hostname, database name, username, and password.

Your host is most likely going to be localhost. Following that, you will enter the database details that you created in the previous step.

To ensure that you have entered the correct information, click the ‘Test Database’ button.

If Duplicator is successful in connecting, you will see a string beginning with Pass. Otherwise, the database connection error details will be displayed.

To proceed, click the next button.

Duplicator will now import the WordPress database from the zip archive into your new database.

It will then prompt you to update the site URL or Path. You DO NOT NEED TO CHANGE ANYTHING HERE BECAUSE YOU ARE NOT CHANGING DOMAIN NAMES.

To proceed, simply click the next button.

Duplicator will complete the final steps and display the login button.

You can now access your WordPress site on the new host to ensure that everything is functioning properly.

Step 7: Changing the name server for your domain

You’ve made a complete backup of your WordPress database and files on your new hosting server, but your domain still points to your old web hosting account.

You must change your DNS nameservers to update your domain. This ensures that when your users type your domain into their browsers, they are directed to the new location of your website.

If you registered your domain with your hosting provider, you should transfer it to a new host. If you registered your domain with a registrar such as Domain.com, GoDaddy, or Network Solutions, you must update your nameservers.

Your new web host’s DNS nameserver information will be required. This is typically a pair of URLs that look like this:

ns1.hostname.com
ns2.hostname.com

We will show you how to change DNS nameservers with GoDaddy for the purposes of this guide.

The screenshots may differ depending on your domain registrar or web host. However, the fundamental concept remains the same.

Look for the domain management area, followed by the nameservers. If you need help updating your nameservers, contact your web hosting provider.

To use GoDaddy, sign in to your account and then click on Domains.

Following that, click the Manage button next to the domain name you want to change.

To proceed, click on ‘Manage DNS’ under the ‘Additional Settings’ section.

Then, scroll down to the Nameservers section and click the Change button.

To begin, change the nameserver type dropdown from ‘Default’ to ‘Custom.’ Then, under Nameservers, enter the information for your new hosting provider.

Do not forget and save your changes by clicking the save button.

You have successfully changed your domain’s nameservers. DNS changes can take between 4 and 48 hours to propagate to all users.

Because you have the same content on both your old and new hosts, your users will not notice any difference. Your WordPress migration will be completely seamless, with no downtime.

To be on the safe side, we recommend that you wait 7 days after your migration to cancel your old hosting account.

If you liked this post, please find and follow us on InstagramTwitter and Facebook.