Checklists / database-migration
Database Migration Checklist
Change production data shape without downtime: expand, migrate, contract — and rehearse the backup restore.
9 steps · 9 required · last reviewed (next review 2027-03-19) · updated 2026-09-21
Related focus areas:DataOpsReleaseOpsSRE
Roadmaps covering the same ground:Incident Management MaturityObservability MaturityPlatform Engineering AdoptionProduction-Ready KubernetesResilience and DR ImprovementSRE Adoption
A bad migration is the most expensive class of failure in software operations: it can lose data, corrupt state, and take hours to notice. The expand/contract pattern (add the new, dual-write/backfill, then remove the old) runs through this whole list.
The rehearsal item is not paranoia. A backup you have never restored is a rumor.
Migration is reversible or forward-compatible (expand/contract; no destructive step in the same deploy)
requiredThe old code and the new code must both work against the new schema, or a failed app deploy becomes a failed schema change.
Migration runs against a production-sized copy first, with timing measured
requiredAn ALTER TABLE that takes 400ms in staging can lock a production table for 20 minutes — size, not syntax, decides.
Backup is taken AND a restore from it is rehearsed recently
requiredThe restore is the only part of a backup that matters; the migration window is exactly when you will need it.
Long-running migrations lock behavior is understood (lock_timeout set, big tables batched)
requiredA lock timeout turns a stuck migration into a failed one instead of a traffic outage.
Dual-write or backfill strategy exists for data movement
requiredData does not move itself; deciding dual-write vs backfill is deciding whether a crash mid-migration loses writes.
Application is deployed and verified BEFORE the contract (drop) step
requiredDropping the old column while the old code still reads it is an instant outage with a very obvious log line.
Migration runs inside the deploy pipeline, not a laptop session
requiredManual migrations are unrepeatable, unaudited, and run with whatever permissions the human has.
Rollback plan states explicitly whether data is recoverable
required'Restore from backup' loses everything since the backup; say so in writing before anyone clicks deploy.
Verification query proves the new shape (row counts, constraints, sample reads)
requiredA successful exit code says the migration ran, not that the data is right.
Run it against your real gaps
A checklist is most useful when you know which controls you are actually missing. A free OpsRoadmaps assessment scores your controls with explainable findings and builds a roadmap from the results.
Assess my stackChecklists document self-reported practice. Items were last reviewed 2026-09-19 — adapt them to your own environment.