Skip to content
Guides & Tutorials

How to Move a WordPress Site to a New Host Without Downtime

In this article13 sections

To move a WordPress site to a new host without downtime, copy the whole site to the new server first, test it there while visitors still use the old one, and only then switch your domain over. In practice that means seven steps: back up the old site, copy the files, copy the database, update wp-config.php, preview the new copy with a hosts file, switch DNS, and keep the old hosting for a few days. Because visitors are never sent to a server that is not ready, nothing breaks while the change spreads.

These steps are written for a move to cPanel hosting. You can do them yourself with no coding, and you can ask your new host whether they offer migration help. If you are not sure how DNS works, read how to point a domain to your hosting alongside this guide.

Before you start: plan the move

A calm move comes down to preparation. Do these things first:

  • Pick a quiet time. Choose a period with little traffic, and avoid launches, sales and deadlines.
  • Freeze content changes. Do not publish posts, change settings or take shop orders on the old site between copying it and switching DNS. Anything added to the old site after the copy will not exist on the new one.
  • Check email. If your email runs on the old hosting, decide where it will live after the move. Read the email section in the guide linked above before you change anything.
  • Lower the DNS timer. If you control your DNS records, set the TTL of the main records to a low value such as 300 seconds, a day before the move. Low values mean the final switch takes effect faster.

Step 1: Back up the old site

Never move a site without a backup that is stored somewhere other than the old server. In the old cPanel, open Backup Wizard, choose Back Up, and download the home directory and the database. If you cannot use cPanel, a migration plugin can package files and database in one archive.

Warning. Do not cancel or change anything on the old hosting during the move. It is your safety net, and your visitors are still using it until the very last step.

Step 2: Add the domain on the new hosting

Log in to cPanel on the new hosting. If the domain is not already the main one for the account, open Domains and add it. This creates the folder where the site files will go, usually public_html for the main domain. Do not change your nameservers yet.

Step 3: Copy the files

You need the contents of the WordPress folder, which includes wp-content, wp-config.php and the core files.

  1. In the old cPanel, open File Manager, go to the WordPress folder, select everything and choose Compress to create a zip file.
  2. Download the zip to your computer.
  3. In the new cPanel, open File Manager, go to the new site’s folder, click Upload and upload the zip file.
  4. Select the zip and choose Extract. Check that the WordPress files sit directly in the folder, not inside another folder.

For a very large site, FTP is more reliable than a browser upload. If you use the full backup from Step 1, ask your new host to restore it for you.

Step 4: Copy the database

The database holds your posts, pages, settings and users. Move it in three parts:

  1. Export. In the old cPanel, open phpMyAdmin, select your WordPress database, click Export, choose the Quick method with the SQL format, and download the file.
  2. Create the new database. In the new cPanel, open MySQL Databases. Create a database, create a user with a strong password, and add the user to the database with All Privileges. Write the three names down, because cPanel adds an account prefix to them.
  3. Import. In the new cPanel, open phpMyAdmin, select the new database, click Import and choose your SQL file.

If the import fails because the file is too large, compress the SQL file to zip or gzip before you try again, or ask support to import it for you.

Step 5: Update wp-config.php

The new database has a different name, user and password, so WordPress has to be told. In the new File Manager, copy wp-config.php to wp-config-backup.php, then edit the original and change these lines to the values from Step 4:

define( 'DB_NAME', 'newaccount_wpdb' );
define( 'DB_USER', 'newaccount_wpuser' );
define( 'DB_PASSWORD', 'your-new-strong-password' );
define( 'DB_HOST', 'localhost' );

On cPanel hosting, DB_HOST is almost always localhost. Save the file.

Step 6: Preview the new copy before switching

This is the step that avoids downtime. You can make your own computer open the new server for your domain while everybody else still sees the old one, by adding a line to your hosts file.

  1. Find the new server’s IP address in cPanel, under General Information on the home screen.
  2. Open your hosts file with administrator rights. On Windows it is C:WindowsSystem32driversetchosts. On macOS and Linux it is /etc/hosts.
  3. Add one line at the end, with your own IP address and domain, and save:
