DEV Community

Globalvior.com
Globalvior.com

Posted on Edited on

5 Mistakes That Break a WordPress Site During a Host Migration

Moving a WordPress site to a new host is mostly routine, but the same handful of mistakes cause most of the pain. Here are the five I see most often, and how to avoid them.

1. Backing up only the files

A WordPress site is files plus a database. Posts, pages and settings live in the database. If you only copy files, you get a site with no content.

Back up both, and store a copy outside the old host.

2. Switching DNS before testing

If you point the domain at the new server before checking it, visitors land on a broken page.

Test first, using the host's temporary URL or by editing your local hosts file:

203.0.113.10  example.com www.example.com
Enter fullscreen mode Exit fullscreen mode

(Replace the IP with your new server's.)

3. Forgetting email records

If your email uses your domain, it depends on DNS records, especially MX. Change nameservers without copying them and email can silently stop working.

Before changing anything, save your records:

dig example.com MX +short
dig example.com TXT +short
Enter fullscreen mode Exit fullscreen mode

Changing only the A record leaves email records untouched.

4. Cancelling the old host too early

DNS changes take time to spread, so some visitors still reach the old server for a while. Keep the old plan for several days as a fallback.

5. Ignoring HTTPS after the move

A site that loaded securely before can show mixed-content warnings after the move. Check the certificate is active and look for leftover http:// links in your content.

Quick checklist

  • Files and database backed up
  • DNS records saved
  • New site tested before DNS change
  • Email tested after the switch
  • HTTPS verified
  • Old hosting kept for several days

I wrote a longer beginner-friendly guide with the manual and plugin methods and an SEO FAQ: How to Migrate a WordPress Site to a New Host

What's the worst migration problem you've run into?

Top comments (1)

Collapse
 
alhiane profile image
Alhiane Lahcen •

Good list. Three more that have saved me:

  • Lower the DNS TTL (for example to 300 seconds) a day or two before the switch. Then the change spreads in minutes, and so does a rollback if you need one.
  • If the domain or http/https changes, use wp search-replace instead of a plain SQL find-and-replace. Options and widgets store serialized data, and it breaks when string lengths change. Run wp search-replace 'http://example.com' 'https://example.com' --skip-columns=guid --dry-run first, then again without --dry-run. That also fixes most of the mixed-content warnings from #5.
  • While you test the new server through the hosts file, it is a full working copy. WP-Cron can send scheduled emails, run subscription renewals or sync to outside services a second time. On a store, pause that on the new copy until DNS points to it (define('DISABLE_WP_CRON', true); stops visit-triggered cron, and a mail-logging plugin can catch outgoing email). And if the old store keeps taking orders during propagation, plan how you'll move the orders that land there after you copied the database.