How would you handle data migration from an old legacy system to a new system?
Instruction: Describe the process and considerations for successfully migrating data from an old system to a new one.
Updated
Official answer
Inventory source schemas, semantics, dependencies and consumers. Agree on acceptable downtime, recovery objectives and how to validate equivalence. Map types, keys, time zones, collations, NULLs and business rules explicitly; do not silently clean or discard records during migration.
Rehearse a consistent snapshot plus a supported change-capture process when writes must continue. Preserve source identity and change order, apply retries idempotently, and reconcile updates and deletes. A snapshot started without a coordinated change position can miss or double-apply changes.
During cutover, establish one authoritative write path. Drain or stop writes as required, apply the remaining changes to a known boundary, reconcile, switch consumers and monitor errors and lag. Uncoordinated dual writes to both systems are not a safe default.
Define rollback before starting: after new writes reach the target, switching back to an old snapshot loses them unless a tested reverse/reconciliation path exists. Keep recoverable backups and migration evidence. Test row-level samples, aggregate totals, constraints, application behavior and permissions, then retire the old system only after the agreed observation and retention period.