# Backups and restore — community wiki Zdroj: https://hermes-ai.cz/en/wiki/features/backups-and-restore/ Ověřeno proti oficiální dokumentaci: 17. 10. 2026 Oficiální stránka: https://hermes-agent.nousresearch.com/docs/reference/cli-commands Language: English. AI version — paste the whole text into your agent. ## What to back up Everything lives in ~/.hermes/: config.yaml, .env, auth.json · state.db (+ -wal, -shm) = conversations · skills/, memories/ · cron/ · SOUL.md and profiles. Several profiles = several state.db files. ## hermes backup hermes backup [-o path] [--quick] [--label name] [-k N] · default ~/hermes-backup-.zip. --quick = critical state only (config.yaml, state.db, .env, auth, cron). -k keeps the newest N full backups (default 3; 0 = all). Uses SQLite backup() -> consistent while running (WAL safe). Exit codes: 0 complete, 1 some files skipped (zip kept, --keep skipped), 2 another backup running. Excluded: agent code, models/runtimes/node, caches, checkpoints/, older backups and state-snapshots/, SQLite sidecars. ## Restore hermes gateway stop · hermes import (-f skips the prompt; CRC-checked before writing; damaged archive writes nothing; partial restore = exit 1). hermes backup restore --state pre-update rolls back the pre-update snapshot. state-snapshots/ holds quick snapshots. ## backup vs profile export hermes backup = whole machine incl. .env and auth.json -> never share it. hermes profile export = single profile, tar.gz, credentials stripped -> safe to share. ## Broken sessions "Old copy of the write-ahead log" means the agent stopped writing (data is safe). 1) hermes gateway stop (+ Desktop, dashboard, cron) · 2) hermes doctor lists holders (PID) · 3) start again. NEVER: delete state.db-wal/-shm · cp state.db alone · doctor --fix while running · sessions optimize under a live gateway. Diagnose: hermes sessions recover --inspect-only | --output · sessions repair --check-only | repair. ## Our practice --quick before every update; daily full backup off the machine; restores tested into a scratch profile; sites have their own backup (git, DB replication). In cron use the full path to hermes (which hermes).