Backup
What to back up and how to take a consistent backup.
An Orlok installation has two things that must never be lost:
| What | Why |
|---|---|
The database in the db-data volume |
Offices, colleagues, people, conversations, wikis, uploaded documents and the audit log |
ORLOK_SECRET_KEY |
Without it, saved provider keys, credentials and the SMTP password cannot be decrypted |
Keep a copy of .env.production together with the backups, in a safe place outside the server.
Take a backup
Dump the database from the running installation:
docker compose --env-file .env.production exec -T db \
pg_dump -U orlok -d orlok --format=custom > orlok-$(date +%F).dump
User and database are both orlok unless .env.production sets POSTGRES_USER or POSTGRES_DB:
in that case use those values here and when restoring.
The dump is consistent even while people are working. Schedule it daily and keep several copies, at least one of them off site.