Backup & Restore
Backup & Restore
UI backup & restore is live. As of May 2026 you can create encrypted backups and restore from them directly in the product at sidebar → Settings → Backup & Restore tab. Backups are AES-256-GCM encrypted (master key is bundled, password-protected). After a successful restore, run sudo systemctl restart ucontrolinsight manually so the application reloads its caches.
uControl Insight includes an integrated backup and restore system accessible from the UI, REST API, and CLI scripts. Backups are encrypted and portable — they work across on-premises and cloud deployments.
What Is Backed Up
| Component | Included | Notes |
|---|---|---|
| MariaDB database | Always | All 38 tables — assets, credentials, users, discovery config, relationships, lifecycle data |
| Master encryption key | Always (encrypted) | UCONTROL_MASTER_KEY encrypted with your backup password via PBKDF2 + AES-256-GCM |
| Application config | Always | Datasource URL, context path, flow ports (no secrets in plaintext) |
| Manifest | Always | Backup metadata — timestamp, version, asset count, table row counts |
| Flow data (flow_raw) | Optional | Can be very large (GBs). Excluded by default for faster, smaller backups. |
| Audit log | Optional | Included by default. Can be excluded to reduce size. |
What Is NOT Backed Up
- Worker agent data — Each worker has its own H2 database and worker.key. Back these up separately from the worker host (
./data/directory). - Application WAR file — The application binary is not included. Deploy the same version WAR before restoring.
- Tomcat / reverse proxy configuration — Infrastructure config outside the application.
Creating a Backup (UI)
- Log in as an administrator.
- Sidebar → Settings → Backup & Restore tab.
- In the Create a backup card, choose options:
- Backup password (minimum 8 characters). Used to encrypt the bundled master key with PBKDF2 + AES-256-GCM. Remember this password — restore needs it.
- Include flow data — ticks the
flow_rawpartitions in (can be very large; off by default). - Include audit log — on by default.
- Click Create Backup. The request blocks while
mysqldump+ archive assembly + master-key encryption complete (typically tens of seconds for a moderate database). - When complete, the backup appears in the Backup History table with size, SHA-256, and Download / Delete actions. Download to copy the archive off-host.
Restoring from Backup (UI)
Restoring replaces every row in the live database. The previous data is gone once the restore completes. Always download a fresh backup before testing restore.
- Sidebar → Settings → Backup & Restore.
- Scroll to the red-bordered Restore from backup card at the bottom.
- Choose the backup archive (
.tar.gz) to upload. - Enter the backup password that was used at create time.
- Tick Also restore flow data only if you want to overwrite
flow_rawwith the backup's snapshot. - Type
RESTOREin the confirmation field. - Click Restore (replaces live database).
The restore performs three safety checks before any database write:
- Archive integrity — manifest.json, master_key.enc and database.sql must all be present.
- Password — the bundled master key is decrypted with the supplied password. Wrong password aborts before any DB change.
- Master-key match — the decrypted master key must equal this server's
UCONTROL_MASTER_KEY. If it doesn't, the restore aborts with a clear error message; restoring across master keys would make every encrypted secret (LDAP password, OIDC client secret, AI keys, Teams shared secret) unreadable.
After a successful restore: sudo systemctl restart ucontrolinsight on the server.
This clears in-memory caches and reloads schema/config from the restored database. An in-UI restart
button is on the roadmap.
CLI Backup Script
For automated/cron backups without the UI:
# Create backup ./scripts/backup.sh --password "mySecurePass" --output /backups/ # Include flow data ./scripts/backup.sh --password "mySecurePass" --output /backups/ --include-flows # Custom database connection ./scripts/backup.sh --password "mySecurePass" \ --db-host dbserver --db-port 3306 \ --db-name ucontrolinsight --db-user admin --db-pass dbpass \ --master-key "$(echo $UCONTROL_MASTER_KEY)"
CLI Restore Script
# Restore from backup ./scripts/restore.sh --file ucontrol-backup-2026-04-29-020000.zip --password "mySecurePass" # Skip confirmation prompt ./scripts/restore.sh --file backup.zip --password "mySecurePass" --yes
The restore script will display the decrypted UCONTROL_MASTER_KEY — update the environment variable before restarting.
Scheduled Automatic Backups
Enable daily automated backups by setting these properties in application.yml or environment variables:
ucontrol:
backup:
directory: /var/backups/ucontrol
scheduled:
enabled: true
password: your-backup-password
retention: 7 # keep last 7 backups
include-flows: false
cron: "0 0 2 * * *" # daily at 2:00 AM
Old backups beyond the retention count are automatically purged. Backup success/failure is logged to the audit trail.
Backup Archive Contents
The .zip backup file contains:
| File | Description |
|---|---|
database.sql | Full MariaDB dump (mysqldump format) — can be restored with mysql CLI |
master-key.enc | Master encryption key encrypted with PBKDF2 + AES-256-GCM using your backup password |
config.json | Application configuration snapshot (no secrets) |
manifest.json | Backup metadata — version, timestamp, asset count, table row counts, options used |
Backup Sizing Guide
| Data | Typical Size (10K assets) |
|---|---|
| Assets + identifiers + IPs | ~50 MB |
| Relationships | ~20 MB |
| Software packages + services + processes | ~200 MB |
| Discovery runs + evidence | ~100 MB |
| Total (without flows) | ~400 MB |
| Flow data (flow_raw) | 1-50 GB (depends on traffic) |
Worker Agent Backup
Worker agents store data independently. To back up a worker:
- Stop the worker agent service
- Copy the
./data/directory (contains H2 database andworker.key) - Restart the worker agent
The worker.key file is critical — without it, the worker cannot decrypt its locally stored credentials.