Overview
The Backup API provides manual database backup management. Backups are SQLite database snapshots stored in thebackups/ directory adjacent to the main database.
Backup files are named mc-backup-YYYY-MM-DD_HH-MM-SS.db and are automatically pruned to maintain the configured retention count (default: 10 backups).
Database Backup Procedure
Mission Control uses SQLite’s built-in backup API to create consistent point-in-time snapshots:- Backup is initiated via API or scheduler
- SQLite performs a hot backup (database remains online)
- Backup file is written to
backups/mc-backup-{timestamp}.db - File size and path are logged to audit trail
- Old backups are automatically pruned if count exceeds retention limit
- Response includes backup metadata (name, size, timestamp)
List Backups
Retrieve a list of all available backup files sorted by creation time (newest first).Response
Absolute path to the backup directory
Example Response
Create Backup
Manually trigger a database backup. This creates an immediate snapshot of the current database state.Response
Whether the backup was created successfully
Example Response
Automatic Pruning
After creating a backup, the system automatically prunes old backups to maintain the configured retention count:- Lists all backup files in the backup directory
- Sorts by modification time (newest first)
- Deletes files beyond the retention limit (default: 10)
- Retention count is configured via
general.backup_retention_countsetting
Delete Backup
Remove a specific backup file. Useful for managing disk space or removing outdated backups.Request Body
Backup filename to delete. Must be a valid
.db file without path traversal characters.Response
Whether the backup was deleted successfully
Security
The API validates backup names to prevent path traversal attacks:- Must end with
.db - Cannot contain
/or.. - Must exist in the backup directory
Automated Backups
For automated daily backups, use the Scheduler API:-
Enable auto-backup via Settings API:
- Backups will run daily at 3:00 AM UTC
-
Monitor backup status via Scheduler API:
-
Manually trigger a backup:
Error Responses
400 Bad Request
Invalid backup name (missing, contains invalid characters, or wrong extension)
401 Unauthorized
User is not authenticated. Check session cookie.
403 Forbidden
User does not have admin role. Only admins can manage backups.
404 Not Found
Backup file not found (DELETE only)
429 Too Many Requests
Rate limit exceeded. Wait before creating another backup.
500 Internal Server Error
Backup operation failed. Check server logs for details.
Backup Best Practices
- Enable Auto-Backup: Turn on
general.auto_backupfor daily snapshots - Monitor Disk Space: Adjust
general.backup_retention_countbased on available storage - Test Restores: Periodically verify backup integrity by testing restoration
- Off-Site Storage: Copy backups to external storage for disaster recovery
- Before Updates: Always create a manual backup before system upgrades
Restoring from Backup
To restore from a backup:- Stop the Mission Control service
- Locate the backup file in the
backups/directory - Replace the main database file with the backup:
- Restart the service
- Verify data integrity via the UI or API