Restoring Backups
Restore Supabase projects from backups.
Learn how to restore your Supabase projects from backups when needed.
Before Restoring
Restoring overwrites existing data. Always verify you're restoring to the correct project.
Pre-Restore Checklist
- [ ] Confirm backup is the correct one
- [ ] Note the backup date and type
- [ ] Consider backing up current state first
- [ ] Stop the project before restore (recommended)
- [ ] Notify users of downtime
Restore via Web UI
- Navigate to Backups
- Find the backup to restore
- Click Restore
- Select restore options:
- Project to restore to
- What to restore (all or partial)
- Confirm and start restore
Restore via API
Full Restore
Restore everything in the backup:
curl -X POST https://supascale.example.com/api/v1/backups/backup-123/restore \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"restoreTypes": ["full"]
}'
Response:
{
"success": true,
"restore": {
"backupId": "backup-123",
"projectId": "my-project",
"duration": 180,
"restoredAt": "2026-01-19T12:00:00Z",
"warnings": []
}
}
Partial Restore
Restore specific components:
# Database only
curl -X POST https://supascale.example.com/api/v1/backups/backup-123/restore \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"restoreTypes": ["database"]
}'
# Multiple components
curl -X POST https://supascale.example.com/api/v1/backups/backup-123/restore \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"restoreTypes": ["database", "storage"]
}'
Available restore types:
full- Everythingdatabase- PostgreSQL databasestorage- File storagefunctions- Edge functionsconfig- Project configuration
Force Restore
Override safety checks:
curl -X POST https://supascale.example.com/api/v1/backups/backup-123/restore \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"restoreTypes": ["full"],
"forceRestore": true
}'
Force restore skips validation. Use only when you're certain about the restore.
Restore to Different Project
You can restore a backup to any project, not just the original:
Via Web UI
- Navigate to Backups
- Find the backup to restore
- Click Restore
- In the "Restore To" dropdown, select a different project
- Select components to restore
- Confirm and start restore
Via API
Specify targetProjectId to restore to a different project:
curl -X POST https://supascale.example.com/api/v1/backups/backup-123/restore \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"restoreTypes": ["database", "storage", "functions"],
"targetProjectId": "new-project"
}'
The target project must be running for database restore. Storage and functions can be restored regardless of project status.
Import from External Sources
To migrate from Supabase Cloud or import external backups, use the Import / Migrate feature:
- Navigate to Backups → Import / Migrate
- Select a target project
- Upload files for each component:
- Database:
.sql,.dump, or.gzfile - Storage:
.zipor.tar.gzarchive - Functions:
.zipor.tar.gzarchive
- Database:
Via API
# Import database dump curl -X POST https://supascale.example.com/api/v1/projects/my-project/import/database \ -H "X-API-Key: your-api-key" \ -F "[email protected]" # Import storage files curl -X POST https://supascale.example.com/api/v1/projects/my-project/import/storage \ -H "X-API-Key: your-api-key" \ -F "[email protected]" # Import Edge Functions curl -X POST https://supascale.example.com/api/v1/projects/my-project/import/functions \ -H "X-API-Key: your-api-key" \ -F "[email protected]"
See the Backups API documentation for full details.
Restore Encrypted Backups
Encrypted backups require the encryption password:
curl -X POST https://supascale.example.com/api/v1/backups/backup-123/restore \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"restoreTypes": ["full"],
"encryptionPassword": "your-backup-password"
}'
Restore Process
What Happens During Restore
- Validation - Verify backup integrity
- Stop project (if running)
- Database restore - Import SQL dump
- Storage restore - Copy files
- Config restore - Update configuration
- Start project (if was running)
- Verify - Health checks
Estimated Restore Times
| Backup Size | Estimated Time |
|---|---|
| < 1 GB | 1-5 minutes |
| 1-10 GB | 5-30 minutes |
| 10-50 GB | 30-120 minutes |
| > 50 GB | 2+ hours |
Verify Restore
After restore, verify:
1. Check Project Status
curl https://supascale.example.com/api/v1/projects/my-project/status \ -H "X-API-Key: your-api-key"
2. Verify Database
Connect to database and check:
- Tables exist
- Row counts are expected
- Recent data is present
3. Check Storage
Verify files are accessible:
- List storage buckets
- Download a test file
4. Test Application
- Load your application
- Test key functionality
- Verify authentication works
Rollback
If restore causes issues:
- If you backed up before restore, restore that backup
- If not, check for earlier backups
- Contact support if data loss occurred
Troubleshooting
"Backup not found"
- Verify backup ID is correct
- Check backup wasn't deleted
- Ensure backup is accessible (cloud storage)
"Restore failed - database error"
- Check PostgreSQL logs
- Verify database version compatibility
- Check for schema conflicts
- Try database-only restore first
"Restore failed - permission denied"
- Verify file permissions
- Check disk space
- Ensure Supascale has write access
"Project won't start after restore"
- Check container logs
- Verify configuration is valid
- Check environment variables
- Try manual start with logs
Disaster Recovery Plan
Recommended Steps
- Regular backups - Daily full, hourly database
- Off-site storage - Cloud storage in different region
- Test restores - Monthly restore tests
- Document process - Written recovery procedures
- RTO/RPO targets - Define acceptable downtime/data loss
Recovery Time Objective (RTO)
| Tier | RTO | Strategy |
|---|---|---|
| Critical | < 1 hour | Hot standby, frequent backups |
| Important | < 4 hours | Warm standby, hourly backups |
| Standard | < 24 hours | Daily backups, tested recovery |