how to move wordpress to a new host or server with no downtime

How to Move WordPress to a New Host or Server With No Downtime

By Naveed Ahmed | Reviewed by Syed Balkhi | October 16, 2024 | Reader Disclosure

As a WordPress expert with over 15 years of experience, I’ve seen firsthand the challenges of moving a WordPress site to a new hosting company or server. It can be daunting, especially if you’re concerned about potential data loss and downtime. But I’m here to tell you it doesn’t have to be a stressful process!

In this comprehensive guide, I’ll walk you through the steps of safely migrating your WordPress site to a new host without any downtime. We’ll cover everything from choosing the right hosting provider to updating your domain name servers.

Remember, many WordPress hosting companies offer a free migration service. They may not advertise it on their website, so don’t hesitate to ask! It’s usually free, but some may charge a small fee.

Let’s dive into the steps you need to take:

Choose Your New WordPress Host

If you’re stuck with a slow web host, even after optimizing your WordPress site’s speed and performance, it’s time to consider moving to a new host that can handle your growing traffic. When choosing a new provider, take your time and pick a provider that meets your specific needs.

Here are some of the best WordPress hosting companies:

  • For reliable shared hosting, I recommend Bluehost. They are officially recommended by WordPress.org. You can use our Bluehost coupon to get up to 75% off and a free domain name.
  • For faster shared hosting, check out Hostinger. They offer fast servers and excellent customer support.
  • If you need cloud hosting or location-specific providers, consider SiteGround. They have data centers across three continents.
  • For managed WordPress hosting, WP Engine is the best and most well-known provider in the industry.

After signing up for your new hosting, **do not install WordPress yet**. We’ll do that later in the process.

Your new web hosting account should be empty, without any files or folders in the main directory.

Set Up Duplicator for Easy Migration

The first step is to install and activate the Duplicator plugin on the website you want to move. If you need help with this, refer to our detailed guide on how to install a WordPress plugin.

Duplicator is the best WordPress migration plugin on the market, offering automated backups, cloud storage support, 1-click restore, and smart migrations. You can even find a free version called Duplicator Lite, which can be used to move your website, but it has limited features compared to the pro version.

Once you’ve installed and activated Duplicator, go to **Duplicator » Backups** in your WordPress admin area. Click the ‘Add New’ button in the top left corner.

This will launch Duplicator’s backup wizard. On the next screen, you can enter a name for your backup or use dynamic tags to automatically create a name format (like the date and your site title).

Expand the ‘Storage’ section to select a storage location. For this guide, we’ll use the default location, but you can add new locations like Dropbox or Google Drive by clicking the ‘Add Storage’ link.

Click on the ‘Next’ button to continue. Duplicator will scan your system to ensure everything is in order to prepare the package. Make sure your scan results check out (everything should say “Good”), and then click the ‘Create Backup’ button.

The process may take several minutes to complete, so leave the tab open while the plugin works. Once it’s finished, you’ll see download options for the Installer and the Archive package. Click on the ‘Download’ button and select the ‘Both Files’ option.

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

Import Your WordPress Site to the New Host

With both the archive and installer files downloaded, upload them to your new web host. You can do this using FTP.

If you’re not familiar with FTP, check out our guide on uploading files via FTP to WordPress. Normally, you would enter your website’s domain name as the host when connecting your FTP client. However, since your domain name still points to your old host, you’ll need to connect by entering your server’s IP address or server hostname.

You can find this information in your new hosting account’s control panel dashboard. If you can’t find it, ask for support from your new web hosting company. They’ll be happy to help.

