Backups
With SQLite, onebase can take consistent snapshots of the database and upload them to S3, R2 or MinIO on a schedule. (Postgres and Turso have their own backup tools.)
#Automatic backups
export S3_ACCESS_KEY_ID=... S3_SECRET_ACCESS_KEY=... S3_ENDPOINT=... # S3_ENDPOINT only for R2/MinIO/etc.
onebase serve --backup s3://my-bucket/backups --backup-every 1h --backup-keep 24- Snapshots:
VACUUM INTOgives a consistent copy without blocking writes. It's gzipped and uploaded asdb/onebase-<time>.sqlite.gz. - Schedule: the first backup runs a few seconds after startup, then one every
--backup-every(30m,1h,1d, …). - Retention: only the newest
--backup-keepsnapshots are kept. - Files: uploaded files in the local
files/folder are synced tofiles/in the bucket. Only new files are uploaded, since files never change.
How much data you can lose depends on the interval: with --backup-every 15m, at most 15 minutes of writes.
#One-off backup
onebase backup --backup s3://my-bucket/backupsonebase backups --backup s3://my-bucket/backups#Restore
Stop the server, then:
onebase restore --backup s3://my-bucket/backups --data ./onebase_dataonebase restore --backup s3://my-bucket/backups --at 20261022T0300 --forcerestore downloads the newest snapshot, or the one whose name contains --at, into <data>/db.sqlite, and downloads any files that are missing. It refuses to overwrite an existing database unless you pass --force.
You can also use it to move a project to a new server: install onebase there, run restore, then serve.