Skip to content

Long-term archives

PITR covers the last 30 days. For anything older — or for compliance retention — take a manual archive. PerSQL dumps the schema + data and stores it in Cloudflare R2.

Archives live in the Backups tab on each database, alongside snapshots and PITR.

  • Manual — anyone with manage permission can hit Archive now to take an out-of-band archive.
  • From CI — POST /api/namespaces/:ns/databases/:db/archives from a release pipeline if you want a durable copy at every cut.

There is no platform-managed daily sweep. If you need durable periodic backups, schedule a job (or your CI) to call the POST endpoint on the cadence you want.

  • Archives stay in R2 until you delete them (DELETE on the row).
  • R2 storage is metered as part of your namespace’s per-GB usage.
  • For longer retention, download the SQL to your own storage — the file is portable to any SQLite tool.

We don’t (yet) one-click restore an archive in place. The path is:

  1. Click Download on the archive — you get a .sql file.
  2. Open the Data card on the database’s Overview tab.
  3. Click Import SQL and pick the file.

This is intentional: restoring an archive replaces the schema, so we want the user to actively pick the destination.

MethodPath
GET/api/namespaces/:ns/databases/:db/archives
POST/api/namespaces/:ns/databases/:db/archives
GET/api/namespaces/:ns/databases/:db/archives/:id/download
DELETE/api/namespaces/:ns/databases/:db/archives/:id

POST and DELETE are manage-only. Download requires read access.

  • The dump is not encrypted at rest (R2’s standard encryption applies). If you need customer-managed keys, dump locally and re-upload.