Backups and restore
Backups run automatically. You do not schedule them or configure a retention period from the CLI or the dashboard.
What is kept
Section titled “What is kept”- A full backup runs every day, at the hour the database node is configured for.
- The write-ahead log is copied continuously. Together with the full backups, it makes a point-in-time restore possible.
- Backups are encrypted and stored away from the database server.
- Backups are kept for seven days.
The restore window starts at the earliest full backup that has been verified. A database that was just created has no restore points until its first full backup finishes. The dashboard shows Backups initializing on the database’s Backups tab until then.
The restore window
Section titled “The restore window”You can restore to any second inside the window. To see it:
- Dashboard: Databases → your database → Backups. The page says “Restore to any second between … and …”.
- CLI:
leaf db info <name>shows Last backup, Restorable to and Backup state. - JSON:
leaf db info <name> --jsonhasbackup_window.fromandbackup_window.to, in Unix seconds.
A database that sleeps has a restore point at the moment it went to sleep, because that is the last change that reached the backup repository. See Sleep when idle.
Restore to a new database
Section titled “Restore to a new database”A restore creates a separate database. The original keeps running and keeps its data, hostname and connections. The new database has the same engine, version, plan, city and access list as the source, and a new password. Your database quota and the server’s capacity apply to the new database, so a restore can be refused when there is no room for it.
Dashboard: Databases → your database → Backups → Restore to a new database. Enter a name, choose Latest available, Earliest available or Choose a time (an RFC 3339 time), then Restore.
CLI:
leaf db restore shop --to latest --name shop-restoredleaf db restore shop --to 2026-11-18T09:30:00Z --name shop-before-import--to accepts latest, an RFC 3339 time, or Unix seconds. --name is the new database’s name: 1 to 63
lowercase letters, digits or hyphens, starting with a letter or digit.
The command returns when the restore is accepted. The new database appears in leaf db list and
leaf db info <new-name> shows when it is running. Then connect to it with leaf db connect <new-name>.
A restore either contains every committed transaction up to the chosen time, or it fails. It does not report success while short of the target.
Refusals
Section titled “Refusals”| Message | Cause | What to do |
|---|---|---|
Backups are initializing | The first full backup has not finished. | Wait for the Backups tab to show a restore window. |
No restorable backup | There is no verified backup yet, or the database has none. | Wait, or check the Backups tab for an error. |
Time is outside the backup window | The chosen time is older than the earliest restore point. | Pick a time inside the window. |
Pick a time up to <time> | The chosen time is later than the newest restore point. | Pick an earlier time, or use latest. |
The latest backup is still being uploaded. Try again in a minute. | The newest full backup is still being copied to the repository. | Wait a minute and retry. |
Backups always run from the database’s current primary, and a restore works across a failover. See Multi-AZ.