Skip to content

Backup

The state is the database and the Belegablage; back up both, at the same time, and keep them as long as the retention periods of the books require.

The archives hold the books; keep them readable only by you (umask 077), together with .env.

Terminal window
umask 077
docker compose exec -T db pg_dump -U postgres -Fc decuma > decuma-$(date +%F).dump
docker compose exec -T decuma tar -czf - -C /var/lib/decuma/ablage . > ablage-$(date +%F).tgz # or copy the mapped folder

Restore into a new installation whose roles and empty database exist: pg_restore -U postgres -d decuma decuma-....dump (keep the owners: the deletion function must stay owned by decuma_deletion), unpack the archive into the Ablage (tar -xzf - -C /var/lib/decuma/ablage), then migrate and serve. Where DECUMA_ERIC_MODE=live was set, read The journal, restore and copies first: the journal is not restored with the database. Belege are never changed after they arrive, so the Ablage can also be copied incrementally (rsync). Test a restore before you rely on it.