migrate

command
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command metapi-migrate is a standalone CLI that transfers all 18 application tables between a SQLite database and a PostgreSQL database (either direction).

The migration logic lives in store.RunMigration so the same code path is callable from the admin migrate handler (queued as a background task). This file is a thin flag-parsing + summary-printing wrapper.

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 (14 columns across 6 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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL