-
-
Notifications
You must be signed in to change notification settings - Fork 18
Backup and Restore
DOCSight can create full backups of all your monitoring data and restore them on a fresh instance. This protects months of collected ISP evidence against disk failures or accidental container removal.
A DOCSight backup is a .tar.gz archive containing:
| File | Content |
|---|---|
docsis_history.db |
The full DOCSight SQLite database, including signal history, events, speedtest data, journal entries, attachments metadata, incidents, BQM data, BNetzA measurements, weather history, API tokens, segment utilization, and internal app metadata |
config.json |
All settings (modem type, URLs, credentials, integrations) |
.config_key |
Fernet encryption key for credential decryption |
.session_key |
Flask session signing key |
connection_monitor.db |
Connection Monitor targets, latency samples, and outage history |
backup_meta.json |
Backup metadata (timestamp, version, table row counts) |
Demo-seeded rows are filtered out for the main demo-populated monitoring tables before the archive is created. User-created data remains in the backup. The exact filtered table list is implementation-defined, so this should be treated as "demo content is reduced where supported", not as a blanket guarantee that every future is_demo=1 row in every table is removed.
- Go to Settings > Backup
- Click Download Backup
- Save the
.tar.gzfile
The backup is created in-memory and streamed to your browser. The database is copied atomically using SQLite VACUUM INTO, so the backup is always consistent even while DOCSight is actively collecting data.
DOCSight can automatically create backups on a schedule and store them in a directory.
- Go to Settings > Backup
- Enable Automatic Backups
- Click Browse to select a backup directory (default:
/backup) - Choose an interval: Daily (every 24h) or Weekly (every 168h)
- Set Retention: how many backup files to keep (default: 5, older ones are deleted automatically)
- Save
For scheduled backups to persist, mount a volume to /backup:
services:
docsight:
image: ghcr.io/itsdnns/docsight:latest
ports:
- "8765:8765"
volumes:
- docsight_data:/data
- docsight_backup:/backup
volumes:
docsight_data:
docsight_backup:Or use a host bind mount if you want direct filesystem access:
volumes:
- docsight_data:/data
- /path/to/backups:/backupClick Backup Now in the Settings backup section to immediately create a backup in the configured directory (without waiting for the next scheduled run).
Backups are named docsight_backup_YYYY-MM-DD_HHMMSS.tar.gz and appear in the backup list in Settings. You can delete individual backups from there.
When you open DOCSight for the first time (or after removing the data volume), the setup wizard offers two options:
- New Setup -- start fresh with the configuration wizard
-
Restore from Backup -- upload a
.tar.gzbackup file
Choosing restore:
- Select your backup
.tar.gzfile - DOCSight validates the archive and shows metadata (creation date, version, table row counts)
- Click Restore
- If the backup contains a complete configuration, DOCSight redirects to the dashboard
- If the backup has no configuration (e.g., from demo mode), the setup wizard continues so you can configure your modem
Restoring on an existing instance overwrites all data. To do this:
- Stop DOCSight
- Remove the data volume contents
- Start DOCSight (it will show the setup wizard)
- Choose Restore from Backup and upload your file
The backup module uses these configuration keys in Settings:
| Key | Default | Description |
|---|---|---|
backup_enabled |
false |
Enable scheduled automatic backups |
backup_path |
/backup |
Directory for scheduled backups |
backup_interval_hours |
24 |
Backup interval in hours (24 = daily, 168 = weekly) |
backup_retention |
5 |
Number of backup files to keep |
These are exposed through the Settings UI in the Backup section.
DOCSight uses SQLite's VACUUM INTO command to create the database copy. This produces a fully consistent snapshot of the database without requiring any locks or downtime. The copy is independent of WAL (Write-Ahead Logging) state.
DOCSight removes demo-seeded rows from the current set of known demo-populated monitoring tables before the database copy is archived. This keeps demo backups smaller and avoids shipping large amounts of generated example data. User-created entries are preserved.
Each backup includes a format_version in its metadata. When restoring a backup from a newer DOCSight version:
- DOCSight logs a warning but attempts the restore anyway
- New database tables that DOCSight doesn't know about remain harmlessly in the database
- Missing columns are added automatically on startup via schema migration
- The directory browser (used for selecting the backup path) only allows navigation within
/backupand/data - Path traversal attacks are blocked via
os.path.realpath()checks - Backup filenames are sanitized with
secure_filename()before deletion - Archive members are validated against a whitelist of expected filenames
The /backup directory must be writable by the DOCSight process (runs as appuser, UID 1000). DOCSight's entrypoint automatically adjusts ownership of /backup on startup. If you use a host bind mount, ensure the directory is writable:
chmod 777 /path/to/backups
# or
chown 1000:1000 /path/to/backupsIf the backup is only a few KB, the database may be empty or contain only demo data (which is excluded). Check that DOCSight has been running and collecting real data.
- Make sure you're uploading the
.tar.gzfile directly, not a renamed or re-compressed version - The file must contain
backup_meta.jsonwith the correct magic value - Corrupt downloads can cause this -- try downloading the backup again
Home | Quick Start | Configuration | API Reference | GitHub
- Quick Start
- Installation
- Running without Docker
- Podman Quadlet
- Configuration
- Reverse Proxy
- Example Compose Stacks
- Dashboard
- Connection Monitor
- Signal Trends
- Before/After Comparison
- Channel Timeline & Compare
- Event Log
- Smart Capture
- Gaming Quality Index
- Modulation Performance
- Cable Segment Utilization
- In-App Glossary
- Speedtest Tracker
- BNetzA Breitbandmessung
- ThinkBroadband BQM
- Smokeping
- Weather
- Netzbremse (Peering)
- Home Assistant (MQTT)
- Prometheus Metrics