Backup is online. Restore is offline.
The backup contacts the running transactor once. That call fixes the current transaction basis, and it returns the connection details of the underlying storage.
The backup then reads the storage log independently, through that basis only. Transactions committed while the backup runs are left for the next incremental run.
corium backup --transactor http://127.0.0.1:4334 people /backups/people.corium
| Flag | Default | Effect |
|---|---|---|
--transactor <url> | http://127.0.0.1:4334 | Transactor used for storage discovery. |
--token <secret> | Development token | Bearer token. --token "" connects anonymously. |
--ca <pem>, --tls-domain <name> | None | TLS for the transactor connection. |
--storage-key <uri> | None | Key-encryption key, for an encrypted database. Repeatable; CORIUM_STORAGE_KEY also sets it. |
The positional arguments are the database name and the destination file.
Run the same command with the same file for an incremental refresh.
The backup reads only the transaction records after its existing checkpoint,
and it appends one new checkpoint frame. The report prints
:replayed-transactions.
The first run embeds the immutable snapshot blobs and retains that index snapshot as a replay base. Later runs do not repeat that work.
The report is one EDN map:
{:db "people" :backup-format 2 :writer-version "…" :content-encryption :none
:basis-t 1240 :index-basis-t 1200 :replayed-transactions 40 :copied-blobs 12
:reused-blobs 480}
A backup has exactly one representation: a binary .corium archive.
The header carries an independent backup-file format version, and the Corium version that created it. Every incremental checkpoint records the version that appended it.
An unsupported future format fails before restore, and the error names its writer.
This release writes format 2 and reads formats 1 and 2. An archive keeps the format it was created with, so an incremental run against an existing format 1 file appends a format 1 checkpoint rather than rewriting its header.
--log-format human|json controls diagnostic logging only. It never changes
the artifact.
Not implemented. There is no
dumpcommand. Human, JSON, and EDN export belong in one, not in backup or restore.
| Store | Requirement |
|---|---|
fs, turso | Run where the absolute local storage path of the transactor is reachable. |
postgres, s3 | Connect to the same native storage that the transactor advertises. S3 credentials come from the standard AWS environment. |
mem | Rejected. A separate process cannot open process-local memory storage. |
The advertised PostgreSQL connection is read and write in this version. A future release can substitute read-only credentials without a protocol change.
A database created with --storage-key backs up and restores through the same
two commands, with the key named on both ends.
corium backup --transactor http://127.0.0.1:4334 \
--storage-key file:/etc/corium/storage.key \
people /backups/people.corium
corium restore /backups/people.corium --data-dir /srv/corium-restored \
--as-db people --storage-key file:/etc/corium/storage.key
The archive is backup format 2 and holds ciphertext throughout: index segments are copied byte for byte and transaction records stay sealed, so nothing is decrypted on the way in. The header and each checkpoint also carry the database's key manifest — a KEK identity and data keys already wrapped under it, never key material — which is what lets a restore bootstrap itself from the archive plus access to the KEK.
Each side needs the key for a different reason, and the reports say which:
:content-encryption is :storage rather than :none.
The restored database keeps the archive's data keys, so a clone shares key
material with its source. Run corium keys rotate or corium keys rewrap on
the clone when it must be independently revocable; corium db fork mints a
fresh manifest instead of copying one.
See encryption at rest.
Restore is offline, and it refuses to overwrite a database. The target transactor must be stopped.
corium restore /backups/people.corium --data-dir /srv/corium-restored --as-db people
Restoring under a new name creates a clone:
corium restore /backups/people.corium --data-dir /srv/corium --as-db people-staging
| Flag | Effect |
|---|---|
--data-dir <path> | Target transactor data directory. Required. |
--as-db <name> | Target database name. It can differ from the source name. Required. |
--storage-key <uri> | Key-encryption key, required for an encrypted archive. |
Restore writes a filesystem data directory. It does not write to a postgres,
turso, or s3 store directly.
Backup-container and database-storage versions are checked separately before publication.
:index-lag in corium db stats reaches zero.:basis-t in the backup report.Four rules make a backup useful.
corium db request-index <db> before a backup when the snapshot must be
current. A backup reads through the published basis.Can you improve this documentation? These fine people already did:
Claude & Casey MarshallEdit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |