/install home-dir-backup-restore
OpenClaw Backup & Restore Skill
Snapshot and migrate your complete OpenClaw setup — config, agents, flows, skills, credentials, memory, and workspace — as a single portable archive.
What this skill does
- Backup: Archives the entire
~/.openclaw/directory into a timestamped.tar.gz(or.tar.gz.gpgif encrypted) — no files excluded. - Restore: Extracts an archive back into
~/.openclaw/, preserving directory structure and permissions, so OpenClaw works immediately after extraction. - List: Shows available backup archives in the configured output directory.
- Verify: Validates a backup archive's integrity before restore.
Use this skill when the user says:
- "backup my openclaw setup"
- "migrate openclaw to my new machine"
- "snapshot my openclaw config"
- "restore openclaw from backup"
- "what backups do I have?"
What is backed up
The entire ~/.openclaw directory — every file and subdirectory — is included in the archive.
No exclusions. The restored machine gets an exact copy of the original, and OpenClaw works
immediately without any missing configuration, credentials, skills, or state.
See references/paths.md for details on sensitive paths and restore-time permissions.
Workflow
Backup
- Resolve the OpenClaw home directory (
OPENCLAW_HOME, defaults to~/.openclaw). - Resolve the output directory (
BACKUP_DIR, defaults to~/openclaw-backups). - Archive the full
~/.openclawdirectory into a timestamped.tar.gz. - Optionally encrypt with GPG:
--encryptflag orBACKUP_GPG_RECIPIENTenv var. - Print the archive path and size.
Restore
- Validate the archive (non-empty, valid gzip, no path traversal).
- Warn if
~/.openclawalready exists and prompt for confirmation (or use--force). - Optionally decrypt if
.gpgextension detected. - Extract to
~/.openclaw/with--strip-components=0. - Fix permissions on sensitive files (
credentials/,secrets/,identity/). - Print a summary of restored paths.
List
Print all .tar.gz and .tar.gz.gpg files in BACKUP_DIR with size and date.
Verify
Run gzip -t on the archive and list its top-level contents without extracting.
Scripts
| Script | Purpose |
|---|---|
scripts/backup.sh |
Create a backup archive |
scripts/restore.sh |
Restore from a backup archive |
Usage examples
# Create a backup in ~/openclaw-backups/
bash scripts/backup.sh
# Backup to a custom directory
bash scripts/backup.sh --output /Volumes/USB/backups
# Backup with GPG encryption
bash scripts/backup.sh --encrypt [email protected]
# List available backups
bash scripts/backup.sh --list
# Verify a backup without restoring
bash scripts/restore.sh --verify openclaw-backup-2026-05-24_120000.tar.gz
# Restore (will prompt before overwriting)
bash scripts/restore.sh openclaw-backup-2026-05-24_120000.tar.gz
# Restore without confirmation prompt
bash scripts/restore.sh --force openclaw-backup-2026-05-24_120000.tar.gz
# Restore to a custom openclaw home
bash scripts/restore.sh --home /opt/openclaw openclaw-backup-2026-05-24_120000.tar.gz
Migration workflow (old machine → new machine)
- On the old machine: run
bash scripts/backup.sh— copy the.tar.gzto the new machine. - On the new machine: install OpenClaw binary, then run
bash scripts/restore.sh \x3Carchive>. - OpenClaw will start with your full config, agents, skills, credentials, and workspace intact.
Security notes
credentials/andsecrets/contain sensitive API keys. Keep backups in a secure location.- Use
--encryptwith a GPG key for backups stored in cloud storage or on shared drives. - The restore script sets
chmod 700on sensitive directories automatically.
Guardrails
- Never extract archives with path components that escape
~/.openclaw/(path traversal check). - Always show the archive size and file count after backup so the user can sanity-check completeness.
- If OpenClaw is running during backup, warn the user — SQLite databases may be in a dirty state.
- Do not backup
identity/device-auth.jsonwithout informing the user it contains auth tokens.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install home-dir-backup-restore - After installation, invoke the skill by name or use
/home-dir-backup-restore - Provide required inputs per the skill's parameter spec and get structured output
What is openclaw-backup-restore?
Backup or restore your entire OpenClaw setup including config, agents, skills, credentials, and workspace as a timestamped portable .tar.gz archive. It is an AI Agent Skill for Claude Code / OpenClaw, with 22 downloads so far.
How do I install openclaw-backup-restore?
Run "/install home-dir-backup-restore" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is openclaw-backup-restore free?
Yes, openclaw-backup-restore is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does openclaw-backup-restore support?
openclaw-backup-restore is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created openclaw-backup-restore?
It is built and maintained by Bruno (@brunovu20); the current version is v1.0.0.