Update and migrate: Backup
Goal and result
Section titled “Goal and result”Create a consistent backup before update, migration, or configuration changes.
Applies to
Section titled “Applies to”DiscVault v26 stable and beta both require a PostgreSQL dump and the host /data directory from the same stopped-writer window.
DiscVault v26 stable
Section titled “DiscVault v26 stable”- DiscVault v26 stable ·
ghcr.io/helmerznl/discvault:latest - PostgreSQL dump and filesystem archive from the same stopped-writer window
- PostgreSQL +
/data
DiscVault v26 beta
Section titled “DiscVault v26 beta”- DiscVault v26 beta ·
ghcr.io/helmerznl/discvault:beta - PostgreSQL dump and filesystem archive from the same stopped-writer window
- PostgreSQL +
/data
Prerequisites
Section titled “Prerequisites”- backup destination outside the live data path
- writable persistent storage and free backup space
Procedure
Section titled “Procedure”- Record:
PREVIOUS_IMAGE· immutablesha256digest - Stop:
next-api+next-worker+next-mcpwriters - Back up:
pg_dump -Fc+ filesystem archive - Start:
next-api→ health → worker + MCP · validate both files
Commands and settings
Section titled “Commands and settings”Both channels
Section titled “Both channels”set -euo pipefailcd /opt/discvaultinstall -d -m 0700 /srv/backupsBACKUP_ID="$(date -u +%Y%m%dT%H%M%SZ)"API_ID="$(docker compose --env-file .env -p discvault -f compose.yaml ps -q next-api)"IMAGE_ID="$(docker inspect "$API_ID" --format '{{.Image}}')"PREVIOUS_IMAGE="$(docker image inspect "$IMAGE_ID" --format '{{index .RepoDigests 0}}')"test -n "$PREVIOUS_IMAGE"printf 'BACKUP_ID=%s\nPREVIOUS_IMAGE=%s\n' "$BACKUP_ID" "$PREVIOUS_IMAGE" \ > "/srv/backups/discvault-$BACKUP_ID.env"chmod 0600 "/srv/backups/discvault-$BACKUP_ID.env"docker compose --env-file .env -p discvault -f compose.yaml stop next-worker next-mcp next-apidocker compose --env-file .env -p discvault -f compose.yaml exec -T postgres \ sh -c 'pg_dump -Fc -U "$POSTGRES_USER" "$POSTGRES_DB"' \ > "/srv/backups/discvault-$BACKUP_ID.dump"tar --acls --xattrs -C /srv -czf \ "/srv/backups/discvault-data-$BACKUP_ID.tgz" discvaultdocker compose --env-file .env -p discvault -f compose.yaml start next-apicurl --fail http://localhost:6080/api/next/healthdocker compose --env-file .env -p discvault -f compose.yaml start next-worker next-mcptest -s "/srv/backups/discvault-$BACKUP_ID.dump"gzip -t "/srv/backups/discvault-data-$BACKUP_ID.tgz"Expected result
Section titled “Expected result”Backup files are non-empty, stored outside the live data path, and can be listed or restored in a rehearsal.
- the archive and dump are non-empty, readable in a restore rehearsal, and tied to an immutable image digest
Safety and rollback
Section titled “Safety and rollback”Next step
Section titled “Next step”Source and status
Section titled “Source and status”helmerzNL/DiscVault@6d27c689ac21- Verified:
2026-07-14 - DiscVault Docs:
0.1.0
