Documentation
¶
Overview ¶
Command metapi-migrate is a standalone tool that transfers all 18 application tables between a SQLite database and a PostgreSQL database (either direction).
Usage:
metapi-migrate --from sqlite://data/hub.db --to postgres://user:pass@host:5432/db metapi-migrate --from postgres://user:pass@host:5432/db --to sqlite://data/hub.db metapi-migrate --from sqlite://data/hub.db --to postgres://user:pass@host:5432/db --dry-run metapi-migrate --from sqlite://data/hub.db --to postgres://user:pass@host:5432/db --overwrite --progress --verify
The migration matches the TS databaseMigrationService.ts behaviour: - Per-column type coercion with fallback defaults - JSON column serialization (13 columns across 5 tables) - FK-safe DELETE order during overwrite - PostgreSQL sequence synchronization after insert (PG targets only; SQLite AUTOINCREMENT handles itself) - Single-transaction boundary with rollback on error - Settings key filtering (skips db_type, db_url, db_ssl)