Backups and restore
Arkivra backup jobs capture PostgreSQL and filesystem document storage together. A restore replaces the current instance state; it is different from restoring one historical document version.
What a backup contains
Section titled “What a backup contains”The worker creates an encrypted multipart backup set in the configured backups directory. A set consists of:
- one
.manifest.jsonfile with Arkivra version, archive format, encryption metadata, part order, sizes, and checksums; - one or more encrypted
.partNNNfiles.
The encrypted payload contains a PostgreSQL SQL dump and filesystem document storage, including uploaded version sources, extracted assets, and cached or derived previews.
It does not contain:
.envor deployment configuration;ARKIVRA_ENCRYPTION_KEYSorARKIVRA_AUTH_SECRET;- SMTP, OAuth, Gemini, or other provider credentials;
- reverse-proxy and TLS configuration;
- external Docling, Gotenberg, or Ollama data and models.
Create and download a backup
Section titled “Create and download a backup”- Sign in as a platform administrator.
- Open Administration → Backups.
- Select Create backup.
- Keep the worker running and wait for the archive to appear.
- Download the manifest and every listed part.
- Store the set with a separate protected copy of required secrets and configuration.
Backup creation enables maintenance mode, waits for already-running mutation jobs, checks that database-referenced storage files exist, and then snapshots database and storage. Uploads, document changes, cleanup, indexing, backup imports, and restore work are paused or rejected during this window.
The default maximum part size is 16 GiB. Set ARKIVRA_BACKUP_PART_SIZE_BYTES before creating the backup when transfer media or tooling needs smaller parts. The accepted minimum is 512 MiB.
Restore an initialized instance
Section titled “Restore an initialized instance”- Take an out-of-band copy of the current database and storage if possible.
- Confirm the archive comes from a compatible Arkivra version.
- Configure every encryption key version required by the archive and its stored files.
- Open Administration → Backups.
- Under Import backup set, select the manifest and every part.
- Wait until the set is listed as restorable.
- Select Restore, acknowledge that it replaces the current instance, and queue the job.
- Keep the worker running and user traffic stopped until restore completes.
Restore writes a maintenance marker, decrypts and extracts the archive, restores PostgreSQL, stages document storage, verifies referenced files, swaps storage into place, and removes the marker after success.
Restore a fresh instance
Section titled “Restore a fresh instance”Arkivra exposes bootstrap restore API routes when no active administrator exists and ARKIVRA_RESTORE_BOOTSTRAP_TOKEN is set. The current dashboard does not provide a /restore page, so use an HTTP client against the bootstrap API or restore through an already initialized admin UI.
For API bootstrap restore:
-
Configure the new instance with the backup’s required
ARKIVRA_ENCRYPTION_KEYS, a stableARKIVRA_AUTH_SECRET,ARKIVRA_RESTORE_BOOTSTRAP_TOKEN, and any provider, OAuth, or SMTP secrets the restored deployment needs. -
Start the API and worker without registering an administrator.
-
Confirm bootstrap restore is available:
Terminal window curl https://documents.example.com/api/restore/bootstrap/status -
Wrap and upload the manifest:
Terminal window jq '{manifest: .}' arkivra-backup.manifest.json | \curl -X POST \-H 'Content-Type: application/json' \-H 'X-Arkivra-Restore-Token: <restore-token>' \--data-binary @- \https://documents.example.com/api/restore/bootstrap/imports -
Record the returned
backupId, then upload every part with its exact manifest filename:Terminal window curl -X PUT \-H 'X-Arkivra-Restore-Token: <restore-token>' \--data-binary @arkivra-backup.part001 \https://documents.example.com/api/restore/bootstrap/imports/<backup-id>/parts/arkivra-backup.part001 -
Queue the destructive restore:
Terminal window curl -X POST \-H 'Content-Type: application/json' \-H 'X-Arkivra-Restore-Token: <restore-token>' \--data '{"backupId":"<backup-id>"}' \https://documents.example.com/api/restore/bootstrap/restore -
Monitor worker logs. After completion, sign in with an account from the restored database.
Bootstrap restore becomes unavailable as soon as an active administrator exists. The token is compared by the API and should be treated as a high-impact secret.
Encryption keys and legacy archives
Section titled “Encryption keys and legacy archives”New backup archives use the active key version from ARKIVRA_ENCRYPTION_KEYS with backup-specific derivation. The restored stored files may depend on older versions too. Keep all needed versions configured.
Older archives made before this scheme also require the deprecated ARKIVRA_BACKUP_ENCRYPTION_KEY. Preserve that value only while those legacy backup sets remain in your recovery plan.
Test recovery
Section titled “Test recovery”A backup is not proven until it has been restored in an isolated environment. Test that users can sign in, documents download and preview, keyword search works, and background workers resume. Then reconnect optional providers with separately stored credentials.