Skip to main content
All backup endpoints require admin role. Unauthorized users will receive a 403 Forbidden response.

Overview

The Backup API provides manual database backup management. Backups are SQLite database snapshots stored in the backups/ 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:
  1. Backup is initiated via API or scheduler
  2. SQLite performs a hot backup (database remains online)
  3. Backup file is written to backups/mc-backup-{timestamp}.db
  4. File size and path are logged to audit trail
  5. Old backups are automatically pruned if count exceeds retention limit
  6. Response includes backup metadata (name, size, timestamp)
Backups capture all tables including agents, tasks, activities, audit logs, and system settings.

List Backups

Retrieve a list of all available backup files sorted by creation time (newest first).

Response

array
Array of backup file metadata
string
required
Backup filename (e.g., mc-backup-2026-03-04_03-00-00.db)
integer
required
File size in bytes
integer
required
Unix timestamp of backup creation
string
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

boolean
required
Whether the backup was created successfully
object
required
Metadata of the newly created backup
string
required
Backup filename
integer
required
File size in bytes
integer
required
Unix timestamp of creation

Example Response

Backup creation is rate-limited to prevent system overload. The default limit allows 10 backups per hour per admin user.

Automatic Pruning

After creating a backup, the system automatically prunes old backups to maintain the configured retention count:
  1. Lists all backup files in the backup directory
  2. Sorts by modification time (newest first)
  3. Deletes files beyond the retention limit (default: 10)
  4. Retention count is configured via general.backup_retention_count setting

Delete Backup

Remove a specific backup file. Useful for managing disk space or removing outdated backups.

Request Body

string
required
Backup filename to delete. Must be a valid .db file without path traversal characters.

Response

boolean
required
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
Deletion is logged to the audit trail with the admin username and deleted filename.

Automated Backups

For automated daily backups, use the Scheduler API:
  1. Enable auto-backup via Settings API:
  2. Backups will run daily at 3:00 AM UTC
  3. Monitor backup status via Scheduler API:
  4. Manually trigger a backup:
See Scheduler API for more details on automated backup configuration.

Error Responses

Invalid backup name (missing, contains invalid characters, or wrong extension)
User is not authenticated. Check session cookie.
User does not have admin role. Only admins can manage backups.
Backup file not found (DELETE only)
Rate limit exceeded. Wait before creating another backup.
Backup operation failed. Check server logs for details.

Backup Best Practices

  1. Enable Auto-Backup: Turn on general.auto_backup for daily snapshots
  2. Monitor Disk Space: Adjust general.backup_retention_count based on available storage
  3. Test Restores: Periodically verify backup integrity by testing restoration
  4. Off-Site Storage: Copy backups to external storage for disaster recovery
  5. Before Updates: Always create a manual backup before system upgrades

Restoring from Backup

To restore from a backup:
  1. Stop the Mission Control service
  2. Locate the backup file in the backups/ directory
  3. Replace the main database file with the backup:
  4. Restart the service
  5. Verify data integrity via the UI or API