Skip to content
loomark

Documentation

Backups and restore

Daily database dumps, a full copy with files, and restoring.

Daily database backup

The backup service writes loomark-<date>.dump to deploy/backups every day at BACKUP_HOUR_UTC (01:00 UTC by default) and removes copies older than BACKUP_KEEP_DAYS (14). The folder can be changed with BACKUP_DIR.

One-off backup now
docker compose exec backup /bin/sh /backup.sh --once

Attachments

Attachment files live in the minio-data volume. A full copy of database and files is an instance export — see Moving to another server. It is convenient to make one weekly and before updates.

Restore the database

  1. Step 1Stop the application: docker compose stop web worker postgrest.
  2. Step 2Recreate the empty database and set its search path (commands below).
  3. Step 3Restore the dump with pg_restore.
  4. Step 4Start everything: docker compose up -d.
Shell
cd deploy
docker compose stop web worker postgrest
docker compose exec -T postgres sh -c 'dropdb -U postgres --if-exists loomark && createdb -U postgres loomark'
docker compose exec -T postgres psql -U postgres -d loomark \
  -c "alter database loomark set search_path = \"\$user\", public, extensions"
docker compose exec -T postgres pg_restore -U postgres -d loomark --no-owner < backups/loomark-<date>.dump
docker compose up -d

Database roles are stored in the cluster, not in the database, so on the same server they already exist. On a new server use the instance import instead.