autonomy-orchestrator migrate¶
Migrate data from SQLite to PostgreSQL (cpmigratedb)
Synopsis¶
Migrates all control-plane data from a SQLite source database to a
PostgreSQL target. The SQLite source is read-only during migration; no data
is modified or deleted from SQLite.
Migration order:
1. Apply PostgreSQL schema (idempotent).
2. Migrate releases and node_acks.
3. Migrate events: assign monotonic ingest_seq from SQLite rowid order;
set promotion_origin = 'legacy_pre_ha' on affected stages.
4. Migrate rollout_plans and stage_status.
5. Validate row counts.
6. Record HACutoverAt.
Use --dry-run to preview what would be migrated without writing any data.
Use --validate to check row counts only (skip data copy; implies data was
already migrated).
Rollback: stop the PostgreSQL CP nodes, revert config to backend=sqlite,
restart. The SQLite source is untouched and safe to roll back to.
Usage¶
autonomy-orchestrator migrate [flags]
Options¶
--batch-size int number of rows per INSERT batch (default 500)
--dry-run scan source and report counts without writing to PostgreSQL
--postgres-url string PostgreSQL connection URL (env: AUTONOMY_POSTGRES_URL)
--sqlite-dir string directory containing the SQLite events.db (default: same as serve --data-dir)
--validate skip data copy; validate row counts between SQLite and PostgreSQL