Backups
Overview

Backups Overview

Cloudheed automatically backs up your databases daily and provides manual backup options.

Automatic Backups

All databases include automatic daily backups:

TierRetentionFrequency
Free1 dayDaily
Micro7 daysDaily
Small+14 daysDaily
Large+30 daysDaily

List Backups

GET /v1/databases/{id}/backups

curl https://api.cloudheed.com/v1/databases/db-abc123/backups \
  -H "Authorization: Bearer YOUR_TOKEN"

Response:

{
  "backups": [
    {
      "id": "backup-123",
      "database_id": "db-abc123",
      "type": "automatic",
      "status": "completed",
      "size_bytes": 1073741824,
      "created_at": "2026-03-17T03:00:00Z",
      "expires_at": "2026-03-24T03:00:00Z"
    },
    {
      "id": "backup-122",
      "database_id": "db-abc123",
      "type": "manual",
      "status": "completed",
      "size_bytes": 1073741824,
      "created_at": "2026-03-16T15:30:00Z",
      "expires_at": null
    }
  ]
}

Create Manual Backup

POST /v1/databases/{id}/backups

curl -X POST https://api.cloudheed.com/v1/databases/db-abc123/backups \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "pre-migration-backup"
  }'

Response:

{
  "id": "backup-124",
  "database_id": "db-abc123",
  "name": "pre-migration-backup",
  "type": "manual",
  "status": "in_progress",
  "created_at": "2026-03-17T10:00:00Z"
}

Manual backups don't expire and count toward your storage quota.

Restore from Backup

POST /v1/databases/{id}/backups/{backup_id}/restore

curl -X POST https://api.cloudheed.com/v1/databases/db-abc123/backups/backup-123/restore \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "target_database_name": "restored-db"
  }'

Parameters

FieldTypeRequiredDescription
target_database_namestringNoName for restored database (default: original name + timestamp)
⚠️

Restoring creates a new database. The original database remains unchanged.

Delete Backup

DELETE /v1/databases/{id}/backups/{backup_id}

curl -X DELETE https://api.cloudheed.com/v1/databases/db-abc123/backups/backup-124 \
  -H "Authorization: Bearer YOUR_TOKEN"
🚫

Only manual backups can be deleted. Automatic backups are managed by the system.

Backup Status Values

StatusDescription
pendingBackup scheduled
in_progressBackup is running
completedBackup successful
failedBackup failed

Best Practices

  1. Create manual backups before migrations - Always backup before schema changes
  2. Test restores regularly - Verify backups work by restoring to a test database
  3. Monitor backup status - Set up alerts for failed backups
  4. Consider PITR - For critical databases, enable Point-in-Time Recovery