Database Migration Playbook (Cross-Engine)
Migrate a database between engines (SQL Server → Azure SQL or Postgres) with zero or minimal downtime, parity validation, and instant rollback.
Tell us what you're building
We use these answers to surface the prompts, skills, and MCP configs that fit your stack — and to substitute stack values like {{database}} into the prompts you copy. Content (PRDs, code, etc.) stays in your repo. Everything you enter here is stored in your browser — nothing is sent to a server.
Steps you'll go through
- 01
Schema Audit
1-2 weeksInventory every object in the source database — tables, procs, functions, triggers, jobs — plus app code that references the schema.
- 02
Translate the Schema
2-3 weeksMap every source object to a target equivalent — types, constraints, indexes, identity columns, computed columns.
- 03
Migrate Stored Procedures and Functions
4-8 weeks (depends on volume + complexity)Decide what to do with each proc — translate, rewrite in app code, downgrade to a view, or decommission. This is usually the longest phase.
- 04
Set Up Dual-Write or CDC
2-4 weeksKeep the target DB in sync with source as the migration progresses. Choose dual-write, CDC (Debezium / DMS), or trickle-batch based on downtime tolerance and tooling.
- 05
Backfill Historical Data
Hours to days (volume-dependent)Bulk-copy all historical data into target. The sync from Phase 4 keeps it current after this point.
- 06
Validate Parity
1-2 weeksVerify the target has the same data as the source — beyond just counts. Investigate any drift before cutover.
- 07
Cutover with Feature Flag
Maintenance window (minutes to hours)Switch apps from source to target. Feature-flag the connection per workload for zero-downtime ramp; or use a brief maintenance window.
- 08
Decommission the Source
30-90 days post-cutoverAfter 30+ days of zero source traffic, take the final backup, shut it down, decommission the infrastructure, write the retro.