Back to blog

Blog

Database Migration Checklist: Plan, Cut Over, Roll Back

A database migration checklist for planning, CDC sync, validation, cutover and rollback, plus the pg_dump and AWS DMS gotchas that bite teams at 2 a.m.

database migration checklistUpdated 11/19/2026Shafi Khan

Database Migration Checklist: Plan, Cut Over, Roll Back

A database migration checklist is a sequenced list of checks across five phases: discover what you actually have, choose a strategy and data-movement method, sync and validate the target, cut over in a timed window, and keep a rollback you have actually rehearsed. Most migrations don't fail on the copy. They fail on the stuff nobody wrote down: the forgotten cron job with a hardcoded host, the sequence stuck at 1, the trigger that fired twice.

This post is the checklist we wish every team had taped to the monitor before migration night. It leans on the official AWS DMS and PostgreSQL docs, and every phase ends with boxes to tick.

Why database migration planning goes sideways

Database migration planning usually starts with the wrong question: "how do we copy the data?" Copying is the easy part. Tools for that have existed for decades.

The hard questions are about everything around the data:

  • Who connects to this thing? Apps, BI tools, a reporting script on someone's laptop, a partner's nightly SFTP import job that reads from a view.
  • What lives inside it that isn't a table? Triggers, stored procedures, scheduled jobs, users and grants, extensions.
  • How much can the business tolerate? Minutes of downtime? Zero lost writes? Those two answers decide your entire approach.

If you can't answer those on day one, you're not migrating a database, you're migrating a mystery. Fix that first.

→ Put your recovery targets in writing with the free RTO/RPO calculator

