How to Migrate a Website Without Downtime (Step-by-Step)

A practical, zero-downtime migration checklist for WordPress, PHP apps, static sites, and eCommerce.

Zero-Downtime Website Migration: The Complete Guide

Moving your website to a new host (or new server) doesn’t have to mean going offline. With some prep, a reliable rollback plan, and a staged cutover, you can switch traffic with users none the wiser. This guide walks you through a production-safe process you can reuse for WordPress, PHP frameworks (Laravel, CodeIgniter), static sites, and even most eCommerce stacks.

At a glance: Lower DNS TTL → full backups → stage on new host → sync files + database → verify on a hosts file preview → freeze writes → delta sync → switch DNS → monitor → re-enable writes → clean up.

Before You Start: Define Scope & Success Criteria

Step 1 — Lower DNS TTL

DNS records often have a default TTL (time-to-live) of 1–24 hours. Lowering it to 300 seconds (5 minutes) a day or two before your move means your switch propagates fast. Update A/AAAA records for the root domain and CNAME for www. If you use a CDN (e.g., Cloudflare), ensure the proxying mode and caching rules are compatible with the new origin.

Step 2 — Back Up Everything

Tip: Store backups in offsite storage (S3/Backblaze) and label them with a timestamp. Test a mini-restore so you trust the safety net.

Step 3 — Stage on the New Host

Create a staging environment that mirrors production:

Step 4 — Preview Using Your Hosts File

Rather than exposing staging publicly, preview the site on your machine by mapping the production domain to the new server’s IP in your hosts file. That way, you see the site as if DNS has already switched, while the world keeps hitting the old server.

Visit your domain; only you will see the new host. Test pages, forms, search, logins, admin flows, and any third-party scripts (analytics, ads, chat).

Step 5 — Freeze Writes (Short Content Lock)

To avoid data divergence during the final sync, put the old site into a brief “content freeze.” For blogs, this means pausing new posts/comments; for stores, scheduling a short “checkout pause” window. Keep the site readable—just block actions that write to disk/DB. For WordPress, set the site to maintenance mode for admins only (or temporarily disable comments/uploads), and place a friendly banner to inform contributors.

Step 6 — Delta Sync (Files + DB)

Perform a final, incremental sync to capture changes since staging:

Step 7 — Go Live: Switch DNS

With TTL already low, switching the A/CNAME records to the new server is instantaneous for most users within minutes. If using a CDN, update the origin IP there instead. Keep the old server online for 24–48 hours to serve stragglers whose resolvers cached the old IP.

Step 8 — Post-Cutover Verification

Rollback Plan (Have It Ready—Rarely Needed)

If something critical appears, revert DNS to the old server (thanks, low TTL), re-enable writes there, and investigate without pressure. Because you kept the old host intact, rolling back is a record change—not a crisis.

Platform-Specific Notes

WordPress

PHP/Laravel

Static Sites

eCommerce

Performance & Security Quick Wins During the Move

Common Pitfalls (and How to Avoid Them)

  1. Forgetting email DNS: If mail is hosted elsewhere (Google/Microsoft), don’t change MX records. Keep SPF/DKIM/DMARC aligned.
  2. Mixed content after SSL: Update hard-coded http:// assets to https:// and enforce HSTS only once everything’s clean.
  3. Permissions mismatch: Ensure the web user can write to cache/upload directories—avoid 777 shortcuts.
  4. Uncleared caches: Edge caches (CDN) or plugin caches can show “old site” to part of your audience; purge thoroughly.
  5. No monitoring: Add uptime and error alerting before the move. If something blips, you’ll know instantly.

SEO Considerations

Blue-Green Concept (Optional)

For high-traffic or mission-critical apps, run a “blue-green” setup: blue (current) and green (new) environments behind a load balancer or DNS. Smoke-test green with internal traffic, then switch 100% of traffic when ready. The old environment remains your instant rollback.

Communication Template (Copy/Paste)

Subject: Heads-up: Site infrastructure upgrade (no downtime expected)

We’re upgrading our hosting to improve speed and reliability. The change happens during a low-traffic window. No downtime is expected; you may briefly see cached content while things update. If you notice anything odd, please reply to this email or use the contact form. Thank you!

Launch-Day Timeline

  1. Confirm backups and rollback steps.
  2. Freeze writes and capture delta backups.
  3. DNS switch (or CDN origin update).
  4. Purge caches (app + CDN), warm key pages.
  5. Run automated and manual checks (forms, payments, search, 404s).
  6. Re-enable writes; keep the old host as a safety net for 24–48 hours.

FAQs

How long should I keep the old server? 24–48 hours is standard; heavy B2B audiences with strict resolvers may warrant 72 hours.

Will users lose sessions or carts? If you switch domains or session keys, yes. Otherwise, most PHP sessions will naturally expire—warn active users during the short window. For WooCommerce, schedule cutover outside peak shopping time.

What about email? If your domain’s email is with Google/Microsoft, leave MX as is. If email moves too, plan a separate sync window and keep IMAP copies.

Related: How DNS Works · Website Speed Optimization · Website Security Checklist

Planning a migration?
We can help you move with zero downtime.
References for sitewide layout/style alignment: :contentReference[oaicite:0]{index=0} :contentReference[oaicite:1]{index=1}