Skip to content

Backups and restore

dvnkln edited this page Oct 12, 2026 · 3 revisions

All data is in one SQLite database inside the volume (/data/hdtracker.db) – with several accounts, the accounts and libraries of everybody. A backup is always the whole installation; restoring one brings all accounts back to that state.

The folder /data/images only holds copies of posters and other images. It does not need to be backed up – missing images are simply loaded again.

Scheduled backups in the app

Under Settings → Maintenance hdtracker can back up its database on a schedule (off by default). You choose how often and how many copies to keep. The copies are stored in /data/backups inside the volume and can also be downloaded or deleted on that page. Run now creates a backup immediately.

Backing up the whole volume

That works as well – but copy it while the container is stopped, or always copy the three files hdtracker.db, hdtracker.db-wal and hdtracker.db-shm together. hdtracker keeps recent changes in the -wal file for a moment; a copy of only hdtracker.db taken while the app is running may be incomplete.

Restoring a backup

docker compose stop

# Volume name: see `docker volume ls` (usually <folder>_hdtracker-data).
# Backup from the volume: /data/backups/<file>
# Downloaded backup in the current folder: /in/<file>
docker run --rm -v <folder>_hdtracker-data:/data -v "$PWD":/in alpine sh -c '
  cp /data/backups/hdtracker-2026-09-27_030000.db /data/hdtracker.db &&
  rm -f /data/hdtracker.db-wal /data/hdtracker.db-shm &&
  chown 1000:1000 /data/hdtracker.db'

docker compose start

What the three lines do: put the backup in place of the database, remove the leftover helper files of the old database, and give the file to the user the app runs as.

Clone this wiki locally