migkit
Move, follow, prove and cut over databases between any two engines.
migkit's own decision engine finds the fastest, exact, consistent way for each source -> target pair. Universal database migration, replication, and mathematical verification across 64 database technologies.
How it works
Every migration passes through four predictable phases, from pre-flight safety checks to verified zero-downtime cutover:
| Phase | Command | Action | Operational guarantee |
|---|---|---|---|
| 1. Assess | migkit assess shop | Pre-flight audit of schemas, data types, sequences, and replication privileges. | Read-only on source. Flags incompatible constructs before moving data. |
| 2. Move & Stream | migkit sync shop --mode migrate --go | Snapshot table copy followed immediately by CDC change stream replication. | Point-in-time snapshot. O(1) resume from key-range cursor if interrupted. |
| 3. Verify | migkit check shop --deep | Injective per-row hash + Merkle diff drilldown + 20 semantic drift audits. | Never writes to either database. Detects silent corruption that count(*) misses. |
| 4. Cut over | migkit move shop --mode cdc --drop --go | Source writes drained, final stream sync drained, target sequences raised. | Atomic switchover within outage budget. Reverse stream armed for rollback. |
Quickstart
Install, configure, and execute a verified cutover in five commands:
# 1. Install via PyPI
uv tool install migkit
migkit doctor --install
# 2. Configure source, target and goal (passwords stored in keychain)
MIGKIT_SOURCE=postgres://app@db1.example.com/shop \
MIGKIT_TARGET=postgres://app@db2.example.com/shop \
MIGKIT_GOAL=cutover MIGKIT_HOP=shop migkit init
# 3. Run: snapshot copy + continuous change stream (CDC)
migkit sync shop --mode migrate --go
# 4. Prove: full row hash + deep semantic drift audit
migkit check shop --deep
# 5. Cut over: zero write loss, reverse stream ready
migkit move shop --mode cdc --drop --go
Click any parameter (shop, db1.example.com, full+cdc) to customize inline before copying. Detailed walkthrough: the quickstart guide.
Verification modes
Select the verification depth matching your operational maintenance window:
| Command / Mode | When to run | Scope & guarantees | Complexity |
|---|---|---|---|
migkit check shop | Pre-cutover sign-off | Schema structure, exact row counts, auto-increment sequences, and row hash blocks | O(all rows) resumable |
migkit check shop --deep | Catalog & semantic audit | Detects 20+ silent drift classes: NULL vs empty string, float precision, collation, unvalidated FKs, trigger status | O(1 fused scan) |
migkit watch shop --verify --delta | During CDC replication | Verifies primary keys modified in WAL/binlog since last checkpoint; gates SAFE TO CUT OVER | O(changed keys) |
migkit check shop --sample | Fast sanity check | Times a bounded random sample of keys across tables without scanning full data volume | O(budgeted seconds) |
scan (engine) | Internal query planner | Packs up to 512 SQL aggregates into 1 range scan per side to minimize DB load | Automatic in check |
Core guarantees
- Read-only on source: Source database is never modified unless explicit cutover is triggered.
- O(1) Resumability: Checkpoints saved at key range cursor level; recovery skips completed rows in O(1) without re-scanning.
- Zero silent corruption: Catches truncated LOBs, float precision errors, collation fold duplicates, and timezone shifts that pass naive row counts.
- Guaranteed reversibility: Reverse stream back to old source is armed and ready from the second of cutover.
Explore by topic
| Category | Documentation | Description |
|---|---|---|
| Getting started | Quickstart<br>Recipes | Step-by-step setup and 10 common source -> target pairing recipes. |
| Reference | Engines (64)<br>Goals & Modes<br>Commands<br>Hop Options<br>Environment | Engine catalog, CLI flags, configuration options, and environment variables. |
| Operations | Troubleshooting<br>Evidence<br>Web & API<br>Telemetry<br>Releases | Diagnostic bundles, evidence exports, multi-user web UI, and privacy guarantees. |