Back up or move a database
Inspect usage, make a snapshot, restore into an empty target, or rehearse a logical import.
MarkdownThe local operator connects through an owner-only Unix socket. Run it from the same checkout and machine as the stack. It works with the local state and the ready-database registry.
Back up and restore
node scripts/operator.mjs usage "$SOURCE_ID"
node scripts/operator.mjs backup "$SOURCE_ID"
node scripts/operator.mjs restore "$EMPTY_TARGET_ID" "$SOURCE_ID" "$SNAPSHOT_SHA256"
Use a separate, ready, empty target and the snapshot checksum printed by the backup. A restore preserves the supported catalog, versioned data, sequence positions, and table grants. The target keeps its own identity and SCRAM credentials. Connect to the target and read known rows before directing any application to it.
Rehearse an import
Export a PostgreSQL database using the documented logical archive profile, then import it into an empty target.
python3 portability/dump.py "$PGPORT" "$PGDATABASE" "$PGUSER" archive-directory
node scripts/operator.mjs import "$EMPTY_TARGET_ID" archive-directory
node scripts/operator.mjs --help
Owners and Admins can open the target database and check Restore and migration history for the latest 25 attempts. A verified restore checked the snapshot checksum and opened the restored catalog. A verified logical import compared loaded rows and column metadata with the archive reference. An interrupted attempt can show an unconfirmed result. History starts with operations run after this feature is installed.
Check the application’s schema, constraints, sequences, and permissions on a disposable database first. A frozen export pauses writes, and the continuity tools use explicit source fencing and replay steps. Their local procedures are in continuity/README.md in the checkout. Review compatibility and limits before choosing a migration method.
If a management request times out, read its operation status before retrying. For a database route missing after a local upgrade, the operator can reconcile a known database with node scripts/operator.mjs reconcile-ready DATABASE_ID.