Recipes
Use cases as source -> target pairs, each from two addresses.
Each recipe is one source -> target pair, from two addresses; for each, migkit's own decision engine finds the fastest, exact, consistent way. The hops below are checked against the configuration's own registry, and each capability a recipe leans on against what the code does - a recipe this version cannot do is not on this page.
Verification modes across recipes:
| Command / Mode | When to use | Guarantees | Complexity |
|---|---|---|---|
migkit check <hop> | Full battery before cutover | Schema, row counts, auto-increment sequences, and data hash blocks | O(all rows) resumable |
migkit check <hop> --deep | Catalog & semantic audit | Audits 20+ silent drift classes: NULL vs empty string, float precision, collation, unvalidated FKs, trigger status | O(1 fused scan) |
migkit watch <hop> --verify --delta | Active CDC replication | Verifies primary keys modified in WAL/binlog since last checkpoint; gates cutover readiness | O(changed keys) |
migkit check <hop> --sample | Fast pre-cutover sanity check | Times a bounded random sample of keys across tables without scanning the full volume | O(budgeted seconds) |
- A managed PostgreSQL on one cloud to a managed PostgreSQL on another
- MySQL on servers of your own to a managed MySQL, the cutover run by migkit
- Oracle to PostgreSQL, with its stored code proved
- SQL Server to PostgreSQL, followed until the switch
- PostgreSQL to a newer major version of PostgreSQL
- MongoDB to MongoDB, with a way back ready at the switch
- Two databases proved to hold the same, nothing written to either
- What a cloud's migration service moved, proved table by table, and only that
- Production to a staging database, as a masked subset
- A rehearsal on a copy, and the real run forecast from it
A managed PostgreSQL on one cloud to a managed PostgreSQL on another
The same engine on both sides and a different cloud under each. The application keeps writing to the source while the copy runs and its changes follow; the switch waits until the two are proved equal, and a stream back is ready from the moment of it.
PostgreSQL -> PostgreSQL. The hop, in conf/hops.yaml - two addresses and what it is for; the passwords are kept by migkit init, never in the file:
hops:
shop:
goal: cutover
source: postgres://app@db1.example.com:5432/shop?sslmode=verify-full
target: postgres://app@db2.example.com:5432/shop?sslmode=verify-full
What migkit init and every dry run say of it:
- goal cutover: move, follow the source's changes, prove both equal, and switch with the least downtime - a stream back ready from the moment of the switch
- on the source: read, and its log of changes followed from a position taken before the copy - the stream's own slot and publication on PostgreSQL, its binary log read on MySQL, a change stream on MongoDB - made by the stream and dropped when it is torn down; nothing else is written to it unless the hop turns cutover: on, and then only during the cutover
- on the target: filled as a copy fills it, then kept level with the source change by change; kept from the application's writes until the cutover where the engine allows it (protect_target); after it, a stream back from it to the old source (reverse: at_cutover)
- it guarantees: no change lost between the copy and the stream (the position is taken before the copy); each cycle's changes compared (watch --verify --delta); the stream torn down only once nothing writes to the source and the stream has passed where it stands
- cutover: off - the goal does not turn it on; at the cutover migkit writes nothing to the source, and the operator does this by hand, in order (the steps)
The commands, in order - one that writes shows its plan until it is given --go:
migkit sync shop --mode migrate
migkit sync shop --mode migrate --go
migkit watch shop
migkit move shop --mode cdc --drop --go
migkit check shop
What it leans on, each done by the code for this pair: carrying sequences and auto-increment values; copying table by table, resumably; keeping the target following the source; proving the target has caught up before cutover; carrying users and their grants.
MySQL on servers of your own to a managed MySQL, the cutover run by migkit
The cutover as one timed path: migkit holds the source's writes itself, waits for the stream to pass where the source stands, proves the two equal inside the outage, raises the target's counters, and undoes all of it if the budget passes.
MySQL -> MySQL. The hop, in conf/hops.yaml - two addresses and what it is for; the passwords are kept by migkit init, never in the file:
hops:
orders:
goal: cutover
source: mysql://app@10.0.0.5:3306/orders
target: mysql://app@db2.example.com:3306/orders
options:
cutover:
budget: 30
limits:
outage: 30
What migkit init and every dry run say of it:
- goal cutover: move, follow the source's changes, prove both equal, and switch with the least downtime - a stream back ready from the moment of the switch
- on the source: read, and its log of changes followed from a position taken before the copy - the stream's own slot and publication on PostgreSQL, its binary log read on MySQL, a change stream on MongoDB - made by the stream and dropped when it is torn down; nothing else is written to it unless the hop turns cutover: on, and then only during the cutover
- on the target: filled as a copy fills it, then kept level with the source change by change; kept from the application's writes until the cutover where the engine allows it (protect_target); after it, a stream back from it to the old source (reverse: at_cutover)
- it guarantees: no change lost between the copy and the stream (the position is taken before the copy); each cycle's changes compared (watch --verify --delta); the stream torn down only once nothing writes to the source and the stream has passed where it stands
- cutover: on - migkit runs the cutover itself, as one timed path (the steps)
The commands, in order - one that writes shows its plan until it is given --go:
migkit sync orders --mode migrate
migkit sync orders --mode migrate --go
migkit watch orders
migkit move orders --mode cdc --drop --go
cutover: the cutover as one timed path that freezes the source and undoes itself (migkit.cutover)limits: what the move may take at most, kept to as hard limits by its plan (LIMITS): source_load (the share of the source's reads, 0.3 or 30%), money (in the currency transfer_price_per_gb is in), bytes_billed (a warehouse's), outage (the cutover's write outage, seconds), replica_lag (seconds the source's replica may fall behind), target_memory and target_connections
What it leans on, each done by the code for this pair: carrying sequences and auto-increment values; copying table by table, resumably; keeping the target following the source; proving the target has caught up before cutover; telling a difference still arriving from one that is wrong.
Oracle to PostgreSQL, with its stored code proved
Two engines: the tables are built on the target in its own types, the rows copied and compared value by value in each engine's rendering, and every view, function, procedure and trigger converted by whichever way proves itself on it - run on both sides in a sandbox and compared, never trusted unrun.
Oracle Database -> PostgreSQL. The hop, in conf/hops.yaml - two addresses and what it is for; the passwords are kept by migkit init, never in the file:
hops:
erp:
goal: copy
source: oracle://app@db1.example.com:1521/ORCLPDB1/ERP
target: postgres://app@db2.example.com:5432/erp
options:
proof_sandbox: docker
What migkit init and every dry run say of it:
- goal copy: move the data once and prove every row arrived
- on the source: read, never written: each table read as of one moment where the engine gives one; a row the application changes while it is read is not carried, and the check names it
- on the target: the tables it lacks made, and filled with the source's rows, indexes built after them; a table that already holds rows is refused unless the hop says what to do with them (target_rows: refuse, replace or keep)
- it guarantees: every row compared after the copy (migkit check): equal, or each row that differs named
The commands, in order - one that writes shows its plan until it is given --go:
migkit move erp --mode full
migkit move erp --mode full --go
migkit check erp
proof_sandbox: the two scratch servers stored code, the constraints, the collations and the sized types are run and compared on, or docker for migkit to start them
What it leans on, each done by the code for this pair: comparing the data itself; carrying sequences and auto-increment values; copying table by table, resumably.
Stored code carried for this pair: view, function, procedure, trigger - each version, whoever wrote it, run on both sides in the sandbox and compared.
SQL Server to PostgreSQL, followed until the switch
A change of engine with the least downtime: the copy, then the source's changes carried as they happen, and the T-SQL procedures converted and proved beside them.
SQL Server -> PostgreSQL. The hop, in conf/hops.yaml - two addresses and what it is for; the passwords are kept by migkit init, never in the file:
hops:
crm:
goal: cutover
source: mssql://app@db1.example.com:1433/crm
target: postgres://app@db2.example.com:5432/crm
options:
proof_sandbox: docker
What migkit init and every dry run say of it:
- goal cutover: move, follow the source's changes, prove both equal, and switch with the least downtime - a stream back ready from the moment of the switch
- on the source: read, and its log of changes followed from a position taken before the copy - the stream's own slot and publication on PostgreSQL, its binary log read on MySQL, a change stream on MongoDB - made by the stream and dropped when it is torn down; nothing else is written to it unless the hop turns cutover: on, and then only during the cutover
- on the target: filled as a copy fills it, then kept level with the source change by change; kept from the application's writes until the cutover where the engine allows it (protect_target); after it, a stream back from it to the old source (reverse: at_cutover)
- it guarantees: no change lost between the copy and the stream (the position is taken before the copy); each cycle's changes compared (watch --verify --delta); the stream torn down only once nothing writes to the source and the stream has passed where it stands
- cutover: off - the goal does not turn it on; at the cutover migkit writes nothing to the source, and the operator does this by hand, in order (the steps)
The commands, in order - one that writes shows its plan until it is given --go:
migkit sync crm --mode migrate
migkit sync crm --mode migrate --go
migkit watch crm
migkit move crm --mode cdc --drop --go
proof_sandbox: the two scratch servers stored code, the constraints, the collations and the sized types are run and compared on, or docker for migkit to start them
What it leans on, each done by the code for this pair: copying table by table, resumably; keeping the target following the source; proving the target has caught up before cutover.
Stored code carried for this pair: view, function, procedure, trigger, event - each version, whoever wrote it, run on both sides in the sandbox and compared.
PostgreSQL to a newer major version of PostgreSQL
What the new version removes or changes is checked before anything is written; then the new server is filled and followed - or, where the hop allows it, a copy of the source's pages is upgraded there - and switched to.
PostgreSQL -> PostgreSQL. The hop, in conf/hops.yaml - two addresses and what it is for; the passwords are kept by migkit init, never in the file:
hops:
billing:
goal: upgrade
source: postgres://app@db1.example.com:5432/billing
target: postgres://app@db2.example.com:5432/billing
What migkit init and every dry run say of it:
- goal upgrade: the same engine at a newer version, a higher edition (SQL Server Web to Enterprise), or both, with the least downtime: what the new version or edition changes checked first, then the data moved into it and followed, or a copy of its pages taken to the target where the hop allows it - upgraded there where the version moves - and switched over
- on the source: read and followed as a cutover follows it; never upgraded where it runs - its downtime is the cutover's alone
- on the target: a server of the new version or edition filled and followed, or a copy of the source's pages taken there - SQL Server's own backup restored, MySQL's clone, PostgreSQL's pages - upgraded by the new version's own upgrade where the version moves, then followed from the copy's position
- it guarantees: what the new version removes or changes, and what the new edition lacks of what the source uses, said before anything is written; the source's own statements planned, timed and held to the same answers on both versions
The commands, in order - one that writes shows its plan until it is given --go:
migkit assess billing
migkit move billing --mode full+cdc
migkit move billing --mode full+cdc --go
migkit check billing
migkit move billing --mode cdc --drop --go
What it leans on, each done by the code for this pair: comparing server settings; copying table by table, resumably; keeping the target following the source.
MongoDB to MongoDB, with a way back ready at the switch
Collections copied and followed through the source's change stream; at the switch, the stream back to the old source starts, so going back loses nothing written since.
MongoDB -> MongoDB. The hop, in conf/hops.yaml - two addresses and what it is for; the passwords are kept by migkit init, never in the file:
hops:
catalog:
goal: cutover
source: mongodb://app@db1.example.com:27017/catalog
target: mongodb://app@db2.example.com:27017/catalog
What migkit init and every dry run say of it:
- goal cutover: move, follow the source's changes, prove both equal, and switch with the least downtime - a stream back ready from the moment of the switch
- on the source: read, and its log of changes followed from a position taken before the copy - the stream's own slot and publication on PostgreSQL, its binary log read on MySQL, a change stream on MongoDB - made by the stream and dropped when it is torn down; nothing else is written to it unless the hop turns cutover: on, and then only during the cutover
- on the target: filled as a copy fills it, then kept level with the source change by change; kept from the application's writes until the cutover where the engine allows it (protect_target); after it, a stream back from it to the old source (reverse: at_cutover)
- it guarantees: no change lost between the copy and the stream (the position is taken before the copy); each cycle's changes compared (watch --verify --delta); the stream torn down only once nothing writes to the source and the stream has passed where it stands
- cutover: off - the goal does not turn it on; at the cutover migkit writes nothing to the source, and the operator does this by hand, in order (the steps)
The commands, in order - one that writes shows its plan until it is given --go:
migkit sync catalog --mode migrate
migkit sync catalog --mode migrate --go
migkit watch catalog
migkit move catalog --mode cdc --drop --go
What it leans on, each done by the code for this pair: copying table by table, resumably; keeping the target following the source; proving the target has caught up before cutover; carrying users and their grants.
Two databases proved to hold the same, nothing written to either
After a move someone else made, or between a primary and a copy of it: every table and row that differs named, and nothing written anywhere.
MySQL -> PostgreSQL. The hop, in conf/hops.yaml - two addresses and what it is for; the passwords are kept by migkit init, never in the file:
hops:
proof:
goal: verify
source: mysql://app@db1.example.com:3306/shop
target: postgres://app@db2.example.com:5432/shop
What migkit init and every dry run say of it:
- goal verify: prove two databases hold the same; nothing is written to either
- on the source: read only
- on the target: read only
- it guarantees: equal, or every table and row that differs named; nothing written to either side
The commands, in order - one that writes shows its plan until it is given --go:
migkit check proof
migkit check proof --deep
What it leans on, each done by the code for this pair: comparing the data itself.
What a cloud's migration service moved, proved table by table, and only that
A service told to take some databases, schemas and tables - leaving its log tables behind, renaming one, filtering another's rows, taking some columns - is checked against exactly that: include names what it took, exclude what it was told to leave, mapping its renames, filters and columns. A table it never took is neither compared nor called missing, and the verdict says the scope it covers. Given the job's own file where it asks for the source, migkit init writes this hop from it, with every setting of the job that makes a correct move look different said beside it - and the changes it does not carry (mapping.ops) are the contract the check holds each table to. Given the service's own check report as compare_with, the evidence says table by table where its "consistent" falls short: what it called the same that differs, what it skipped, what it never checked.
MySQL -> MySQL. The hop, in conf/hops.yaml - two addresses and what it is for; the passwords are kept by migkit init, never in the file:
hops:
orders-moved:
goal: verify
source: mysql://app@db1.example.com:3306/billing,logistics
target: mysql://app@db2.example.com:3306/billing,logistics_new
include:
- billing.*
- logistics.orders
- logistics.parcels
exclude:
- billing.*_log
mapping:
tables:
logistics.parcels: parcel
where:
logistics.parcels: id > 10
columns:
logistics.orders:
keep:
- id
- status
- total
ops:
billing.payments:
- insert
- update
options:
compare_with: service-check-report.json
What migkit init and every dry run say of it:
- goal verify: prove two databases hold the same; nothing is written to either
- on the source: read only
- on the target: read only
- it guarantees: equal, or every table and row that differs named; nothing written to either side
The commands, in order - one that writes shows its plan until it is given --go:
migkit check orders-moved
migkit check orders-moved --deep
compare_with: another tool's own check of this move - a Tencent or Alibaba DTS data check's report, AWS DMS's table statistics - held table by table against migkit's answers in the evidence
What it leans on, each done by the code for this pair: comparing the data itself.
Production to a staging database, as a masked subset
The rows chosen and every row they refer to, masked where the hop says, so every reference in the copy resolves inside it.
PostgreSQL -> PostgreSQL. The hop, in conf/hops.yaml - two addresses and what it is for; the passwords are kept by migkit init, never in the file:
hops:
staging:
goal: subset
source: postgres://app@db1.example.com:5432/shop
target: postgres://app@staging.example.com:5432/shop
options:
subset:
start:
orders: 10%
children: true
mask:
- customers.email
What migkit init and every dry run say of it:
- goal subset: a copy for testing: the rows chosen and every row they refer to, masked where the hop says, into a staging or developer database, proved row by row
- on the source: read, never written: the rows chosen and those they refer to
- on the target: its tables in scope emptied and filled with the subset, masked on the way where the hop says
- it guarantees: every reference in the copy resolves inside it; every row as the source's, its masked columns as the rule writes them, none beyond the subset
The commands, in order - one that writes shows its plan until it is given --go:
migkit move staging --mode full
migkit move staging --mode full --go
migkit check staging
subset: goal subset: the rows a copy for testing starts from - start: {table: a condition, a share like 10% or a number of rows} - whether the rows that refer to them come too (children), and the most rows it may hold (most)mask: values reports show as salted hashes
What it leans on, each done by the code for this pair: comparing the data itself; copying table by table, resumably.
A rehearsal on a copy, and the real run forecast from it
The whole path on a copy of the source into a target of its own, every phase timed, so the real hop's plan is forecast from what was measured rather than guessed.
PostgreSQL -> PostgreSQL. The hop, in conf/hops.yaml - two addresses and what it is for; the passwords are kept by migkit init, never in the file:
hops:
shop-rehearsal:
goal: rehearse
source: postgres://app@copy.example.com:5432/shop
target: postgres://app@db3.example.com:5432/shop
options:
rehearses: shop
shop:
goal: cutover
source: postgres://app@db1.example.com:5432/shop
target: postgres://app@db2.example.com:5432/shop
What migkit init and every dry run say of it:
- goal rehearse: the whole path the real run will take - copy, follow, prove, cut over - on a copy or a sample of the source into a target of its own, every phase timed, so the hop it rehearses (rehearses:) is forecast from what it measured
- on the source: a copy or a sample of the real run's source, read and followed as a cutover follows it; written only by a cutover the hop turns on, as the real run's would be
- on the target: a target of its own, filled, followed and cut over to as the real run's will be; its own writes are timed there, rolled back
- it guarantees: every phase measured and kept for the real run's forecast; the two sides proved equal before the real run is allowed to start
The commands, in order - one that writes shows its plan until it is given --go:
migkit move shop-rehearsal --mode full+cdc --go
migkit check shop-rehearsal
migkit move shop-rehearsal --mode cdc --drop --go
migkit assess shop-rehearsal
rehearses: goal rehearse: the hop this one rehearses, whose plan is forecast from what this one measures - its name, or {hop, databases: {this hop's database: that hop's}}
What it leans on, each done by the code for this pair: copying table by table, resumably; keeping the target following the source.