MyOpenClaw Backup Restore — Cross-Platform
Part of the MyClaw.ai open skills ecosystem.
Full documentation (中文): see README.md
Quick Start
CODEBLOCK0
No setup, no dependencies beyond Node.js.
What Gets Backed Up
Workspace (MEMORY.md, SOUL.md, etc.) • All workspace-* dirs (multi-agent teams) • Gateway config (tokens, API keys, channels) • Skills • Extensions • Credentials & channel pairing state • Agent config & session history • Devices • Identity • Cron jobs • Guardian scripts • ClawHub registry • Delivery queue • Memory index
Excluded: logs, node_modules, .git, media files, browser data, .lock/.deleted.* files.
See references/what-gets-saved.md for full details.
Cross-Platform
Backups use tar.gz (native on Win10+/macOS/Linux). Auto-fallback to ZIP on older Windows. Archives from any OS restore on any OS.
Commands
backup
CODEBLOCK1
Creates openclaw-backup_{agent}_{timestamp}.tar.gz in ~/openclaw-backups/. Auto-prunes (keeps last 7). On non-Windows: chmod 600 applied.
restore
CODEBLOCK2
Safety features:
- -
--dry-run: Preview without changes - Pre-restore snapshot: Auto-saves current state before overwriting
- Gateway token preservation: Keeps new server's token (prevents Control UI mismatch)
- Interactive confirmation: Must type INLINECODE4
- Credential hardening:
chmod 700/600 on non-Windows - Auto-restart: Starts gateway after restore
- Legacy compatibility: Handles v1 (bash) and v2 archive structures
list
CODEBLOCK3
HTTP Server
CODEBLOCK4
- - Web UI at INLINECODE6
- Remote: list, download, upload only
- Localhost: backup, restore (shell execution restricted to localhost)
- Token is mandatory — server won't start without one
Security
Archives contain bot tokens, API keys, and credentials. Store securely. Never commit to public repos. Transfer via encrypted channels.
MyOpenClaw 备份恢复 — 跨平台
属于 MyClaw.ai 开放技能生态系统的一部分。
完整文档(中文):参见 README.md
快速开始
bash
备份
node scripts/backup-restore.js backup
列出备份
node scripts/backup-restore.js list
恢复(务必先执行 dry-run!)
node scripts/backup-restore.js restore
--dry-run
node scripts/backup-restore.js restore
无需配置,除 Node.js 外无其他依赖。
备份内容
工作区(MEMORY.md、SOUL.md 等)• 所有 workspace-* 目录(多智能体团队)• 网关配置(令牌、API 密钥、频道)• 技能 • 扩展 • 凭证与频道配对状态 • 智能体配置与会话历史 • 设备 • 身份 • 定时任务 • 守护脚本 • ClawHub 注册表 • 投递队列 • 内存索引
排除项: 日志、node_modules、.git、媒体文件、浏览器数据、.lock/.deleted.* 文件。
完整详情请参见 references/what-gets-saved.md。
跨平台
备份使用 tar.gz 格式(Win10+/macOS/Linux 原生支持)。旧版 Windows 自动回退至 ZIP 格式。任意操作系统生成的归档文件可在任意操作系统上恢复。
命令
backup
bash
node scripts/backup-restore.js backup [--output-dir
]
在 ~/openclaw-backups/ 目录下创建 openclaw-backup{agent}{timestamp}.tar.gz。自动清理(保留最近 7 个)。非 Windows 系统:应用 chmod 600。
restore
bash
node scripts/backup-restore.js restore [--dry-run] [--overwrite-gateway-token]
安全特性:
- - --dry-run:预览而不进行更改
- 恢复前快照:覆盖前自动保存当前状态
- 网关令牌保留:保留新服务器的令牌(防止控制界面不匹配)
- 交互式确认:必须输入 yes
- 凭证加固:非 Windows 系统应用 chmod 700/600
- 自动重启:恢复后启动网关
- 旧版兼容:支持 v1(bash)和 v2 归档结构
list
bash
node scripts/backup-restore.js list [--backup-dir
]
HTTP 服务器
bash
node scripts/server.js --token [--port 7373] [--backup-dir ]
- - Web 界面位于 http://localhost:/?token=
- 远程:仅支持列出、下载、上传
- 本地主机:支持备份、恢复(shell 执行仅限于本地主机)
- 令牌为必填项 — 无令牌服务器无法启动
安全
归档文件包含机器人令牌、API 密钥和凭证。请安全存储。切勿提交至公共仓库。通过加密通道传输。