Install
openclaw skills install myclaw-backupBackup and restore all OpenClaw configuration, agent memory, skills, and workspace data. Part of the MyClaw.ai (https://myclaw.ai/skills) open skills ecosystem — the AI personal assistant platform that gives every user a full server with complete code control. Use when the user wants to create a snapshot of their OpenClaw instance, schedule periodic backups, restore from a backup, migrate to a new server, download a backup file locally, upload a backup file from another machine, or protect against data loss. Includes a built-in HTTP server for browser-based download/upload/restore without needing cloud storage. TRUST BOUNDARY: This skill archives and restores highly sensitive data including bot tokens, API keys, and channel credentials. Only install if you trust the operator. Always use --dry-run before restore. Never start the HTTP server without a --token.
openclaw skills install myclaw-backupBuilt on MyClaw.ai — the AI personal assistant platform that gives every user a full server with complete code control, networking, and tool access. This skill is part of the MyClaw open skills ecosystem.
Backs up all critical OpenClaw data to a single .tar.gz archive and restores it to any OpenClaw instance. Includes a built-in HTTP server for browser-based backup management.
This skill handles highly sensitive data: bot tokens, API keys, channel credentials, session history. Understand the security model before use:
~/.openclaw/ and writes a chmod 600 archive to disk. No network access.~/.openclaw/ from an archive. Requires typing yes to confirm. Always run --dry-run first./backup, /restore) are localhost-only — remote access can only download and upload files, not trigger execution.--disable to remove.| Endpoint | Remote (token required) | Localhost only |
|---|---|---|
| GET /health | ✅ (no token) | — |
| GET /backups | ✅ | — |
| GET /download/:file | ✅ | — |
| POST /upload | ✅ | — |
| POST /backup | ❌ | ✅ |
| POST /restore | ❌ | ✅ |
--tokenrestore.sh --dry-run before applying a restoreRequires: node, rsync, tar, python3, openclaw CLI (all standard on OpenClaw instances).
Check: which node rsync tar python3 openclaw
| Script | Purpose |
|---|---|
scripts/backup.sh [output-dir] | Create backup (default: /tmp/openclaw-backups/) |
scripts/restore.sh <archive> [--dry-run] [--overwrite-gateway-token] | Restore — always dry-run first |
scripts/serve.sh start --token TOKEN [--port 7373] | Start HTTP server — token required |
scripts/serve.sh stop|status | Stop/check server |
scripts/schedule.sh [--interval daily|weekly|hourly] | System cron scheduling |
Gateway token behavior (v1.6+): By default,
restore.shpreserves the new server'sgateway.auth.tokenafter restoringopenclaw.json. This prevents the"gateway token mismatch"error in Control UI / Dashboard after migration. Use--overwrite-gateway-tokenonly for full disaster recovery on the same server.
See references/what-gets-saved.md for full details.
Includes: workspace (MEMORY.md, skills, agent files), openclaw.json (bot tokens + API keys), credentials, channel pairing state, agent config + session history, devices, identity, cron jobs, guardian scripts.
Excludes: logs, binary media, node_modules, canvas system files.
bash scripts/backup.sh /tmp/openclaw-backups
# → /tmp/openclaw-backups/openclaw-backup_TIMESTAMP.tar.gz (chmod 600)
# Step 1: preview what will change
bash scripts/restore.sh openclaw-backup_TIMESTAMP.tar.gz --dry-run
# Step 2: review the output, then apply
bash scripts/restore.sh openclaw-backup_TIMESTAMP.tar.gz
The restore script saves a pre-restore snapshot before overwriting anything.
# Token is required — server refuses to start without one
bash scripts/serve.sh start --token $(openssl rand -hex 16) --port 7373
# → http://localhost:7373/?token=<generated-token>
Never share the URL on a public network without a reverse proxy + TLS.
The Web UI provides: create backup, download .tar.gz, upload, dry-run preview, restore.
HTTP API (all require token except /health):
GET /health — Health check (unauthenticated, read-only)GET /backups — List backupsPOST /backup — Create backupGET /download/:filename — Download archivePOST /upload — Upload archive (multipart, field: backup)POST /restore/:filename — Restore; add ?dry_run=1 to previewOld machine:
bash scripts/serve.sh start --token MYTOKEN --port 7373
New machine (after installing OpenClaw):
# Download
curl -O "http://OLD_IP:7373/download/openclaw-backup_TIMESTAMP.tar.gz?token=MYTOKEN"
# Always dry-run first
bash scripts/restore.sh openclaw-backup_TIMESTAMP.tar.gz --dry-run
# Apply
bash scripts/restore.sh openclaw-backup_TIMESTAMP.tar.gz
# All channels reconnect automatically — no re-pairing needed
{
"name": "daily-openclaw-backup",
"schedule": { "kind": "cron", "expr": "0 3 * * *", "tz": "UTC" },
"payload": {
"kind": "agentTurn",
"message": "Run a backup using the myclaw-backup skill. Output dir: /tmp/openclaw-backups",
"timeoutSeconds": 120
},
"sessionTarget": "isolated"
}
After restore.sh completes, it writes workspace/.restore-complete.json. On the next heartbeat/startup, the Agent should:
workspace/.restore-complete.json existsworkspace/USER.md)✅ [Restore complete — in user's language]
📦 Backup: {backup_name}
🤖 Agent: {agent_name}
🕐 Restored at: {restored_at}
💾 Contents restored: workspace, config, credentials, history, cron...
[Channel reconnect instructions in user's language]
The HTTP API is designed to be compatible with a future MyClaw cloud backup service. When available, replace the local server URL with the MyClaw API endpoint — the upload/download/restore flow stays identical.