Skip to content

Help

Point-in-time recovery (PITR)

Tested with:Databasezy API v1 · zb CLI 0.1

Point-in-time recovery restores changes up to a target inside the available archived window, not just to the moment a backup was taken. Recovery granularity depends on the engine; libSQL archives in five-second batches. It needs continuous archiving of the database’s changes, so it is available only for PostgreSQL, TimescaleDB, MySQL, MariaDB (both single node), libSQL and MongoDB. The Enterprise plan includes a 35-day window; on Solo and Team you add it per instance with the point-in-time recovery add-on (below). For every other engine and plan, restore the nearest backup instead (see Restore a backup).

Volume checkpoints provide a separate short-lived capture on eligible PostgreSQL/TimescaleDB instances when CSI support is configured. They briefly make the primary read-only during capture and roll back only to that capture, rather than to a timestamp between captures. They do not enable continuous archiving or extend the PITR window. Checkpoint deployment/runtime acceptance is pending and the instance reports its own availability.

shell
zb backups pitr-window <instance_id>

If it is available, you see the window:

point-in-time recovery: 2026-09-10T08:00:00Z .. 2026-10-13T09:41:12Z (35 days)

If not, the CLI prints the reason:

ReasonMeaning
<engine> has no continuous archivingThe engine has no PITR. Only PostgreSQL, TimescaleDB, MySQL, MariaDB, libSQL and MongoDB do
plan <plan> does not include PITR; add the point-in-time recovery add-onSolo or Team without the add-on: add it (below)
the point-in-time recovery add-on was turned off at ...The add-on is off; restores up to that moment stay possible until its window ages out
PITR is disabled in the backup settingsIt was turned off for this instance. Turn it on with zb backups settings <instance_id> --pitr true

The portal shows the same window under Backups → Point-in-time recovery.

Add point-in-time recovery to a Solo or Team instance

Section titled “Add point-in-time recovery to a Solo or Team instance”

Open the instance’s Backups page and choose Add point-in-time recovery, or call the API:

shell
curl -X PUT "https://api.databasezy.com/v1/orgs/$ORG/instances/<instance_id>/addons/pitr" \
-H "Authorization: Bearer $ZB_API_KEY" -H "Content-Type: application/json" \
-d '{"enabled": true, "days": 7}'
  • It costs $100 a month per instance for every 7 days of window, billed hourly as pitr_7d_hours from the moment you turn it on until you turn it off. Solo can buy 7 days, Team 7 or 14.
  • It needs the backups:write permission and instances:operate on the instance’s project.
  • Archiving starts when you turn it on, so the window begins then: restore from a backup taken after that (take a manual one with zb backups create <instance_id> if you do not want to wait for the daily backup).
  • Turning it off ({"enabled": false}) stops the charge and the archiving at once. Restores up to that moment stay possible for the window you had (the API returns restorable_until); then the archives are deleted.
  • It is refused on Free (402 plan_limit), on Enterprise (already included, 409), on engines without continuous archiving and on MySQL or MariaDB HA instances (422), and when the instance’s backup retention is shorter than the window (raise retention_days first).
  • Moving the organization to Free turns every add-on off.

PITR starts from a base backup and replays changes up to the time you choose. Pick the most recent completed backup that finished before your target time, then give the time in RFC 3339 format, in UTC:

shell
zb backups list <instance_id>
zb backups restore <instance_id> <backup_id> --at "2026-10-12T14:59:00Z" --name orders-before-delete

The restore goes into a new instance by default, so the original keeps running. Check the data there, then copy back what you need with zb migrate --from <restored_id> --to <original_id>, or point your application at the restored instance. See Restore a backup for following a restore and its other errors.

  • Use a time just before the bad change, for example a few seconds before an accidental DELETE.
  • All times are UTC. Convert from your local time zone first; this is the most common mistake.
  • Your application logs, or the organization audit log for changes made through Databasezy, can help you find the moment.
  • Not sure? Preview the point in time first (PostgreSQL and TimescaleDB): a read-only copy you can query before you restore anything.
ErrorWhat to do
--at `...` is not RFC 3339 (2026-09-01T12:00:00Z)Use the full format with a Z or an offset
must not be in the futureChoose a time up to now
outside the N-day PITR window (earliest ...)The time is older than the window. Restore the nearest backup instead
before the selected backup finished (...); pick an earlier backupChoose a backup that finished before your target time
point-in-time recovery is not available for <engine>The engine has no PITR. Restore a backup
point-in-time recovery is not included in the plan (or is disabled in the backup settings)See the table above
before ...: the point-in-time recovery add-on was turned on then and nothing earlier was archivedChoose a time after the add-on was turned on
the selected backup was taken before the point-in-time recovery add-on was turned on (...)Pick a backup taken after the add-on was turned on
after ...: the point-in-time recovery add-on was turned off then and nothing later was archivedChoose a time before the add-on was turned off

MySQL and MariaDB replay their archived binary logs on top of a dump (single-node instances only; the binary log is archived about every minute; MariaDB’s archive has account statements’ passwords removed, see the MariaDB page), libSQL replays its bottomless replication archive in five-second batches, and MongoDB loads a daily full copy and replays the oplog saved every 10 minutes (to the second); all of them restore into a new instance. Valkey, ClickHouse and the other engines restore to the time of a backup only. Each engine’s backup method is in the engine catalogue. If you need a known-good copy before a risky change, take a manual backup first.

Search the help center or ask the assistant in the portal Help panel. If that does not solve it, open a support ticket from the portal (Help → Open a ticket). Include the instance id, the backup id, the target time you tried (in UTC), the region, and the exact error text. Never paste passwords, connection strings with passwords, API keys or patient data (PHI) into a ticket. See How to get help.