Backup & migration reference

Hermes Agent Backup, Restore & Migration

Run hermes backup to write one zip of your whole Hermes data directory — every profile's config, memories, skills, sessions, cron jobs, and credentials — and hermes import <zip> to restore it, on the same machine or a new one. Stop the gateway before importing.

To move or share one agent without its API keys, use hermes profile export <name> -o file.tar.gz instead. Full backups contain your API keys and sign-in tokens: encrypt them and store them like a password file.

Checked against official Nous Research sources on September 26, 2026 (Hermes Agent v0.21.5).

What actually needs backing up

Everything that makes your agent yours is in the Hermes data directory (HERMES_HOME). The program itself can be reinstalled.

Install typeData directory
macOS, Linux, WSL2, Desktop app~/.hermes/
Native Windows%LOCALAPPDATA%\hermes\
DockerThe host directory or volume mounted at /opt/data
Named profiles and Bot Mode botsprofiles/<name>/ inside the data directory

Inside it: config.yaml, .env (API keys), auth.json (OAuth tokens), SOUL.md, memories/ (memory), skills/ (skills), state.db (every session), cron/, plugins/, and profiles/.

Every backup-like option, compared

ToolWhat it capturesCredentials?Restore withUse it for
hermes backupWhole data directory, all profiles (with the exclusions below)Yeshermes importDisaster recovery, moving to a new machine
hermes backup --quickCritical state only: config.yaml, state.db, .env, auth, cron jobsYes/snapshot restore <id>A fast checkpoint before a risky change
/snapshot create (in a chat)Same kind of state snapshot, from inside a sessionYes/snapshot restore <id>Undoing a config or state change
Pre-update backup (hermes update)Quick snapshot by default; --backup adds a full zipYes/snapshot restoreAutomatic safety net on native installs
hermes profile exportOne profile: skills, memory, persona, cron jobs, plugins, settingsNo — strippedhermes profile importMoving or sharing one agent
hermes sessions exportConversation transcripts as JSONL, Markdown, or HTMLOnly what you typed; --redact masks credential patternsNo documented importArchiving or sharing conversations
hermes curator backupA tar.gz of skills/Nohermes curator rollbackUndoing skill cleanup
Provider disk snapshotsThe whole server diskYesYour providerWhole-server rollback on a VPS

Full backup vs. quick backup

hermes backup (official CLI reference)
bash
$hermes backup # full: ~/hermes-backup-<timestamp>.zip
$hermes backup -o ~/Backups/hermes-$(date +%F).zip
$hermes backup --quick --label pre-upgrade # quick state snapshot
  • Safe while Hermes is running. Databases are copied with SQLite's backup API, so you don't need to stop the gateway to back up.
  • Check the exit code. 0 means every file landed. 1 (“Backup incomplete”) keeps a partial zip and lists what was skipped — read it before deleting anything. 2 means another backup was running.
  • Old zips are pruned. A full backup keeps the newest 3 hermes-backup-*.zip files in the output folder (--keep N; 0 keeps all). Pruning is skipped after an incomplete backup.
  • Not included: the Hermes program, downloaded local models and runtimes, browser profiles (they hold real browser cookies and logins), regenerable caches, session checkpoints, earlier backups, and SQLite's -wal/-shm sidecars.
  • A quick backup is not a migration backup. The official FAQ says so directly; use a full backup before moving machines.

To restore a quick snapshot, start hermes and use /snapshot (lists snapshots) and /snapshot restore <id>.

Sources disagree: Parts of the official docs still show hermes snapshot list and hermes backup restore --state pre-update. Neither exists as a CLI command; snapshots are listed and restored with the in-chat /snapshot command. This is tracked in issue #119756 (open as of September 26, 2026).

Restoring with hermes import

Restore a full backup
bash
$hermes gateway stop # and quit the Desktop app / dashboard
$hermes import ~/hermes-backup-<timestamp>.zip
$hermes doctor
$hermes gateway start
  • Import overwrites. Every file in the archive replaces the file of the same name in your data directory. If Hermes is already set up there, it asks first; --force skips the question.
  • Damaged archives are refused before anything is written — every member is checksum-checked first.
  • Partial restores are reported: exit code 1 and an “Import incomplete” summary if any file could not be restored.
  • Older-over-newer is flagged. If the imported state.db has fewer messages than the one it replaces, the summary warns that anything after the backup date is gone from the restored copy.
  • Databases are written into the existing file rather than swapped, so a process that still has it open sees the restored data. If that can't be done safely, the database is skipped with a warning — stop the process and rerun.

We checked the current docs for a warning to import only into a fresh, empty install. It is not there today: the documented requirement is to stop the gateway, and the confirmation prompt covers importing over an existing setup. Importing into a new install is still the cleanest case, because nothing is being overwritten.

Profile exports and session exports

Current syntax
bash
$hermes profile export work -o work.tar.gz
$hermes profile import work.tar.gz --name work
$
$hermes sessions export all-sessions.jsonl
$hermes sessions export --format html --newer-than 1w --redact archive.html
  • Profile exports strip API keys. Static keys have to be re-entered and OAuth logins signed in again on the destination (hermes -p <name> auth add <provider>). The same export is /export in chat and ⌘K → Export profile in Desktop.
  • Machine-specific tools don't travel. installs/, tools/, and cache/ are left out; reinstall dependencies on the destination.
  • Session exports are one-way. They produce readable or machine-readable archives; there is no documented command to import them back as live sessions. Use a full backup if you need sessions restored.
  • --redact masks recognizable credential patterns only. Anything else sensitive you discussed stays in the export.
