Backups
Dubby stores all its persistent state in the data directory. Regular backups protect against data loss from hardware failure, corruption, or accidental deletion.
What to back up
Section titled “What to back up”| Data | Location | Contains |
|---|---|---|
| Database | DUBBY_DATA_DIR/dubby.db | Users, libraries, metadata, watch progress, settings |
| WAL files | DUBBY_DATA_DIR/dubby.db-wal, dubby.db-shm | Uncommitted database transactions |
| Image cache | DUBBY_METADATA_CACHE_DIR | Cached TMDB artwork |
| Trickplay sprites | DUBBY_TRICKPLAY_CACHE_DIR | Seek preview thumbnails |
What you can skip
Section titled “What you can skip”- Transcode cache — Temporary files, regenerated on demand
- Log files — Useful for debugging but not critical
- Media files — Back these up separately; Dubby doesn’t modify your media
Manual backup
Section titled “Manual backup”1. Stop the server (recommended)
Section titled “1. Stop the server (recommended)”For a consistent backup, stop Dubby first to ensure the SQLite database isn’t being written to:
docker compose stop dubby2. Copy the data directory
Section titled “2. Copy the data directory”cp -r /path/to/dubby-data /path/to/backup/dubby-data-$(date +%Y%m%d)3. Restart
Section titled “3. Restart”docker compose start dubbyHot backup (without stopping)
Section titled “Hot backup (without stopping)”SQLite in WAL mode supports concurrent reads during writes. You can copy the database while the server is running, but you must copy all three files together:
sqlite3 /path/to/dubby-data/dubby.db ".backup '/path/to/backup/dubby.db'"The .backup command creates a consistent snapshot even while the database is in use.
Automated backups
Section titled “Automated backups”Cron job
Section titled “Cron job”Create a daily backup with a cron job:
0 3 * * * root sqlite3 /path/to/dubby-data/dubby.db ".backup '/backups/dubby-$(date +\%Y\%m\%d).db'" && find /backups -name "dubby-*.db" -mtime +7 -deleteThis backs up at 3 AM daily and removes backups older than 7 days.
Docker volume backup
Section titled “Docker volume backup”If using Docker named volumes:
docker run --rm \ -v dubby-data:/data:ro \ -v /path/to/backups:/backup \ alpine tar czf /backup/dubby-data-$(date +%Y%m%d).tar.gz -C /data .Restoring from backup
Section titled “Restoring from backup”1. Stop the server
Section titled “1. Stop the server”docker compose stop dubby2. Replace the data directory
Section titled “2. Replace the data directory”rm -rf /path/to/dubby-data/*cp -r /path/to/backup/dubby-data-YYYYMMDD/* /path/to/dubby-data/3. Start the server
Section titled “3. Start the server”docker compose start dubbyThe server checks for pending migrations on startup and applies them if needed.
What’s preserved in a backup
Section titled “What’s preserved in a backup”- All user accounts and sessions
- Library configurations and paths
- All metadata (titles, descriptions, artwork references)
- Watch progress and continue watching state
- User preferences and settings
- Feature flag configurations
- Invite codes and permissions
What’s not preserved
Section titled “What’s not preserved”- Active streaming sessions (ephemeral)
- Cached transcodes (regenerated on demand)
- Trickplay sprites (regenerated on demand, but backing up saves regeneration time)