Skip to main content
Multilingual TursoDB, MVCC & AI Agent database guides Read Engine Guide →
Turso Cloud Turso Cloud

Point-in-Time Recovery

Point-in-Time Recovery — Turso documentation.

Turso supports point-in-time recovery (PITR) for databases. PITR allows you to restore a database to a specific point in time. This is useful for recovering from user errors, such as dropping a table by mistake.

NOTE

Backups are created automatically at COMMIT. Free plan users can restore to any point in time within the last 24 hours. Developer, Scaler, and Pro users can restore to any point in time within the last 10, 30, or 90 days, respectively.

NOTE

PITR restores an existing database — it cannot bring back a database that was deleted. On paid plans, deleted databases can be restored for up to five days: see Recover Deleted Databases.

How it works

  1. You create a new database from the existing database using the CLI or API.
  2. You update your application to use the new database connection string.
  3. You delete the old database when you no longer need it.

Usage

turso db create my-new-database --from-db my-existing-database --timestamp 2024-01-01T00:00:00Z
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
  -H 'Authorization: Bearer TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
      "name": "new-database",
      "group": "default",
      "seed": {
        "type:": "database",
        "name": "my-existing-database",
        "timestamp": "2024-01-01T00:00:00Z"
      }
  }'

Refer to the following references for more details about all arguments:

Things to know

  • Restoring from a PITR creates a new database. You will need to update your application to use the new database connection string.
  • You cannot restore from a PITR to a database that already exists.
  • You will need to create a new token (or use a group token) to connect to the new database.
  • You will need to manually delete the old database when you no longer need it.
  • Restores count towards your plan’s database quota.
Synced from official Turso documentation ( tursodatabase/turso-docs · MIT License) Official Docs ↗
Search
Press Esc to close · Powered by Pagefind