Files
2025-11-30 09:06:02 +08:00

1.4 KiB

Backups API

Overview

PocketBase ships with a Backups API for full database snapshots. It is distinct from the per-collection import/export workflows described in Data Migration Workflows. Use backups for disaster recovery or environment cloning; use targeted migrations when you need fine-grained control over specific collections.

List Backups

GET /api/backups
Authorization: Bearer {admin_token}

Create Backup

POST /api/backups
Content-Type: application/json
Authorization: Bearer {admin_token}

{
  "name": "backup-2024-01-01"
}

Download Backup

GET /api/backups/{backupId}/download
Authorization: Bearer {admin_token}

Upload Backup

POST /api/backups/upload
Content-Type: multipart/form-data
Authorization: Bearer {admin_token}

file: backup.sql

Restore Backup

POST /api/backups/{backupId}/restore
Authorization: Bearer {admin_token}

Best practices

  • Schedule backups before and after running large data migrations.
  • Store backups off the instance (object storage or encrypted volumes) and version them alongside schema migrations.
  • To restore into a clean instance and then migrate selective collections, combine this API with the targeted tools documented in Data Migration Workflows.

See also core/going_to_production.md for operational guidance.