data-migration-testing
Installation
SKILL.md
Data & Schema Migration Testing
Migrations are one-way doors with production data. Rehearse on production-shaped data, prove reconciliation, and always have a tested rollback.
Plan → rehearse → cut over → verify
- Inventory & mapping: source→target field map (type, transform, default, null rule); document lossy conversions & retired fields.
- Profile source: row counts, null rates, distinct counts, min/max lengths, orphan FKs, duplicates, bad encodings. Fix or explicitly map anomalies before load.
- Rehearse ≥2 times on a masked prod copy: measure duration, lock time, resource use; extrapolate to cutover window.
- Reconcile (automated):
- Counts per table/partition, sum/avg of numeric columns, min/max dates.
- Row-level hash compare (
md5(concat_ws('|', cols))) or sampled diff; keys present in one side only. - Referential integrity, unique constraints, sequences/identity next values.
- Business checks (e.g., open invoices total, active users).
- Functional smoke on migrated data through the real app (login, search, reports, exports, APIs).
- Rollback rehearsal: restore/reverse and re-verify; know the point of no return.
- Cutover runbook with owners, time-stamps, go/no-go gates, comms; freeze writes or use CDC to close the delta.
- Post-cutover: monitor errors, slow queries, data-mismatch alerts; keep source read-only for N days.