Backup & Restore
A snapshot is a portable backup — re-apply it to recover.
An Unbase snapshot (the IR in .unbase/) is a complete, portable, byte-level
copy of your database, storage objects, and auth model. That makes it a backup —
and Unbase can re-apply it to recover.
Per-project snapshots
The snapshot lives in .unbase/ in the directory you run unbase from, so it's
project-specific by default — run unbase in each project and they never collide (like
node_modules). unbase init adds .unbase/ to your .gitignore since the snapshot
holds dumped data. Relocate it per-run with --out <dir> or UNBASE_IR.
Back up
npx unbase extract --mirror # snapshot DB + auth + storage bytes into .unbase/Copy or archive the .unbase/ directory somewhere safe. The manifest records the
project label and timestamp so multiple snapshots stay identifiable.
Restore
npx unbase restore # create schema + load + verify, then authrestore re-applies a snapshot to the target in your .env/config (it implies
--create-schema, so it works against an empty database). To restore files too, run
unbase storage then unbase rewrite (these need your storage credentials).
Because the source is never modified and loads are idempotent, restoring is safe to re-run — it fills in whatever's missing.