203.0.113.10 example.com www.example.com

Open your site in a private window. You are now looking at the new server. Check the home page, several posts, images, your menus, forms and, if you have one, the shop and checkout. Log in to /wp-admin too. If a page shows an error, fix it now, while nobody else is affected.

Tip. If the site loads but links or images go to the old address, the site URL in the database may differ from the domain you are testing. In the dashboard, check Settings, General. If you are keeping the same domain, it should already match.

When you finish testing, delete the line from the hosts file, or your own computer will keep going to the new server even after you change your mind.

Step 7: Switch DNS

When the new copy works, it is time to send real visitors there. Change the nameservers at your registrar, or the A record if you keep your DNS where it is, as described in our DNS guide. Make this change soon after your last content freeze, so the two copies stay identical.

The change spreads over minutes to hours, sometimes up to about 48 hours. During that time, some visitors reach the old site and some reach the new one, and both work. That overlap is the reason there is no downtime. If your site takes orders or comments, either keep them closed during this window or check both sites afterwards.

Step 8: Finish up

  • Check SSL. Once the domain points to the new server, open SSL/TLS Status in cPanel and run AutoSSL if the padlock is missing.
  • Re-save permalinks. In WordPress, go to Settings, Permalinks, and click Save Changes without changing anything. This fixes pages that show 404 errors after a move.
  • Test email. Send and receive a message, and test your contact form.
  • Keep the old hosting for about a week. Cancel it only when you are sure that all visitors, email and forms use the new server.
  • Tune the new site. Follow our 5-step speed guide to turn on caching and update PHP on the new account.

If something goes wrong

  • Error establishing a database connection. The details in wp-config.php are wrong, or the user was not added to the database. Check the names, including the account prefix, and the user’s privileges.
  • A white page or a 500 error. Restore wp-config-backup.php or check Errors under Metrics in cPanel. A plugin that does not suit the new PHP version is a common cause, and these cPanel checks show how to find it.
  • Images or styles missing. The wp-content folder may be incomplete or the upload may have been cut off. Extract the zip again.
  • The old site still shows. Your hosts file entry may be missing, or DNS has not spread. Check with nslookup example.com.

Common mistakes to avoid

  • Switching DNS before testing. The hosts file preview exists to catch problems while they affect only you.
  • Letting content change after the copy. New posts, comments and orders on the old site are lost on the new one.
  • Forgetting email. Moving the website does not move mailboxes, and DNS changes can break delivery.
  • Cancelling the old plan the same day. Keep it until the move is proven.
  • Leaving the hosts file entry in place. It makes your own computer show something different from your visitors.

Want a hand with the move?

If you would rather not do this alone, ask us about migration help on our shared hosting plans. Our support team can answer questions about nameservers, IP addresses and the new cPanel account before you begin.

Related guides: migrating email to a new host with imapsync and transferring a domain without downtime. If something breaks, see fixing “Error establishing a database connection” and fixing ERR_TOO_MANY_REDIRECTS in WordPress.

Frequently asked questions

How long does a WordPress migration take?

The copy usually takes an hour or two for a small site. The DNS change can then take from minutes to about 48 hours to reach everyone.

Will my search rankings drop?

Not if the address stays the same and the site works on the new server. Keep your URLs and your content unchanged, and make sure HTTPS works after the switch.

Can I use a migration plugin instead?

Yes. Several plugins package the files and database for you. The steps around them stay the same: back up, test before switching and keep the old hosting for a while.

What happens to my email?

Email follows your DNS records, not your website files. If your mailboxes are on the old hosting, create them on the new one first, or keep using the old provider by leaving the MX records unchanged.

What if I only change the domain name, not the host?

That is a different job. You need to update the site addresses in WordPress and set up redirects from the old domain to the new one.

The short version: back up, copy files and database to the new host, fix wp-config.php, test through your hosts file, switch DNS, then keep the old hosting for a week.

Share this guide