Backup and restore your OpenClaw agent's complete state, including: configuration, skills, memory, and workspace files.
CategoryPathPriorityOpenClaw config~/.openclaw/openclaw.json⭐⭐⭐ RequiredAPI credentials~/.openclaw/.env⭐⭐⭐ RequiredSkills~/.openclaw/workspace/skills/⭐⭐⭐ RequiredMemory files~/.openclaw/workspace/memory/⭐⭐⭐ RequiredIdentity filesMEMORY.md SOUL.md IDENTITY.md USER.md⭐⭐⭐ RequiredConfig filesAGENTS.md TOOLS.md HEARTBEAT.md⭐⭐ ImportantCron jobs~/.openclaw/cron/jobs.json⭐⭐ ImportantCredentials~/.openclaw/credentials/⭐⭐ Important
~/.openclaw/logs/ — logs, not needed~/.openclaw/media/ — media cache, too large~/.openclaw/workspace/.venv-*/ — Python envs, can be rebuilt~/.openclaw/completions/ — history cachebash
python3 ~/.openclaw/workspace/skills/self-backup/scripts/backup.py
Output: ~/backups/openclaw-backup-YYYY-MM-DD_HHMM.tar.gz
bash
python3 ~/.openclaw/workspace/skills/self-backup/scripts/restore.py ~/backups/openclaw-backup-YYYY-MM-DD_HHMM.tar.gz
bash
python3 ~/.openclaw/workspace/skills/self-backup/scripts/backup.py --list
bash
openclaw cron add \
--name "weekly-self-backup" \
--cron "0 2 * * 0" \
--tz "Asia/Shanghai" \
--message "Run backup: python3 ~/.openclaw/workspace/skills/self-backup/scripts/backup.py and report result" \
--session isolated \
--announce \
--channel telegram
Reinstall OpenClaw (fresh machine only) bash
npm install -g openclaw
Restore backup bash
python3 restore.py openclaw-backup-YYYY-MM-DD.tar.gz
Rebuild Python environment (not included in backup) bash
cd ~/.openclaw/workspace
python3 -m venv .venv-stock
source .venv-stock/bin/activate
pip install yfinance pandas numpy pandas-ta ta ddgs tavily-python requests beautifulsoup4
Re-login ClawHub bash
clawhub auth login --token <YOUR_TOKEN> --no-browser
Verify bash
openclaw status && openclaw doctor