Using your FTP client, upload both the installer.php file and your archive .zip file to the root directory of your website. This is usually the **username/public_html/** folder. If you are unsure, reach out to your web hosting company.

Make sure your root directory is completely empty. Some hosting companies automatically install WordPress when you sign up. If you have WordPress installed in your root directory, delete it first. Then, upload both the archive zip file and the installer.php file to your site’s root directory.

Change the Hosts File to Prevent Downtime

Now that you’ve uploaded both files to your new host, you need to access the **installer.php** file in a browser.

Normally, this file can be accessed using a URL like this:

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

However, this URL will take you to your old web host, and you’ll get a 404 error. This is because your domain name still points to your old host.

Many tutorials suggest changing your domain nameservers to point to your new hosting company, but that’s not the best approach. If you do this now, your visitors will see a broken website while you migrate it.

Instead, we’ll show you how to temporarily access your new site on your computer without affecting the old site. This is done with the hosts file on your computer.

The hosts file maps domain names to specific IP addresses, allowing you to trick your computer into thinking the website is moved even though it’s not.

Here’s how to add an entry for your domain name in the hosts file so it points to your new hosting company. This will allow you to access the files on your new host using your domain name on your computer while the rest of the world continues to access your site from the old host, ensuring 100% uptime.

First, you need to find the IP address of your new web hosting server. Log in to your cPanel dashboard and click on the expand stats link in the left-hand sidebar. Your server’s address will be listed as ‘Shared IP Address’. On Hostinger, you’ll find your server IP address under your hosting plan details.

If you’re using a Windows PC, open the Notepad app with administrator privileges. Right-click on the Notepad app icon and select ‘Run as administrator’. A Windows UAC prompt will appear. Click on ‘Yes’ to launch Notepad with administrator privileges.

In Notepad, go to **File » Open** and then navigate to the **C:\Windows\System32\drivers\etc** folder. Select the hosts file and open it.

If you’re using a Mac, open the Terminal app and enter this command to edit the hosts file:

sudo nano /private/etc/hosts

For both Windows and Mac users, at the bottom of the hosts file, enter the IP address you copied and then your domain name. It should look like this:

192.168.1.22 www.example.com

Replace the IP address with the one you copied from cPanel and example.com with your own domain name.

Save your changes. You can now access your files on the new host using your domain name on your computer. Don’t forget to undo these changes to the hosts file once you’ve finished the migration (step 6).

Creating MySQL Database on Your New Host

Before running the installer on the new host, you’ll need to create a MySQL database on your new hosting account. If you’ve already created a MySQL database, skip to the next step.

Creating a Database in cPanel

Go to your new hosting account’s cPanel dashboard, scroll down to the Databases section, and click on the ‘MySQL Databases’ icon. You will see a field for creating a new database. Enter a name for your database and click the ‘Create Database’ button.

After creating the MySQL database, scroll down to the MySQL Users section. Provide a username and password for your new user and click on the ‘Create User’ button.

Next, 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. Scroll down to the ‘Add User to a Database’ section. Select the database user you created from the dropdown menu next to the user, then select the database, and click on the ‘Add’ button.

Your database is now ready to be used with WordPress. Make a note of the database name, username, and password. You’ll need this information in the next step.

Begin the Duplicator Migration Process

Now, we’re ready to run the installer. Navigate to the following address in your browser window, replacing **example.com** with your domain name:

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

The installer will run a few tests and show you ‘Pass’ next to the archive and validation tests. Check the terms & conditions checkbox and continue by clicking on the ‘Next’ button.

You’ll be asked to enter your MySQL host, database name, username, and password. Your host will likely be **localhost**. Enter the details of the database you created in the previous step.

Duplicator needs to check if it can connect to the database and run the installation. Click on the ‘Validate’ button at the bottom to continue. If Duplicator can connect, you’ll see test results as Pass. Check the terms and notices checkbox and click on the ‘Next’ button.

Click on the ‘Next’ button again. Duplicator will now import your WordPress database from the archive zip into your new database. Then, it will ask you to update the 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 show you the login button. You can now log in to your WordPress site on the new host to ensure everything is working as expected.

Update Your Domain Name Servers (DNS)

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 your users are taken to the new location of your website when they type your domain into their browsers. If you registered your domain with your hosting provider, it’s best to transfer the domain to your new host. If you use a domain registrar like Domain.com, GoDaddy, or Network Solutions, you need to update your nameservers.

You’ll need the DNS nameserver information from your new web host. This is usually a couple of URLs that look like this:

ns1.hostname.com
ns2.hostname.com

For this guide, we’ll show you how to change DNS nameservers with GoDaddy. For other hosting providers, check out our guide on changing domain nameservers. The screenshots may look different, but the basic concept is the same.

You need to look for the domain management area and then look for nameservers. If you need assistance updating your nameservers, you can ask your web hosting company.

To change nameservers with GoDaddy, log in to your GoDaddy account and click on ‘Domains’. Click on the ‘Manage’ button next to the domain name you want to change. Go to the ‘Additional Settings’ section and click on ‘Manage DNS’ to continue.

Scroll down to the ‘Nameservers’ section and click on the ‘Change’ button. Switch the nameserver type dropdown from ‘Default’ to ‘Custom’. Fill in your new hosting provider’s information under Nameservers, and don’t forget to click on the ‘Save’ button to store your changes.

You have successfully changed the nameservers on your domain. DNS changes can take 4 – 48 hours to propagate for all users. Since you have the same content on your old host and the new host, your users won’t see any difference. Your WordPress migration will be seamless with absolutely no downtime.

To be on the safe side, I recommend waiting to cancel your old hosting account until 7 days after your migration.

FAQs

How do I migrate my WordPress website to another host?

You can migrate your WordPress website by moving your WordPress files and database from your old host to the new hosting provider. Some hosting companies offer free website transfer services as well, but you’ll need to ask them. Alternatively, you can do it yourself by transferring files using an FTP client and importing the database via phpMyAdmin.

Can I migrate my WordPress site to another hosting provider?

Yes, you are free to migrate your WordPress site to another hosting provider.

Can I sign up for the new hosting account without registering a domain name?

Yes, you can absolutely sign up for a hosting account without registering a domain name. Domain name and hosting are two different services, and you don’t necessarily need to register a domain name when signing up for a new host. For more details, see our guide on the difference between domain name and web hosting. Some hosting providers will ask you to select a domain name as the first step when purchasing hosting. They will also allow you to enter a domain name if you already have one.

Do I need to transfer my domain name to the new host?

No, you don’t need to transfer your domain name to the new host. However, transferring your domain name to your new hosting will make it easier to renew and manage under the same dashboard as your new hosting account. For more on this topic, see our ultimate guide on domain names and how they work.

How do I fix the error establishing database connection error in Duplicator?

If you are seeing an error connecting to the database or the database connection error in Duplicator, then you likely entered incorrect information for your database connection. Make sure that your database name, MySQL username, and password are correct. Some web hosting companies do not use localhost as the host for their MySQL servers. If this is the case, then you will need to ask your web host’s support staff to provide you with the correct information.

How do I check if my website is loading from the new host?

There are several online tools that allow you to see who is hosting a website. After you have transferred your website to the new host, you can use any of these tools, and they will show you the name of the web hosting company hosting your website. If it hasn’t been long since you migrated your website and made changes to your domain name server (DNS), then chances are that your site may still load from your old host. Domain name changes can take up to 48 hours to fully propagate.

Do I need to delete any files or data from the old host?

When switching hosting companies, I recommend that you keep your old website for at least a week. After that, you can delete files from your old web host. If you are canceling your account, then your web hosting provider will delete all your data according to their policy.

How long should I keep my account active on the old host?

Once you have migrated your website to the new host, and if you don’t have any other websites hosted with your old web host, then you can cancel your old web hosting account. However, in some cases, you may have already paid them for yearly hosting. You should check their refund policy to see if you are eligible for any refund upon cancellation.

How do I move a WordPress site with SSL/HTTPS?

You will need to install an SSL certificate on your new hosting provider. After that, you can follow the same steps mentioned above. Just make sure that you use HTTPS in the URLs, like https://example.com

Bonus: Free Site Migration by Your New Host

If you are looking to switch your web hosting, but the steps above sound too complicated, then you can choose the following providers, and they will migrate your website for you.

SiteGround, Hostinger, and WP Engine offer free website migration for WPBeginner users.

Conclusion

Moving your WordPress site to a new host doesn’t have to be a stressful experience. By following these steps and utilizing the power of tools like Duplicator, you can ensure a smooth and seamless migration without any downtime. Remember to choose a new host carefully, prepare your new hosting environment, and be patient with DNS propagation. With a little planning and the right tools, you can switch hosts with confidence and keep your website running smoothly.

If you’re interested in learning more about tech news, feel free to visit my website: www.naveedahmed.me.

Posted in All
Need help for wordpress ?
Contact me
https://whatreligionisinfo.com/ https://howtobakeandcook.com/ https://howdidcelebdie.com/