Data & backups
What’s in /app/data
Section titled “What’s in /app/data”| File | Purpose | Protection |
|---|---|---|
users.db |
User accounts, mobile device tokens and one-time pairing codes | Passwords hashed with bcrypt; tokens and codes stored only as SHA-256 hashes |
tokens.db |
Per-user, per-instance Sonarr URLs and API keys | Fernet encrypted |
.master.key |
The key that encrypts tokens.db |
File mode 0600. Keep it safe |
sonarr_history.db |
Analyses, per-series savings and schedules | Not encrypted |
tls/cert.pem, tls/key.pem |
The self-signed HTTPS certificate, only with SONARR_ANALYZER_TLS=self-signed |
Key file mode 0600 |
Backing up and restoring the whole folder keeps your mobile devices paired: their tokens are in users.db, and the certificate they pinned is in tls/. Without tls/, a new certificate is generated on the next start and every phone has to pair again.
Backup
Section titled “Backup”Stop the container first: copying the SQLite databases while the scheduler writes to them can leave an inconsistent .db in the backup. --volumes-from reaches the container’s /app/data whatever it is: a named volume, the project-prefixed volume Docker Compose creates (like myfolder_sonarr-data), or a bind mount.
docker stop sonarr-analyzerdocker run --rm \ --volumes-from sonarr-analyzer \ -v "$(pwd)":/backup \ alpine tar czf /backup/sonarr-backup.tar.gz -C /app/data .docker start sonarr-analyzerRestore
Section titled “Restore”The container must exist. On a new machine, create it first with your usual docker run or docker compose up -d, then:
docker stop sonarr-analyzerdocker run --rm \ --volumes-from sonarr-analyzer \ -v "$(pwd)":/backup \ alpine tar xzf /backup/sonarr-backup.tar.gz -C /app/datadocker start sonarr-analyzerUpgrades
Section titled “Upgrades”See Upgrading.