Creating Backups

Create manual backups of your Supabase projects.

Create backups of your Supabase projects to protect against data loss.

Backup Types

TypeIncludesUse Case
fullDatabase, storage, functions, configComplete project backup
databasePostgreSQL database onlyData backup
storageFile storage onlyMedia files backup
functionsEdge functions onlyCode backup
configProject configurationSettings backup

Create Backup via Web UI

  1. Navigate to Backups
  2. Click Create Backup
  3. Select the project
  4. Choose backup type
  5. Select destination (local or cloud)
  6. Optionally enable encryption
  7. Click Create Backup

Create Backup via API

curl -X POST https://supascale.example.com/api/v1/backups \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "my-project",
    "type": "full",
    "destination": "local",
    "encrypt": false
  }'

Response:

{
  "success": true,
  "backup": {
    "id": "backup-123",
    "projectId": "my-project",
    "type": "full",
    "status": "completed",
    "path": "/backups/my-project/2026-01-19-full.tar.gz",
    "size": 52428800,
    "duration": 45,
    "createdAt": "2026-01-19T12:00:00Z"
  }
}

Backup to Cloud Storage

Store backups in configured cloud storage:

curl -X POST https://supascale.example.com/api/v1/backups \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "my-project",
    "type": "full",
    "destination": "s3"
  }'

The backup will be uploaded to your default cloud storage provider.

Encrypted Backups

Enable encryption for sensitive data:

curl -X POST https://supascale.example.com/api/v1/backups \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "my-project",
    "type": "full",
    "destination": "local",
    "encrypt": true
  }'

Store your encryption password securely. Without it, encrypted backups cannot be restored.

Backup Contents

Full Backup

my-project-2026-01-19-full.tar.gz
├── database/
│   └── database.sql          # PostgreSQL dump
├── storage/
│   └── ...                   # All storage files
├── functions/
│   └── ...                   # Edge function code
├── config/
│   ├── docker-compose.yml
│   └── .env
└── metadata.json             # Backup metadata

Database Backup

my-project-2026-01-19-database.tar.gz
├── database.sql              # PostgreSQL dump
└── metadata.json

Storage Backup

my-project-2026-01-19-storage.tar.gz
├── storage/
│   ├── bucket1/
│   └── bucket2/
└── metadata.json

List Backups

Via Web UI

Navigate to Backups to see all backups.

Via API

# All backups
curl https://supascale.example.com/api/v1/backups \
  -H "X-API-Key: your-api-key"

# Filter by project
curl "https://supascale.example.com/api/v1/backups?projectId=my-project" \
  -H "X-API-Key: your-api-key"

# Include statistics
curl "https://supascale.example.com/api/v1/backups?stats=true" \
  -H "X-API-Key: your-api-key"

Response:

{
  "backups": [
    {
      "id": "backup-123",
      "projectId": "my-project",
      "type": "full",
      "status": "completed",
      "size": 52428800,
      "createdAt": "2026-01-19T12:00:00Z"
    }
  ],
  "pagination": {
    "total": 15,
    "limit": 50,
    "offset": 0
  }
}

Download Backup

Via Web UI

  1. Find the backup
  2. Click Download

Via API

curl https://supascale.example.com/api/v1/backups/backup-123/download \
  -H "X-API-Key: your-api-key" \
  -o backup.tar.gz

Delete Backup

Via Web UI

  1. Find the backup
  2. Click Delete
  3. Confirm deletion

Via API

curl -X DELETE https://supascale.example.com/api/v1/backups/backup-123 \
  -H "X-API-Key: your-api-key"

Backup Best Practices

Regular Backups

  • Production: Daily full backups
  • Staging: Weekly full backups
  • Development: As needed

Retention Policy

  • Keep 7 daily backups
  • Keep 4 weekly backups
  • Keep 12 monthly backups

Testing Backups

Periodically test restores:

  1. Restore to a test project
  2. Verify data integrity
  3. Document restore time

Off-Site Storage

  • Store backups in cloud storage
  • Use different region than production
  • Enable versioning for additional protection

Troubleshooting

Backup Failed

  1. Check disk space: df -h
  2. Verify project is running
  3. Check Supascale logs
  4. Ensure database is accessible

Backup Taking Too Long

  1. Consider partial backups (database only)
  2. Check disk I/O performance
  3. Reduce backup during low-traffic periods

Large Backup Size

  1. Clean up unused storage files
  2. Use database-only backups more frequently
  3. Enable compression (default)