Skip to main content
Version: v5.6.1

opschain server backup

Included from Basic tier

opschain server backup <destination-dir>

An online, consistent backup of an embedded (SQLite) server into a manifest-sealed directory. The server may keep running: the SQLite store is snapshotted transactionally with VACUUM INTO (safe under WAL), the content-addressed blob root is written as blobs.tar, and manifest.json records a SHA-256 digest and size for each file (format opschain-backup/v1), which opschain server restore verifies before touching anything.

The destination directory must be empty (it is created if missing). The store and blob root are resolved exactly as server start resolves them: the config file's values, with the <opschain home> defaults.

opschain server backup /backups/opschain-2026-10-14
backed up /var/lib/opschain/opschain.db and 42 blob(s) to /backups/opschain-2026-10-14
keys are NOT included: back up server/keys.env (and the vault master key) separately — losing them makes encrypted data unrecoverable

Keys are not included. A backup without server/keys.env (and the vault master key, held outside the database) cannot decrypt the data it contains.

PostgreSQL stores are refused with guidance, verbatim:

the configured store is PostgreSQL: back it up with the operator's standard tooling (pg_dump/PITR) together with the blob root and the key material (server/keys.env, and the vault master key held outside the database); opschain server backup covers embedded SQLite deployments only

Named errors​

  • destination <dir> is not empty — pick a fresh directory per backup.
  • The PostgreSQL guidance above.

Both exit 1.

Exit codes​

CodeMeaning
0Backup written and manifest sealed.
1Refused (PostgreSQL store, non-empty destination) or the backup failed partway.
2Usage error — the destination directory argument is missing.

See also​

  • opschain docs cli/server-restore — restore from this directory.
  • opschain docs cli/server-configure — where keys.env comes from and why it must be backed up.
  • opschain learn 8.1 — backup and interchange.