Update and migrate: Restore
Goal and result
Section titled “Goal and result”Restore the complete data set for the selected channel rather than copying only one database file.
Applies to
Section titled “Applies to”For both release channels, restore the matching /data archive and PostgreSQL dump before starting the recorded image digest.
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
- restore the matching data before starting the previous image
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
- restore the matching data before starting the previous image
Prerequisites
Section titled “Prerequisites”- matching backup set
- maintenance window
PREVIOUS_IMAGE· private DiscVault runtime environment file
Procedure
Section titled “Procedure”- Stop:
next-api+next-worker+next-mcp - Restore:
/dataarchive · before image startup - Restore: PostgreSQL ·
pg_restore --exit-on-error - Start:
next-api→GET /api/next/health→next-worker+next-mcp
Commands and settings
Section titled “Commands and settings”Both channels
Section titled “Both channels”set -euo pipefailBACKUP_ID=20260714T180000Zcd /opt/discvault. "/srv/backups/discvault-$BACKUP_ID.env"test -n "$PREVIOUS_IMAGE"export DISCVAULT_IMAGE="$PREVIOUS_IMAGE"docker pull "$DISCVAULT_IMAGE"ENV_FILE=/opt/discvault/.envENV_TMP="$(mktemp "$ENV_FILE.restore.XXXXXX")"trap 'rm -f "$ENV_TMP"' EXITawk -v image="$DISCVAULT_IMAGE" ' /^DISCVAULT_IMAGE=/ { print "DISCVAULT_IMAGE=" image; found=1; next } { print } END { if (!found) exit 42 }' "$ENV_FILE" > "$ENV_TMP"chmod 0600 "$ENV_TMP"docker compose --env-file .env -p discvault -f compose.yaml stop next-worker next-mcp next-apimv /srv/discvault "/srv/discvault.failed-$(date -u +%Y%m%dT%H%M%SZ)"tar --acls --xattrs -C /srv -xzf \ "/srv/backups/discvault-data-$BACKUP_ID.tgz"docker compose --env-file .env -p discvault -f compose.yaml up -d postgresdocker compose --env-file .env -p discvault -f compose.yaml exec -T postgres \ sh -c 'dropdb --if-exists --force -U "$POSTGRES_USER" "$POSTGRES_DB"'docker compose --env-file .env -p discvault -f compose.yaml exec -T postgres \ sh -c 'createdb -U "$POSTGRES_USER" "$POSTGRES_DB"'docker compose --env-file .env -p discvault -f compose.yaml exec -T postgres \ sh -c 'pg_restore --exit-on-error --no-owner -U "$POSTGRES_USER" -d "$POSTGRES_DB"' \ < "/srv/backups/discvault-$BACKUP_ID.dump"docker compose --env-file .env -p discvault -f compose.yaml up -d --force-recreate next-apicurl --fail http://localhost:6080/api/next/healthdocker compose --env-file .env -p discvault -f compose.yaml \ up -d --force-recreate next-worker next-mcpdocker compose --env-file .env -p discvault -f compose.yaml psmv "$ENV_TMP" "$ENV_FILE"trap - EXITExpected result
Section titled “Expected result”The original image starts healthy and library counts and media files match the backup.
- library counts and sampled media match the selected backup
- same procedure ·
:latest/:beta
Safety and rollback
Section titled “Safety and rollback”Next step
Section titled “Next step”Update and migrate: Container update
Source and status
Section titled “Source and status”helmerzNL/DiscVault@6d27c689ac21- Verified:
2026-07-14 - DiscVault Docs:
0.1.0
