Pick a time or a version
| Option | What you get |
|---|---|
--time (time) |
The newest version at or before an RFC 3339 time, in UTC with Z or with an offset such as +01:00 |
--version (version) |
One exact version, by its number from litebackup versions |
| Neither | The newest version |
A restore writes a new file and never overwrites one. Its directory must exist. It runs SQLite's quick_check before it finishes.
Put it back
Open the restored file and look before you replace anything. If you need only a few rows, Recover deleted SQLite rows copies them across while your app runs.
To replace the whole database:
- Stop your app, so nothing has the database open.
- Rename the old file and its
-waland-shmfiles. - Move the restored file into place, and start your app.
Keep the old file until you are sure. It holds everything written after the moment you restored.
How far back you can go
You choose how long versions are kept in the console, under How long to keep backups. Every change is a version, so within that window you can go back to within seconds of any moment.
Restore without continuous backup
With copies from .backup, VACUUM INTO, or snapshots, you can go back only to a moment you copied. Restore the newest copy from before the mistake. Writes between that copy and the mistake are lost.
Next time
- How to back up SQLite compares the ways to back up.
- Recover deleted SQLite rows to bring back a few rows or a table.
- The command line and the SDK list every option.
Get started
Install your Litebackup server and back up a first database in minutes: get started, or see pricing.