Skip to main content
Private Preview·Early access by invitation.Request access →
Kirimana.
Docs · CLI reference

CLI · Migration

kiri migrate covers the path from a legacy warehouse to a contract-governed Databricks platform: analyse the source system, translate its logic, gate the target infrastructure, and reconcile the migrated data against the source.

kiri migrate analyze

Introspect the legacy source system and write sources/*.yml for everything it finds.

Usage: kiri migrate analyze [OPTIONS]
FlagDescriptionDefault
--project, -pProject directory
--source-targetNamed legacy-source target profile in kiri.yml
--output, -oWhere to write the generated sources YAML
--ownerOwner email for the generated source
--domainDomain tag for the generated sourcemigration

kiri migrate sp

Classify and translate one legacy stored procedure into Spark SQL artefacts.

Usage: kiri migrate sp --procedure <schema.name> [OPTIONS]
FlagDescription
--procedureFully qualified procedure name, e.g. dbo.usp_LoadShifts (required)
--source-targetNamed legacy-source target profile in kiri.yml (the source database)
--output, -oWrite the translated artefact to a file

Additional source-system-specific migration verbs (including the standalone deterministic SQL-dialect translators and legacy-metadata importers) are documented in the product repo.

kiri migrate lint-models

Apply the 5-layer medallion layer-policy lint to a migrated dbt model tree.

Usage: kiri migrate lint-models [--models <dir>]

Checks that each model sits in the right layer and only references layers it is allowed to — the guard-rail that keeps a lifted-and-shifted model tree from re-growing legacy spaghetti.

kiri migrate verify

Run Databricks pre-deploy infrastructure checks before the first apply.

Usage: kiri migrate verify [OPTIONS]
FlagDescription
--target, -tNamed profile from kiri.yml
--catalogOverride catalog (defaults to profile.catalog)
--landing-urlADLS Gen2 landing URL to verify the external location for

kiri migrate verify-names

Verbatim name-preservation gate: asserts that migrated table and column names match the contract exactly.

Usage: kiri migrate verify-names --contract <yml> --schema <live-schema> [OPTIONS]

--catalog labels the live catalog (defaults to profile.catalog); the JSON report goes to --output or stdout. Run this per contract in CI during the migration window — silent renames are the classic parity killer.

kiri migrate emit-fk-ddl

Emit foreign-key constraint DDL for every declared FK in the project, so informational constraints survive the move to the target platform.

kiri migrate emit-fk-ddl --target prod -o fk_constraints.sql

kiri reconcile

Post-migration data validation: source vs target, table by table.

Usage: kiri reconcile [OPTIONS]
FlagDescriptionDefault
--source-targetLegacy-source profile in kiri.yml
--target-targetDatabricks profile in kiri.ymldatabricks
--source-table / --target-tableFully-qualified tables to compare
--primary-keyComma-separated PK column list
--columnsColumns for the null-rate check
--date-columnsDATE/TIMESTAMP columns for bounds checks
--business-keySCD2 business-key columns
--effective-from / --effective-toSCD2 effectivity columns
--attribute-columnsFull-row fingerprint columns (default: --columns)
--source-snapshot-idObserved source frozen-batch snapshot id
--report-modefull | locked — LOCKED omits raw values from the report
--pk-modeOverride reconcile.pk_check_mode: full | sample | spot
--sample-sizeOverride reconcile.pk_sample_size (0 = use config)0
--formatjson | markdownjson
--output, -oOverall report path; per-table reports land in --reports-dir (default <project>/reconciliation)
--write-apply-log / --no-apply-logWrite an _kiri_apply_log row via the target adapter (best-effort; never blocks the report)on

The check families cover row counts, PK presence, null rates, date bounds, SCD2 effectivity, and full-row fingerprints. LOCKED reports are the artefact bound into cutover approvals: kiri approve consume-reconcile consumes a use-once approval token against a specific LOCKED reconcile report, optionally pinned to --environment and --snapshot-id (see the releases page).

A typical cutover sequence

kiri migrate analyze --source-target legacy          # inventory the source
kiri migrate verify --target prod                    # gate the Databricks side
kiri apply --target prod                             # build the new platform
kiri migrate verify-names --contract contracts/…     # names survived verbatim
kiri reconcile --source-table --target-table \
  --primary-key id --report-mode locked -o report.json
kiri approve consume-reconcile --token --report report.json
Updated 5 July 2026 · v1.0.0-beta.1