Backup And Restore
Anyy can create and list profile-home backup archives. Restore is currently
a manual operation: there is no anyy backup restore command.
Use backups before moving a profile, changing host storage, testing risky config changes, or doing manual state work.
What A Backup Covers
anyy backup create archives regular files under the resolved Anyy
home. Each archive includes manifest.json and regular profile files.
SQLite state is copied through SQLite backup logic when the state database is present. SQLite sidecar files such as WAL/SHM/journal files are excluded. Directory entries are not archived as standalone entries.
Profile secrets are excluded by default.
Create A Backup
Create a backup in the profile's backups/ directory:
anyy backup create
Choose an explicit output path:
anyy backup create --output /secure/backups/anyy.tar.gz
Include secrets only when the archive will be stored and transferred as sensitive credential material:
anyy backup create --include-secrets
For automation:
anyy backup create --json
Inspect Backup Contents
List backup archives in the profile backup directory:
anyy backup list
anyy backup list --json
Inspect an archive with standard tar tooling:
tar -tzf /secure/backups/anyy.tar.gz | head
tar -xOf /secure/backups/anyy.tar.gz manifest.json
The manifest lists archived files and whether secrets were excluded.
Restore Manually
Stop the gateway before replacing files:
anyy gateway stop
Unpack into a temporary directory first:
mkdir -p /tmp/anyy-restore
tar -xzf /secure/backups/anyy.tar.gz -C /tmp/anyy-restore
Review the restored tree, then copy the files into the target Anyy home with ownership and permissions appropriate for the service user.
If the backup excluded secrets, recreate or copy the required secrets/ entries
before starting the gateway. Config can reference those secrets with secret:
refs, but missing secret files cause runtime failures.
Validate After Restore
anyy doctor
anyy config
anyy gateway start
anyy status
For configured channels and MCP servers, also run targeted checks:
anyy channels doctor telegram
anyy mcp status
Then send a real chat or platform message. A restore is not fully proven until the runtime can read config, reach the model backend, and deliver through any channel you depend on.
What Is Excluded
- Profile secrets, unless
--include-secretsis set. - The target archive itself when it is inside Anyy home.
- SQLite sidecar files:
.db-wal,.db-shm,.db-journal, and equivalent-wal,-shm,-journalsuffixes. - Directories as standalone entries.
- Non-regular files.
Safety Notes
- Treat archives made with
--include-secretsas credential material. - Prefer restoring while the gateway is stopped.
- Keep the original home directory until
doctor,config, and a real message or chat test pass. - Do not mix files from different profiles unless you intentionally want to merge those profiles.
- Use
--homeor--profiledeliberately so you back up the intended profile.