Sources disagree: The official FAQ shows hermes profile export work ./work-backup.tar.gz and hermes profile import ./work-backup.tar.gz work; both fail with argparse errors (#119756). Use -o and --name as above. The FAQ also says a profile export carries sessions, while the profiles guide lists skills, memory, persona, cron jobs, plugins, and settings without sessions. If conversation history matters, don't rely on a profile export for it.

Moving Hermes to a new machine or server

  1. Install Hermes on the new machine (install guide). Don't start its gateway yet.
  2. On the old machine: hermes backup, and confirm it exits 0.
  3. Copy the zip over an encrypted channel, e.g. scp ~/hermes-backup-*.zip newhost:~/.
  4. Stop the gateway on the old machine (hermes gateway stop, or disable its service). Two gateways using the same Telegram or Discord bot token conflict.
  5. On the new machine: hermes import ~/hermes-backup-<timestamp>.zip, then hermes setup or hermes doctor to confirm providers work.
  6. Start the gateway there (on a server, as a service — see the VPS guide) and run hermes cron doctor.
  • Absolute paths don't move. A cron job's --workdir or a config path that doesn't exist on the new machine will fail; hermes cron doctor flags missing working directories.
  • Local models aren't in the zip. Re-download them on the new machine.
  • The official docs don't describe exporting from or importing into Hermes Cloud or third-party managed hosts. Ask the host before assuming your data can move — see hosting.

Docker specifics

In Docker, the data directory is whatever is mounted at /opt/data. Back it up with Hermes inside the container rather than by copying files on the host, which on Docker Desktop can capture a database mid-write:

Backup and restore with the official image
bash
# Back up to a folder that lands on the host through the mount
$docker exec hermes hermes backup -o /opt/data/backups/hermes-$(date +%F).zip
$
# Restore: stop the container, then run import in a one-off container
$docker compose stop
$docker run --rm -it -v ~/.hermes:/opt/data -v ~/Backups:/restore \
$ nousresearch/hermes-agent import /restore/hermes-2026-09-26.zip
$docker compose up -d
Our inference: These Docker commands combine the documented hermes backup/hermes import behavior with the image's documented pattern of passing a Hermes subcommand (as in docker run … nousresearch/hermes-agent setup). The official Docker guide does not give a backup recipe, and we have not run these exact commands. Writing into /opt/data/backups/ relies on the documented rule that full backups don't nest the backups/ folder.

Moving from a native install to Docker (or back) uses the same zip: the archive holds the data directory's contents, and the container treats /opt/data as that directory.

Securing backup files

  • A full backup is a credential file. It includes .env (provider API keys, bot tokens) and auth.json (OAuth tokens) for every profile. The official FAQ states both are included.
  • Encrypt before it leaves the machine (for example with age or gpg), and never commit it to a Git repository, including private ones.
  • Sessions and memory are personal data. state.db holds every conversation, including anything you pasted. A profile export has no keys but still carries memory and SOUL.md.
  • If a backup leaks, rotate the keys and tokens it contained; deleting the file doesn't revoke them.
  • Browser profiles are excluded from full backups on purpose, because they hold real browser cookies and saved logins.

When state.db is the problem

Many people look up backups after sessions vanish or Hermes reports its database is locked or corrupt. Some context: v0.21.0 (August 31, 2026) rewrote how the session store handles connections, and for some installs it made state.db fragile. v0.21.2 (September 11), titled “The state.db Patch Release”, lists six fixes closing 44 issues; later releases continued the work. On Docker Desktop, see the bind-mount trap.

Official session-storage recovery steps
bash
$hermes gateway stop # stop EVERY Hermes process: gateway, Desktop, dashboard
$hermes doctor # names any process still holding the database
$hermes sessions recover --source ~/.hermes/state.db --inspect-only # read-only check
  • Don't delete state.db-wal or state.db-shm. The write-ahead log can hold conversations not yet in state.db; deleting it is how a recoverable state becomes real data loss.
  • Don't copy state.db on its own as a backup — the three files form one image. Use hermes backup.
  • Don't run hermes doctor --fix while Hermes processes are running, and don't ask the agent to repair its own database.
  • If recovery isn't possible, restore the newest snapshot from state-snapshots/ or your last full backup.
Not tested by this site: Everything on this page comes from the official CLI reference, FAQ, profiles, sessions, and session-recovery docs, release notes, and GitHub issues. HermesAgentAI.org has not round-trip tested a backup and restore, so we don't claim restores always work or that a migration is lossless. Test your own: import a backup into a spare machine or a separate HERMES_HOME before you need it.

Primary sources

HermesAgentAI.org is an independent educational documentation resource and community guide. It is not affiliated with, sponsored by, or endorsed by Nous Research or FlyHermes. Hermes Agent is released under the MIT License by Nous Research.

Where to go next