Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Automated Backups

Daily automated backups for all cloud databases.

Overview

Postbase automatically backs up all cloud databases:

  • Schedule: Daily at 3:00 AM UTC
  • Format: pg_dump custom format
  • Compression: gzip
  • Storage: Cloudflare R2 (zero egress fees)

Retention Policy

TierRetentionStorage
Free3 days10 GB
Pro30 days100 GB

Old backups are automatically deleted after the retention period.

Viewing Backups

CLI

postbase cloud backups list -p myapp -d production

Output:

Backups for production
 
ID                             TYPE        STATUS      SIZE       CREATED                EXPIRES
bkp_D3uqtMIZ...               automated   completed   12.5 MB    2026-01-25 03:00:00   2026-01-28
bkp_K9Rvw2Hx...               automated   completed   12.3 MB    2026-01-24 03:00:00   2026-01-27
bkp_P7nFqLmA...               automated   completed   12.1 MB    2026-01-23 03:00:00   2026-01-26
 
Total: 3 automated backups

API

curl -H "Authorization: Bearer $TOKEN" \
  https://api.postbase.sh/projects/myapp/databases/production/backups

Backup Contents

Each backup includes:

  • Schema: All tables, indexes, constraints, views, functions
  • Data: All table rows
  • Permissions: GRANT statements
  • Extensions: Enabled extensions

Not included:

  • Connection settings
  • Runtime configuration
  • Active connections
  • Temporary tables

Backup Storage

Backups are stored in Cloudflare R2:

postbase-backups/
├── proj_xxx/
│   ├── db_production/
│   │   ├── bkp_D3uqtMIZ.dump.gz
│   │   ├── bkp_K9Rvw2Hx.dump.gz
│   │   └── bkp_P7nFqLmA.dump.gz
│   └── db_staging/
│       └── bkp_Abc123.dump.gz

Monitoring Backups

Check Recent Backups

# List last 7 days
postbase cloud backups list -p myapp -d production --days 7

Verify Backup Completed

# Check specific backup
postbase cloud backups info bkp_D3uqtMIZ -p myapp -d production

Output:

Backup Details
 
ID:       bkp_D3uqtMIZXOoU_WPo2gbi3_xu
Type:     automated
Status:   completed
Size:     12.5 MB
Database: production
 
Created:  2026-01-25 03:00:00 UTC
Expires:  2026-01-28 03:00:00 UTC
 
Duration: 45 seconds

Backup Notifications

Webhook (Coming Soon)

Configure webhooks for backup events:

{
  "event": "backup.completed",
  "backup_id": "bkp_D3uqtMIZ...",
  "database": "production",
  "status": "completed",
  "size_bytes": 13107200,
  "timestamp": "2026-01-25T03:00:45Z"
}

Email Alerts (Coming Soon)

Receive email notifications for:

  • Backup failures
  • Storage quota warnings
  • Retention expiration

Backup Performance

Typical Backup Times

Database SizeBackup Time
< 1 GB< 1 minute
1-10 GB1-5 minutes
10-50 GB5-15 minutes
> 50 GBContact support

Impact on Database

Automated backups use:

  • pg_dump with custom format
  • Minimal locking (consistent snapshot)
  • Background priority

Impact:

  • Negligible for most workloads
  • May increase I/O during backup
  • No locks on tables (MVCC snapshot)

Restoring from Backup

Via CLI

# Restore to same database
postbase cloud backups restore bkp_D3uqtMIZ \
  -p myapp -d production --force
 
# Restore to different database
postbase cloud backups restore bkp_D3uqtMIZ \
  -p myapp -d production-restored

What Restore Does

  1. Downloads backup from R2
  2. Stops active connections (if --force)
  3. Drops existing data
  4. Runs pg_restore
  5. Rebuilds indexes
  6. Restores permissions

Restore Duration

Backup SizeRestore Time
< 1 GB< 2 minutes
1-10 GB2-10 minutes
10-50 GB10-30 minutes

Downloading Backups

Download via CLI

postbase cloud backups download bkp_D3uqtMIZ \
  -p myapp -d production \
  -o ./backup-2026-01-25.dump

Download via API

# Get download URL
curl -H "Authorization: Bearer $TOKEN" \
  https://api.postbase.sh/projects/myapp/databases/production/backups/bkp_D3uqtMIZ/download

Response:

{
  "download_url": "https://r2.postbase.sh/...",
  "expires_at": "2026-01-25T04:00:00Z"
}

Local Restore

Restore downloaded backup locally:

# Decompress
gunzip backup-2026-01-25.dump.gz
 
# Restore
pg_restore -d myapp backup-2026-01-25.dump

Troubleshooting

Backup Failed

If automated backup fails:

  1. Check database is running
  2. Check storage quota
  3. Check backup service health
postbase cloud pitr service-status -p myapp -d production

Large Database Timeout

For databases >50GB, contact support for:

  • Extended timeout
  • Dedicated backup window
  • Parallel backup configuration

Missing Backup

If expected backup is missing:

  1. Check backup ran (may be delayed)
  2. Check retention (may have expired)
  3. Check manual deletion
# Check all backups including deleted
postbase cloud backups list -p myapp -d production --include-deleted