Point-in-Time Recovery
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.
Backups are created automatically at COMMIT
. Free plan users can restore to any point in time within the last 24 hours. Hobby, Scaler, and Pro users can restore to any point in time within the last 10, 30, or 90 days, respectively.
How it works
- You create a new database from the existing database using the CLI or API.
- You update your application to use the new database connection string.
- You delete the old database when you no longer need it.
The newly created database includes data only from periods prior to the specified timestamp. Additionally, there may be a gap of up to 15 seconds in the data immediately preceding the timestamp, as this depends on the timing of Turso’s most recent periodic batch checkpoint.
Usage
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.
Was this page helpful?