Commands
agent-commerce backup
Back up the receipt database and unimported legacy files to a new directory with a backup.json manifest.
agent-commerce backup --out <dir> [--config <path>] [--env-file <path>] [--json]Back up the receipt database to a new or empty directory with a backup.json manifest. For enabled AP2/ACP, include configured legacy files that exist, are not :memory: and have no recorded import. Sources open read-only without migration, imports or write locks, allowing backups beside a live gateway.
Options
--out <dir>required0700, and existing ones keep their permissions. Nonempty directories are refused before writing.--config <path>--env-file <path>--jsondefault: falseWhat it writes
| File | Source |
|---|---|
receipts.sqlite | storage.receipts.path, at schema v4 (2.5) or v5 (2.6); any other version is refused |
ap2-replay.sqlite | authorization.ap2.replay.path, until its first 2.6.0 start imports it |
acp-idempotency.sqlite | protocols.acp.idempotency.path, until its first 2.6.0 start imports it |
backup.json | written last: the package version, creation time, and each copy's config key, schema version and SHA-256 |
Each file is a separate, consistent VACUUM INTO snapshot at 0600, verified by PRAGMA integrity_check. Without backup.json, the backup is incomplete. Missing and in-memory receipt databases are refused.
Output
$ agent-commerce backup --out ./backups/2026-11-01
backup written to /srv/agent-commerce/backups/2026-11-01
receipts.sqlite storage.receipts.path (schema v5)Exit 0 means a complete backup; 1 means failure. Backup errors print FAIL backup: …; config errors use the validation error format. For restore steps, see Storage.