Repository navigation
Restore
Goal: recover a separately backed-up installation without overwriting live state, substituting keys, or claiming the unshipped tail was recovered.
Use a fresh owned recovery directory and the correct recorded engine or an explicitly checked candidate engine. Have the original file/environment master key, or the matching KMS configuration and provider authority, available from the separate recovery channel. Never generate a replacement seed over an existing encrypted store.
-
Keep the source and failed installation intact for investigation. Select the actual bucket/prefix and shipped recovery point, not a guessed LSN.
-
Review a dry run, then restore into the empty recovery directory:
kronik restore --from s3://example-backups/installation \ --config /owned/recovery/kronik.toml --data-dir /owned/recovery/data --dry-run kronik restore --from s3://example-backups/installation \ --config /owned/recovery/kronik.toml --data-dir /owned/recovery/data
The paths and bucket are examples to replace. Supply file/env key material through its documented separate key source, never argv or this runbook. KMS restore installs and validates the shipped ciphertext envelope before publishing encrypted stores. Do not use
--forceagainst live data. Run as root against the directory of the nonroot service (owned by thekronikuser), the command reads the key and the remote's credentials as root, gives up root, and finishes askronik: afile://source must be readable by that user, and the command says so before it writes anything.--dry-runas root cannot tell.A
Skippedline (snapshots_skippedin the JSON) means the bucket's newest snapshot is ahead of the segments it holds: restore installed the log's last covered snapshot, and the recovery point isLog last LSN(log_last_lsn), not the skipped snapshot. Record the skipped LSNs and the gap; do not treat the unshipped records as recovered.A failure naming a snapshot's manifest (
the manifest of snapshot <L>) means the bucket lists an object it cannot serve intact: a failed GET, or bytes that no longer parse. Restore refused rather than silently install the older snapshot. Investigate the bucket and copy the object aside; then repair it, or delete that manifest object — the state retention leaves — to restore explicitly from the older snapshot. -
Refuse
MASTER_KEY_MISSING,MASTER_KEY_MISMATCH,KEY_SOURCE_UNAVAILABLEorKEYSTORE_INCOMPLETEuntil the actual source/key problem is resolved.--allow-missing-keysand--without-keystoreexplicitly accept unreadable or discarded subject keys; they are data-loss decisions, not routine fixes. -
If the candidate engine differs, follow the upgrade runbook before starting it. Start only this owned recovered instance using its own config, gateway port and API socket:
kronik serve --config /owned/recovery/kronik.toml
The first start of a restored directory may install the newest snapshot that the log continues (the restore registered it) and replay the log from there, because an actor database that came with the snapshot can be older than the log the bucket kept; the daemon logs
installed a snapshot as the branch's state, andkronik upgrade checkon the restored directory notes it before the start. -
Compare
kronik --json integrity --through <source-LSN>against the recorded source state/log hashes. Checkkeys_missingis empty and read known fixture key-value and SQL values. Confirm the next audit records include the real restore marker; new mutations may legitimately increase the head. Forks/proposals/diffs not shipped by the format are not magically restored. -
Perform an identity replay of the recovered fixture's recorded roots in isolated and continuous modes. Require complete roots, no behavioral changes and no synthetic/approximate effects before declaring recovery. Reopen external traffic only after the actual checks pass.
Record binary/engine and fixture hashes, the exact restore command, source and restored LSNs, state/log comparisons, key inventory, replay counts and observed errors. In a disposable fixture, separately check missing/wrong keys are refused; never experiment with production keys. A same-host file target proves format flow only, not off-host backup availability or an unobserved recovery point/time objective.