Backups
Back up, restore and keep the key safe.
What needs backing up
| What | Where | How |
|---|---|---|
Key CLIPR_SECRET_KEY |
.env, secrets/clipr_secret_key or – if both are empty – /data/.secret_key in the volume |
Once, separately from everything else: password manager, printout in a safe. |
| App data | Docker volume clipr-data (system.db, exchange.db, stores/) |
scripts/cliprctl backup, regularly. |
| Settings | .env, possibly secrets/ |
With the server backup or separately (contains credentials). |
| Wiki (only with local changes) | Docker volume wiki-data |
See below. Shipped pages come with every release. |
| Certificates | Docker volume caddy-data |
Not needed: Caddy issues new ones when required. With CLIPR_TLS=internal the certificate authority then changes – devices must trust it again. |
No key, no data. All databases and files in the volume are encrypted. A backup without the matching CLIPR_SECRET_KEY is worthless – and whoever steals the backup cannot read anything without it. Keep backup and key separate.
Backing up
scripts/cliprctl backup # to backups/clipr-data-<time>.tgz
scripts/cliprctl backup /mnt/nas/clipr # to another folder
scripts/cliprctl backup --online # without pausing the app
For a consistent backup, backup briefly stops the app (usually a few seconds) and starts it again afterwards. --online avoids the pause; a database may then be captured in the middle of a write – usually fine for regular runs at quiet times, but not recommended for a backup before an update.
The backup is made with the app image itself, without network access, with the volume mounted read-only. The file belongs to you and has mode 600.
Regularly via cron, e.g. every night at 3 am, keeping the last 14 backups:
0 3 * * * cd /path/to/Clipr && scripts/cliprctl backup && ls -1t backups/clipr-data-*.tgz | tail -n +15 | xargs -r rm --
Also copy the backups to another device (NAS, external disk, encrypted cloud storage).
Restoring
scripts/cliprctl restore backups/clipr-data-<time>.tgz
- The file is checked: readable archive, contains
system.db, no paths outside the volume. - You confirm by typing
restore(wiederherstellenwith German output). - The current state is backed up automatically.
- The app is stopped, the volume emptied and filled from the backup, then the app starts again.
CLIPR_SECRET_KEY in .env must be the same as when the backup was made.
Moving to a new server: install Clipr there, take over the old .env (with the old key), run scripts/cliprctl deploy --build once, then scripts/cliprctl restore <file>.
Backing up wiki data
Local wiki changes (pages, images, history) are in the volume wiki-data. They are not encrypted and contain no credentials:
docker run --rm -v "$(scripts/cliprctl compose config | sed -n 's/^name: //p')_wiki-data:/d:ro" -v "$PWD/backups:/b" \
alpine tar czf /b/wiki-data-$(date +%Y%m%d).tgz -C /d .
Export for individual people
Everyone can download a ZIP with all their tickets (JSON) and files under Settings → Backup – including tickets in a vault while it is unlocked. It is readable without the server key.