Loading...
Loading...
Guide for using molt verify to compare source and target databases for schema and row-level consistency after a migration. Use when running verify commands, tuning concurrency/sharding, handling schema mismatches, or validating data integrity post-migration.
npx skill4agent add cockroachlabs/cockroachdb-skills molt-verifymolt fetchmolt verify \
--source "<source-conn>" \
--target "<crdb-conn>" \
[options]--rows=true| Mode | Command | Use When |
|---|---|---|
| Full (default) | | Post-migration integrity check |
| Schema-only | | Fast DDL check; no data I/O |
| Compile-only | | Validate flag syntax without connecting |
# Default: CPU-count tables in parallel, 1 shard/table, 20k rows/batch
molt verify --source "..." --target "..."
# Large tables: parallelize within a single table
molt verify --source "..." --target "..." \
--concurrency 1 --concurrency-per-table 8 --row-batch-size 50000
# Rate-limited (minimize production impact)
molt verify --source "..." --target "..." \
--rows-per-second 1000 --concurrency 2molt verify \
--source "postgresql://user:pass@pg:5432/db" \
--target "postgresql://root@crdb:26257/db"molt verify \
--source "..." --target "..." \
--rows=false --non-interactive --log-file stdoutmolt verify \
--source "..." --target "..." \
--table-filter "customers|orders"# transformations.json: {"tables":[{"name":"users","excludedColumns":["temp_col"]}]}
molt verify \
--source "..." --target "..." \
--transformations-file transformations.jsonmolt verify --source "..." --target "..." --compile-only
# Returns: {"status":"ok","message":"arguments parsed successfully"}ONLY_FULL_GROUP_BYCGO_ENABLED=1 -tags="cgo source_all"LD_LIBRARY_PATH--source-cdb--filter-pathtruth rows seen: 10000, success: 9950, missing: 5, mismatch: 45, extraneous: 0--metrics-listen-addrlocalhost:8888| Error | Cause | Fix |
|---|---|---|
| Table not migrated | Rerun fetch or check filters |
| Unexpected table | Clean up or adjust |
| Type conversion issue | Check type mappings or use |
| PK structure differs | Inspect schema conversion output |
| Source has partition tables | Drop/move partitions before verifying |
| No PK on source table | Add PK or use |
| Insecure connection rejected | Add |
| Statement timeout | Query exceeds | Increase timeout or reduce |
--concurrency--filter-path--show-connection-logging