Docs

Own Your Agents · 02.08

Backup & Restore

SQLite online backup with manifest-versioned snapshots — how Agentis protects durable state against loss.

BackupRestore

A consistent snapshot while the server keeps running

Backup uses SQLite's online backup API (Database.backup(dest)) rather than a naive file copy — which matters because a raw copy of a live SQLite file can catch it mid-write. The online backup API produces a consistent, checkpointed snapshot even while Agentis is actively serving requests, and the destination file opens cleanly with no dependency on the source's WAL or SHM sidecar files.

What a backup directory contains

FilePurpose
data.dbThe checkpointed, consistent SQLite snapshot.
secrets.jsonCopied verbatim, with 0o600 permissions re-applied on the destination (best-effort on Windows, which doesn't honor chmod the same way).
manifest.jsonFormat version + metadata, so restore refuses to operate on a directory that wasn't actually produced by createBackup, and so future format changes have a version to key off.

The output is a plain directory, not a compressed archive — a deliberate choice that keeps the CLI dependency-free and makes ad-hoc inspection of a backup trivial (you can just open data.db). Compress it yourself with tar if you want a single artifact to ship somewhere.

Restoring

CLI
agentis backup ./my-backup      # writes data.db + secrets.json + manifest.json
agentis restore ./my-backup     # refuses to overwrite an existing data.db unless --force

Restore refuses to clobber an existing data.db in the target data directory unless explicitly forced — the default path can't silently destroy a running install's state by pointing it at the wrong backup.

Continue