Skip to content

Backups

StarkOne provides multiple backup mechanisms at different granularities.

System Backup (Panel Configuration)

Full panel backup - includes the SQLite database, configuration files, and settings.

# List backups
GET /api/system/backup

# Create backup
POST /api/system/backup

# Download backup
GET /api/system/backup/download/:filename

# Restore from backup
POST /api/system/backup/restore/:filename

# Delete backup
DELETE /api/system/backup/:filename

# Upload an existing backup file
POST /api/system/backup/upload
Content-Type: multipart/form-data

# Pull backups from S3
POST /api/system/backup/pull-s3

All system backup endpoints require superuser.

S3 Backup Settings

GET /api/settings/backup/test-s3
POST /api/settings/backup/test-s3
{
  "endpoint": "https://s3.amazonaws.com",
  "bucket": "starkone-backups",
  "access_key": "...",
  "secret_key": "...",
  "region": "us-east-1"
}

Backup Encryption

POST /api/settings/backup/generate-key   # Generate encryption key
POST /api/settings/backup/get-key        # Retrieve encryption key
POST /api/settings/backup/disable-encryption  # Disable encryption

Website Backups (Duplicity)

Per-website file backups using Duplicity. Supports incremental backups and point-in-time restore.

# List available backups for a website
GET /api/webapps/:id/backups

# Create a backup
POST /api/webapps/:id/backups

# Get backup progress
GET /api/webapps/:id/backups/progress

# Restore (specify a timestamp)
POST /api/webapps/:id/backups/restore
{
  "date": "2024-01-15T10:00:00Z"
}

# Manage backup sets
POST /api/webapps/:id/backup-sets
DELETE /api/webapps/:id/backup-sets/:set

Webapp Backup Scan & Restore (Admin)

GET /api/settings/backup/webapp-scan
POST /api/settings/backup/webapp-restore
POST /api/settings/backup/webapp-restore-all
GET /api/settings/backup/webapp-restore-progress

LVM Snapshots

Block-device level snapshots. Fastest type of backup - typically takes less than 1 second.

GET /api/system/snapshots
POST /api/system/snapshots { "name": "pre-upgrade" }
POST /api/system/snapshots/:name/restore
DELETE /api/system/snapshots/:name

See LVM Snapshots for details.

Pre-Upgrade Recommendation

Always take an LVM snapshot before major upgrades or migrations. Restoring takes under a minute and recovers the entire server state.

MySQL Database Backups

# Export a single database
POST /api/databases/:id/export
GET /api/databases/:id/download

# Or via CLI
starkone-cli db export <db_name> --output /backups/db.sql.gz

Best Practices

  1. Schedule daily website backups using cron + Duplicity
  2. Weekly LVM snapshots for fast disaster recovery
  3. Regular system backups to S3 for off-site protection
  4. Test restores periodically - backups are only useful if they can be restored