A zero-downtime hosting migration is an objective that requires application and data planning; it is not a guarantee created by changing DNS carefully. The difficult part is preserving correct writes, sessions, background jobs, and external callbacks while old and new environments may both receive traffic.
If your architecture cannot support overlapping environments safely, a short planned maintenance window may be the more reliable choice.
Inventory everything that moves
List web processes, databases, object storage, queues, scheduled jobs, secrets, domains, certificates, and webhook destinations. Include services that are easy to forget, such as password-reset links and outbound email configuration.
Separate application and database moves when possible
Moving compute while keeping the database stable can reduce simultaneous changes. Test latency and network access before choosing that approach.
If the database must move too, use a migration method appropriate to the engine and provider. PostgreSQL's logical replication documentation explains one available mechanism and its restrictions. Replication is not a complete cutover procedure by itself: schema changes, sequences, permissions, and non-replicated objects require explicit review.
Define the authoritative writer at every stage. Uncoordinated writes to two independent databases can create divergence that a DNS rollback cannot fix.
Rehearse with production-like behavior
Deploy the target environment behind a temporary hostname. Check authentication, uploads, emails, background processing, and callbacks using safe test data. Verify that the application generates the correct public URLs.
Use backward-compatible schema changes during overlap. Add new structures before depending on them, and remove old ones only after older application versions are no longer running.
Write down cutover criteria, responsible people, and rollback limits. A rollback is simple only until new writes make the old environment stale.
Cut over and observe
Reduce relevant DNS TTLs in advance where appropriate, but account for caches and persistent connections. Keep the old environment available for the planned overlap period without letting it run duplicate jobs.
Observe successful customer actions, error rates, latency, queue depth, and data reconciliation. Do not declare success solely because the homepage loads.
Frequently asked questions
Does lowering DNS TTL guarantee no downtime?
No. It affects one part of traffic movement and does not solve application compatibility or data consistency.
Can we roll back after accepting writes?
Only with a plan for those writes. Reverting traffic to a stale database can lose or hide customer changes.
When should the old host be removed?
After the observation period, reconciliation, and backup checks pass, and the rollback plan no longer needs it.
Compare destinations with our serverless hosting guide. Treat hosting discounts as a secondary consideration to a safe migration plan.