Phase 1: Discovery checklist (know what you're moving)

Start with an honest inventory. The schema diagram in the wiki from 2023 doesn't count.

  • Export the current schema DDL from production, not from a migrations folder that may have drifted.
  • Visualize the schema and confirm table relationships, foreign keys and orphaned tables with the people who own them.
  • List every non-table object: views, triggers, stored procedures, functions, sequences, extensions, scheduled jobs.
  • List every user, role and grant, plus which application uses which credential.
  • Map every consumer: services, batch jobs, BI dashboards, ETL pipelines, replicas and anything reading via a linked server or foreign data wrapper.
  • Measure size per table, largest LOB/BLOB columns, and growth rate.
  • Measure the write rate and log generation per hour on the source. AWS's DMS best practices explicitly call out identifying "the rate of change and archive log generation per hour" before you plan replication.
  • Record current p95 latency for the top 10 queries so you have a baseline to compare against after cutover.

A fast way to make the inventory reviewable: turn the DDL into a diagram people can actually argue about. If you're starting from raw SQL, the walkthrough in how to create an ER diagram from SQL covers that end to end, and DB Visualizer lets you import SQL, inspect relationships, refine the schema with AI chat and export DBML or PDF for the review pack.

→ Map the current schema visually in DB Visualizer before anyone touches it

Phase 2: Pick a database migration strategy

Your database migration strategy is two decisions stacked on top of each other: where the database lands, and how the data gets there.

Where it lands: rehost, replatform or re-architect

AWS Prescriptive Guidance frames database moves in three strategies, and they generalize well beyond SQL Server:

StrategyWhat changesExample from AWS guidanceTypeEffort and risk
RehostHosting only; engine and config staySQL Server on-prem to SQL Server on EC2HomogeneousLowest
ReplatformMove to a managed service, same engineSQL Server to Amazon RDS for SQL ServerHomogeneousLow to medium
Re-architect (refactor)Engine, schema and often app codeSQL Server to Aurora PostgreSQLHeterogeneousHighest

Hot take: don't combine a re-architect with a data-center exit deadline unless you enjoy pain. Changing engines means rewriting stored procedures, re-testing every query plan and retraining on-call. Do it when the payoff is real, not because the migration "was already happening anyway."

How the data moves: offline vs full load plus CDC

MethodHow it worksDowntimeBest for
Offline dump and restoreStop writes, dump, restore, switchWhole copy durationSmall databases, generous maintenance windows
Full load plus CDCCopy existing data, then stream ongoing changes until cutoverOnly the final cutover windowLarge or busy databases
CDC onlyTarget pre-seeded (for example from a backup), stream changes from a known pointOnly the final cutover windowVery large datasets seeded out of band

AWS DMS supports both full load plus CDC and CDC-only tasks. CDC needs source-side prep, and AWS's own examples are worth reading carefully: Oracle requires supplemental logging, and MySQL requires row-level binary logging. If those aren't enabled, you'll find out the hard way.

One honest caveat straight from the DMS docs: CDC "does not provide real-time replication," and AWS offers no SLA for replication latency. If your plan depends on sub-second lag, design for it explicitly rather than assuming it.

→ Price the target environment before you commit with Cost Estimator

Phase 3: Build and load the target

This is where the classic copy mistakes happen. Checklist:

  • Create the target schema first. If the engine stays the same, native tools (pg_dump, MySQL Workbench, SQL Developer) are fine; for an engine change, AWS points to DMS Schema Conversion.
  • Don't assume the tool brings everything. The DMS best practices state that DMS does basic schema migration (tables and primary keys) but "doesn't automatically create secondary indexes, foreign keys, user accounts, and so on."
  • For a full-load-only task, drop or delay secondary indexes, constraints and DML triggers until after the load, per the same guidance.
  • For full load plus CDC, add the secondary indexes that support updates and deletes before the CDC phase, so replicated changes don't trigger full table scans.
  • Keep referential integrity constraints and triggers off during replication and enable triggers right before cutover. Otherwise a trigger can fire on the target for a change that already includes its side effects.
  • Check LOB handling. DMS requires LOB columns on the target to be nullable during migration, and limited LOB mode needs a Max LOB size at least as large as your biggest LOB.
  • Size the target from real numbers (storage growth, IOPS, connections), not vibes.

For a homogeneous PostgreSQL move, a parallel dump and restore is often the simplest path for the initial copy:

# Directory format is the only pg_dump format that supports parallel jobs (-j).
# pg_dump opens njobs + 1 connections, so check max_connections first.
pg_dump -h old-db.internal -U migrator -d app -Fd -j 8 -f /data/app_dump

# pg_restore supports -j with custom or directory archives.
# -O skips ownership commands, so a non-superuser can restore.
pg_restore -h new-db.internal -U migrator -d app -j 8 -O /data/app_dump

Both behaviours come straight from the pg_dump documentation: pg_dump produces a consistent export even while the database is in use, and the directory format is the only one that supports parallel dumps. Run a small test migration first and time it; DMS guidance recommends the same thing so you can benchmark before the real run.

→ Size storage, IOPS and growth for the new target with the Database Capacity Planner

Phase 4: Database migration validation

"The job finished with no errors" is not validation. Treat validation as its own workstream with its own sign-off.

Layer 1: Schema parity

Diff the source and target DDL. Look for missing indexes, changed column types (hello, timestamp vs timestamptz), missing defaults and dropped constraints. The schema diff checker flags adds, drops and column modifications between two DDL or DBML inputs.

Layer 2: Row counts and checksums

Counts catch missing chunks. Checksums catch silent corruption and encoding issues. In PostgreSQL, a chunked hash per key range keeps the query cheap enough to run repeatedly:

-- Run the same query on source and target, then compare the two results.
SELECT
  count(*) AS row_count,
  md5(string_agg(o::text, '|' ORDER BY o.id)) AS content_hash
FROM orders AS o
WHERE o.id BETWEEN 1 AND 1000000;

This works for like-for-like PostgreSQL moves; run both sides with the same TimeZone and DateStyle settings, because the text form of timestamps depends on them. Run it per range so a mismatch tells you where to look instead of "somewhere in 400 GB." If you use AWS DMS, turn on its data validation, which AWS "highly recommends" and which starts comparing source and target as soon as each table's full load completes.

Layer 3: Application-level checks

  • Replay your top queries on the target and compare results and latency against the Phase 1 baseline.
  • Run the app's integration test suite against the target.
  • Have a business owner verify a handful of known records (a real order, a real invoice) by hand.

→ Diff source and target DDL in seconds with the free Schema Diff Checker

Phase 5: The database cutover plan

A database cutover plan is a timed runbook, written in advance, with owners and a go/no-go per step. Here's a solid default for a full load plus CDC migration:

T-minusStepOwnerGo/no-go check
T-7 daysDress rehearsal on a staging copy, timed end to endDB leadRehearsal fits the window with margin
T-24 hFreeze schema changes on the sourceEng managerNo pending migrations in flight
T-1 hConfirm replication lag is near zero and validation is cleanDB leadLag and mismatch counts within agreed limits
T-0Put app in maintenance or read-only mode; stop writesApp on-callWrite traffic at zero on source
T+5 minLet CDC drain, final counts and checksumsDB leadCounts and hashes match
T+10 minReset sequences, enable triggers and constraintsDB leadTest insert succeeds
T+15 minFlip connection strings or DNS; restart poolsPlatformApps connected to target only
T+20 minSmoke tests and key business transactionsQA / ownerAll pass
T+30 minOpen writes; declare point of no return or roll backIncident leadError rate and latency normal

That sequence reset step is the one that bites people. PostgreSQL's docs are blunt: with logical replication, "sequence data is not replicated". Rows arrive with their IDs, but the sequence still sits at its start value. First insert after cutover? Duplicate key. Fix it before you open writes:

-- Repeat for each sequence-backed column.
SELECT setval(
  pg_get_serial_sequence('orders', 'id'),
  (SELECT COALESCE(max(id), 1) FROM orders)
);

Also: lower DNS TTLs days ahead if you flip by DNS, and remember that connection pools hold old connections until they're recycled.

→ Turn this cutover table into a shareable runbook with the Incident Runbook Template Builder

Phase 6: The database migration rollback plan

Every migration has a point of no return: the moment new writes land on the target and aren't on the source. Before that point, rollback is "flip the connection string back." After it, rollback means moving data in reverse, which is a whole migration of its own.

Your database migration rollback plan should state, in writing:

  • The point of no return, as a specific step in the cutover table.
  • Rollback triggers: concrete thresholds (error rate, p95 latency, failed smoke test) that mean "roll back," decided before the night, not during it.
  • The rollback procedure, rehearsed at least once, with timings.
  • What happens to writes made on the target if you roll back after opening writes. Options are reverse replication, a reconciliation script, or accepting a documented data-loss window. Pick one consciously.
  • How long the source stays intact (read-only, not deleted) after cutover. Weeks, not hours.

If your rollback plan is "we'll figure it out," you don't have one. The failover paths best practices guide is a useful companion for thinking through which direction traffic can actually go.

→ Compare current-state and target-state architecture side by side with Architecture Diff

The one-page database migration checklist

Copy this into your ticket and don't skip rows:

PhaseMust be true before moving on
DiscoverSchema, non-table objects, users, consumers, sizes and write rate all documented
StrategyRehost / replatform / re-architect chosen; offline vs CDC chosen; RTO and RPO agreed
Build and loadTarget schema created; indexes, FKs, users, grants added; test migration timed
ValidateSchema diff clean; counts and checksums match per range; app tests pass
CutoverTimed runbook with owners; dress rehearsal done; sequences and triggers handled
RollbackPoint of no return defined; triggers agreed; rollback rehearsed; source retained

For the safety side of schema changes that ship after the migration, the migration safety best practices guide is the natural next read.

→ Grab a structured plan with the data migration template guide

Key takeaways

  • Copying data is the easy part. Discovery (consumers, non-table objects, write rate) is where migrations are won or lost.
  • Choose two things explicitly: where the database lands (rehost, replatform, re-architect) and how data moves (offline or full load plus CDC).
  • Don't trust the tool to bring everything. DMS doesn't create secondary indexes, foreign keys or users for you.
  • Validate in layers: schema diff, counts and checksums per key range, then real application queries.
  • Reset sequences and enable triggers as explicit cutover steps.
  • Define the point of no return and rehearse rollback before migration night.

→ Start free and map your migration in Architecto

FAQ

What should a database migration checklist include?

At minimum: an inventory of every schema object and every application that connects to the database, a chosen migration strategy (rehost, replatform or re-architect), a data movement method (offline dump and restore or full load plus change data capture), a validation plan with row counts and checksums, a timed cutover runbook, and a rollback plan with an explicit point of no return.

How do you plan a database migration with minimal downtime?

Copy the existing data with a full load, keep the target in sync with change data capture (CDC) while the source stays live, validate the target continuously, then cut over in a short window where you stop writes, let replication drain, fix sequences, flip connection strings and smoke test. Downtime becomes the length of that final window instead of the length of the whole copy.

What is the difference between rehost, replatform and re-architect for databases?

AWS Prescriptive Guidance describes rehost as moving the database as is, for example SQL Server onto Amazon EC2; replatform as moving to a fully managed offering of the same engine, such as Amazon RDS for SQL Server; and re-architect (refactor) as changing engine and design to use cloud-native features, such as SQL Server to Aurora PostgreSQL. The first two are homogeneous migrations, the third is heterogeneous.

How do you validate data after a database migration?

Compare row counts per table, then compare checksums or hashes of table contents in key ranges, then run the application's own critical queries against both sides and diff the results. If you use AWS DMS, its data validation feature compares source and target after each table's full load completes.

Why do IDs collide after migrating PostgreSQL with logical replication?

PostgreSQL's documentation states that sequence data is not replicated by logical replication. Rows arrive with their IDs, but the sequence on the subscriber still shows its start value, so new inserts after cutover can collide. Reset each sequence to the current maximum before you open the target for writes.

→ See how DB Visualizer supports schema review and migration planning

Ship the migration, not the mystery

The teams that sleep through migration night aren't luckier. They wrote down what they had, picked a strategy on purpose, validated in layers and rehearsed the way back. Get the schema on a shared canvas first and the rest of this checklist gets dramatically easier.

→ Start free with Architecto and open your schema in DB Visualizer

FAQ

Questions readers ask before they act on this page.

What should a database migration checklist include?

At minimum: an inventory of every schema object and every application that connects to the database, a chosen migration strategy (rehost, replatform or re-architect), a data movement method (offline dump and restore or full load plus change data capture), a validation plan with row counts and checksums, a timed cutover runbook, and a rollback plan with an explicit point of no return.

How do you plan a database migration with minimal downtime?

Copy the existing data with a full load, keep the target in sync with change data capture (CDC) while the source stays live, validate the target continuously, then cut over in a short window where you stop writes, let replication drain, fix sequences, flip connection strings and smoke test. Downtime becomes the length of that final window instead of the length of the whole copy.

What is the difference between rehost, replatform and re-architect for databases?

AWS Prescriptive Guidance describes rehost as moving the database as is, for example SQL Server onto Amazon EC2; replatform as moving to a fully managed offering of the same engine, such as Amazon RDS for SQL Server; and re-architect (refactor) as changing engine and design to use cloud-native features, such as SQL Server to Aurora PostgreSQL. The first two are homogeneous migrations, the third is heterogeneous.

How do you validate data after a database migration?

Compare row counts per table, then compare checksums or hashes of table contents in key ranges, then run the application's own critical queries against both sides and diff the results. If you use AWS DMS, its data validation feature compares source and target after each table's full load completes.

Why do IDs collide after migrating PostgreSQL with logical replication?

PostgreSQL's documentation states that sequence data is not replicated by logical replication. Rows arrive with their IDs, but the sequence on the subscriber still shows its start value, so new inserts after cutover can collide. Reset each sequence to the current maximum before you open the target for writes.

Related reading

Keep moving through the architecture workflow.

Free tool

Schema Diff Checker

Detect adds, drops, and column modifications across DDL or DBML inputs so reviews focus on actual risk instead of guesswork.

database schema diffddl comparison toolschema change review

Free tool

RTO / RPO Calculator

Estimate recovery time and recovery point objectives with transparent assumptions your engineering and business teams can review together.

disaster recovery calculatorrecovery objective plannerbcdr planning tool

Free tool

Database Capacity Planner

Estimate table growth, index amplification, backup retention, and IOPS needs before a production database becomes a fire drill.

database sizing calculatorstorage growth plannerpostgres mysql capacity planning

Guide

Database Design best practices for migration safety

Database Design best practices for migration safety with technical review guidance, practical artifacts, and a workflow path into diagrams, documentation, and architecture governance.

database designmigration safetydatabase schema design

Guide

data migration checklist for Hybrid, Multi-Cloud, and Migration

data migration checklist for Hybrid, Multi-Cloud, and Migration with technical review guidance, practical artifacts, and a workflow path into diagrams, documentation, and architecture governance.

hybrid cloud migration architecturedata migrationmulti cloud migration plan

Comparison

Best dbdiagram alternative for database design

Best dbdiagram alternative for database design with a workflow-first comparison across diagrams, architecture review, technical documentation, and code-adjacent implementation evidence.

dbdiagram alternativearchitecto vs dbdiagramdatabase design tool alternative
Database Migration Checklist: Plan, Cut Over, Roll Back | Architecto