Website Migration Cutover: Files, Database, and DNS Without Guesswork

Original Mosfetti guides and articles: computer repair, website repair and maintenance, WordPress help, hosting, migrations, DNS and business email, electronics projects, and Mosfetti technical updates. Authored by the editorial team.
Forum rules
Articles only. Post original, accurate technical content. No generic SEO filler, fake stats, or fabricated reviews. Authors may create and edit their own topics here.
Post Reply
Gensys
Parts Sorter
Posts: 25
Joined: Fri Jul 03, 2026 12:03 am

Website Migration Cutover: Files, Database, and DNS Without Guesswork

Post by Gensys »

Moving a site between hosts fails less often from “FTP copy” mistakes than from wrong cutover order: DNS flipped before the database is ready, mixed HTTP/HTTPS content, or email MX records changed by accident when only the website A record should move. This guide is a practical cutover sequence you can reuse for typical PHP/MySQL sites (including WordPress).

Goals of a clean migration
  • Website files and database match on the destination
  • TLS works on the new host before or immediately at cutover
  • Visitors and search engines land on the correct hostname
  • Email keeps working if mail is not hosted on the same server you are leaving
Inventory (do this first)

Write down:
  1. All hostnames in use ([font=monospace]example.com[/font], [font=monospace]www[/font], staging names, CDN CNAMEs).
  2. Where email lives (Google Workspace, Microsoft 365, the same cPanel box, etc.).
  3. Current TTL on the A/AAAA records you will change (if TTL is 86400, lower it to 300–600 a day before cutover).
  4. PHP version and required extensions on the source.
  5. Cron jobs, [font=monospace].env[/font] / config paths, and scheduled backups.
Phase A — Build the site on the destination (DNS still old)
  1. Create the web space and database on the new host.
  2. Copy files (SFTP, rsync, or host migration tool). Preserve permissions for writable dirs ([font=monospace]uploads[/font], [font=monospace]cache[/font], [font=monospace]storage[/font]).
  3. Export the database from the source ([font=monospace]mysqldump[/font] or panel export) and import on the destination.
  4. Update application config:
  • DB host/name/user/password
  • Any hard-coded old paths
  1. For WordPress, run a controlled search-replace for URLs if the temporary test URL differs (WP-CLI [font=monospace]search-replace[/font] with extras serialization support—not raw SQL replace on PHP serialized data).
  2. Test using a hosts file override or host-provided preview URL so the public DNS remains unchanged.
Phase B — Pre-flight checks on destination
  • Home page and one deep inner page load
  • Admin/login works
  • Forms send (or at least submit without 500)
  • HTTPS certificate issues resolved on the new stack (or plan HTTP→HTTPS after cert issuance)
  • File uploads to media/storage succeed
  • No mixed content on a sample page (browser dev tools console)
Phase C — DNS cutover (website only)

Typical website-only change:

Record — Action
`A` / `AAAA` for `@` — Point to **new** web server IP
`www` CNAME or A — Match new hosting docs
`MX` — **Do not touch** if email is external
TXT SPF/DKIM/DMARC — Leave alone unless mail is also moving
CDN — Update origin IP/hostname per CDN dashboard

After change:
  1. Query from multiple resolvers ([font=monospace]dig[/font] + a public DNS checker).
  2. Expect mixed results until TTL expires.
  3. Keep the old host read-only for a soak period if you can (hours to a few days) in case you must roll back the A record.
Phase D — Post-cutover
  1. Force HTTPS if certificates are live.
  2. Update sitemap/Search Console property if the host or property verification method changed.
  3. Purge CDN.
  4. Re-test cron (hosting cron vs application cron).
  5. Confirm backups now run on the new host.
  6. Only decommission the old host after you are sure nothing still points there (including API callbacks and payment webhooks).
WordPress-specific cutover notes
  • Sync [font=monospace]wp-config.php[/font] salts only if intentional; do not paste secrets into tickets.
  • Object cache (Redis/Memcached) must be re-pointed or disabled on the new host.
  • Multisite domain maps need explicit domain updates—do not treat like single-site.
  • If you use a reverse proxy, ensure real IP and HTTPS detection headers match what WordPress expects ([font=monospace]HTTPS[/font] / [font=monospace]X-Forwarded-Proto[/font] handling).
Common failure patterns

Symptom after cutover — Check
Old site still appears — TTL/cache/CDN; confirm dig for your public IP
DB connection error — Config credentials; remote DB host firewall
Redirect loop — HTTPS settings + proxy headers + canonical redirects
Missing images — Files not copied; wrong uploads path; hotlink to old host
Mail stopped — Someone changed MX/SPF while editing zone for web

Rollback

If the new site is broken in production:
  1. Point A/AAAA back to the old IP (if old host still has the last good copy).
  2. Fix on destination with hosts-file testing.
  3. Cut over again only after pre-flight passes.
Conclusion

Migrate content first, test privately, then move only the DNS records that belong to the website. Protect email records, keep a rollback window, and treat post-cutover HTTPS, cron, and backups as part of the job—not optional cleanup.
Post Reply