How-to

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

Moving a WordPress site to a new host sounds risky, and done carelessly it is. People copy files, flip DNS, and then spend a day staring at “Error establishing a database connection” while customers hit a blank page. Lost orders, broken images, and a temporary drop in search traffic are the usual damage. The good…

Team Thetechhacker · 5 min read
WordPress.org logo

Move WordPress Site New Host

Moving a WordPress site to a new host sounds risky, and done carelessly it is. People copy files, flip DNS, and then spend a day staring at “Error establishing a database connection” while customers hit a blank page. Lost orders, broken images, and a temporary drop in search traffic are the usual damage.

The good news is that a zero-downtime move is mostly about order of operations. If the new copy is fully working and tested before any visitor is sent to it, nobody notices the switch.

Now in this article, I will show how to move a WordPress site to a new host without downtime, using either a migration plugin or the manual method, and how to test everything before you change DNS.

Quick answer: Take a full backup, lower your DNS TTL a day or two ahead, copy files and the database to the new host (with a plugin or manually), update wp-config.php, then preview the new server through your hosts file. Once everything checks out, point DNS to the new host, set up SSL, and keep the old host running for a few days.

Getting Started

Before you touch anything, gather:

  • Admin access to both hosts (control panel, SFTP or SSH, and phpMyAdmin or similar).
  • Login to your DNS provider, which may be your registrar, your old host, or Cloudflare.
  • A full backup of files and database stored off the old server.
  • The new host’s IP address and an empty database with its name, user, and password.

Cost is usually just your new hosting plan. Many managed WordPress hosts offer to migrate sites for you, so check that first; it can save an evening.

Step 1: Lower Your DNS TTL

TTL (time to live) controls how long resolvers cache your DNS records. Many records sit at an hour or longer. One to two days before the move, edit your domain’s A record (and the www record) and set the TTL to something short, like 300 seconds. When you switch later, most visitors will pick up the new IP within minutes instead of hours.

Step 2: Copy the Site

Option A: Use a migration plugin

This suits most small sites. UpdraftPlus, Duplicator, All-in-One WP Migration, and Migrate Guru all package files and database and handle URL replacement. UpdraftPlus’s free version, for example, includes migration with a built-in search-and-replace tool. Install WordPress on the new host, install the same plugin, and restore the package there. Watch for upload size limits on large sites, which some plugins only lift in paid versions.

Option B: Move it manually

Better for large sites or if you want full control.

  1. Export the database from phpMyAdmin or with wp db export over SSH.
  2. Download all files in the WordPress folder, including wp-content and hidden files like .htaccess.
  3. Upload the files to the new host’s web root.
  4. Import the database into the new empty database.
  5. Edit wp-config.php with the new DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST values.
  6. Run a search-replace only if the domain changes. Use a serialization-safe tool such as WP-CLI’s search-replace command, never a plain text find-and-replace on the SQL file.

The official Migrating WordPress guide warns that plain replacements can break serialized data and that you should never change the GUID column. Its WP-CLI example skips that column with --skip-columns=guid.

Steps to move a WordPress site to a new host without downtime

Step 3: Test Through Your Hosts File

This is the step that prevents downtime. Your computer’s hosts file lets you send only your own browser to the new server while everyone else still sees the old one.

  1. Open the hosts file as administrator: C:\Windows\System32\drivers\etc\hosts on Windows or /etc/hosts on Mac.
  2. Add a line with the new IP followed by your domain, and another for www.
  3. Flush your DNS cache, then open your site in a private window.
  4. Click through key pages, log in to wp-admin, submit a contact form, and run a test checkout if you sell online.
  5. Remove those lines when you’re done.

Migrating WordPress page in the WordPress Advanced Administration Handbook

Screenshot: Migrating WordPress page on developer.wordpress.org, captured by TheTechHacker.

Step 4: Switch DNS and Set Up SSL

  1. Freeze content changes. Pause posting and, on a store, schedule the switch for a quiet hour so no orders land on the old server.
  2. Re-sync if needed. If anything changed since your copy, export the database again and import it on the new host.
  3. Update the A records to the new IP.
  4. Issue the SSL certificate. Most hosts offer free Let’s Encrypt certificates, which usually need DNS to point at the new server first. Some hosts can issue one before the switch through DNS validation.
  5. Raise the TTL back to its usual value after a day.
  6. Keep the old hosting active for at least a few days as a fallback before canceling.

Troubleshooting

  • “Error establishing a database connection”: a wrong value in wp-config.php. DB_HOST isn’t always localhost; check your host’s docs.
  • Redirects back to the old site or a temporary URL: the siteurl and home options in wp_options are wrong. Fix them with wp option update home and wp option update siteurl.
  • Broken links or 404s on inner pages: go to Settings, then Permalinks, and click Save to rebuild rewrite rules.
  • Mixed content warnings: some images still load over http. Run a search-replace from http:// to https:// for your domain.
  • Email stopped working: you may have overwritten MX records when changing DNS. Only edit the A records.
  • Caching plugins misbehaving: clear plugin, server, and CDN caches after the switch.

Still choosing where to move? Compare the best managed WordPress hosting and the best web hosting for small business websites. If you’re moving DNS too, our domain registrar comparison helps, and for a wider safety net read how to back up your business data.

That’s all for now. Please do share your views and feedback in the comment box below.

FAQs

How long does a WordPress migration take?

A small site can be copied in under an hour. Allow a day or two around it for the TTL change and testing.

Will moving hosts hurt my SEO?

Not if the domain and URLs stay the same and the site stays online. Problems come from downtime or broken URLs.

Do I need to change nameservers?

No. Changing only the A records keeps your email and other DNS settings where they are.

When can I cancel my old host?

After traffic and orders are clearly hitting the new server and you have a fresh backup, usually a few days to a week later.

Featured image: WordPress.org.

Disclosure: TheTechHacker has no paid relationship with WordPress.org, UpdraftPlus, Duplicator, All-in-One WP Migration, Migrate Guru, or Let’s Encrypt, and this post has no affiliate links.

Keep reading

More in How-to

View all →
Written byTeam ThetechhackerEditorial Desk
Team Thetechhacker is the editorial desk at TheTechHacker. Desk posts cover breaking tech news, update roundups and quick fixes, researched from official sources such as vendor release notes, support pages and press releases, and checked by our editors before publishing.

Comments

Leave a comment

The Thetechhacker letter

The week in tech, minus the noise.

New reviews, fixes and the stories that matter — once a week, straight to your inbox.