A parallel-stack cutover keeps the source and the destination both serving traffic during the migration window. Done right, it removes the all-or-nothing pressure of a flip-the-switch event. Done wrong, you end up with two halves of the same application writing to two different databases, and reconciliation takes longer than the migration itself.
What’s happening
The trap is implicit state. The web tier looks stateless and migrates cleanly. The database is the obvious shared resource and gets thought through. What gets missed: session storage that lives in PHP files on disk, a write-cache for an analytics counter, the upload directory for user-generated images, a cron job that emits a daily report from one node. During the parallel window, half the requests hit the old stack and the other half hit the new — and any of these will silently diverge unless a single source of truth is enforced.
How to verify
Before opening the window, enumerate every writable surface:
find /var/www -type d -writable -not -path "*/cache/*"
crontab -l -u www-data
ls -la /var/lib/php/sessions/
mysql -e "SHOW PROCESSLIST" | grep -v Sleep
For each writable path, decide: is it shared (mounted from both stacks), is it one-way replicated, or is it owned by exactly one node? For each cron, decide which stack owns the schedule during the window. For each in-progress connection at the moment of cutover, decide whether it drains on the source or terminates and reconnects on the destination.
The fix
Pin writes to one stack at a time. Reads can be served from either, but the database, the session store, and the upload directory must have one authoritative writer for the duration of the window. The simplest pattern: keep the source as sole writer, point the destination’s writable paths at the source’s storage (NFS for files, the source’s MySQL for the database), validate the destination serves reads correctly, then flip the writer assignment as a single atomic change — typically by reconfiguring the destination’s database connection string and disabling the source’s web tier in the same minute.
Disable scheduled jobs on the destination until the writer flip completes. Drain in-flight connections on the source with a 30-second grace period before terminating. Keep the source warm and reachable for at least 24 hours after the flip — long enough to roll back without rebuilding state.
This is the operating model we use on cutovers with no tolerable downtime — see monitoring & support for what we watch during the window.