Appearance
OpenClaw迁移到Hermes Agent:6步完整操作指南
之前在OpenClaw里沉淀了Agent、人格设定、记忆、Skills和Telegram Bot配置,重新搭一遍太麻烦。这篇文章分享如何将OpenClaw上的Agent迁移到Hermes Agent。
迁移步骤概览
| 步骤 | 说明 |
|---|---|
| 1 | 停止OpenClaw |
| 2 | 备份并打包 |
| 3 | 远程拷贝 |
| 4 | 执行预演 |
| 5 | 全量迁移 |
| 6 | 重启并验证 |
背景:OpenClaw和Hermes Agent分别在不同服务器上。
第一步:停止OpenClaw
在OpenClaw所在服务器执行:
bash
# 停止OpenClaw服务
systemctl --user stop openclaw-gateway.service
# 检查状态
systemctl --user status openclaw-gateway.service --no-pager第二步:备份并打包
在OpenClaw所在服务器执行:
bash
# 备份OpenClaw目录
cp -a /root/.openclaw /root/.openclaw.bak.$(date +%Y%m%d_%H%M%S)
# 打包OpenClaw目录
tar -czf /root/openclaw-full-backup.tar.gz -C /root .openclaw
# 查看压缩包是否生成成功
ls -lh /root/openclaw-full-backup.tar.gz第三步:远程拷贝并解压
在Hermes Agent所在服务器执行:
bash
# 切到lighthouse用户
su - lighthouse
# 远程拷贝压缩包
scp root@OPENCLAW_SERVER_IP:/root/openclaw-full-backup.tar.gz /home/lighthouse/
# 查看是否拉取成功
ls -lh /home/lighthouse/openclaw-full-backup.tar.gz
# 创建目录
mkdir -p ~/openclaw-import
# 解压压缩包
tar -xzf ~/openclaw-full-backup.tar.gz -C ~/openclaw-import
# 验证解压后的内容
ls -la ~/openclaw-import/.openclaw第四步:执行迁移预演
先预演迁移,不真正写入Hermes:
bash
hermes claw migrate --dry-run --source ~/openclaw-import/.openclaw结果说明:Dry Run Results - No files were modified. This is a preview of what would happen.
第五步:正式全量迁移
bash
# 执行全量迁移命令
hermes claw migrate --preset full --source ~/openclaw-import/.openclaw
# 确认迁移
Proceed with migration? [Y/n]: Y
# 是否归档.openclaw目录,选择n
Archive /home/lighthouse/openclaw-import/.openclaw now? [Y/n]: n
# 检查迁移结果
ls -la ~/.hermes/memories
ls -la ~/.hermes/skills/openclaw-imports
ls -la ~/.hermes/migration/openclaw/20260419T014330迁移完成:记忆已迁移、Skills已迁移、迁移报告已生成。
第六步:多Agent恢复步骤
以公众号助手(gzh)和热点采集助手(hotspot)为例:
1. 创建Hermes Profile
bash
hermes profile create gzh
hermes profile create hotspot2. 复制Agent人格文件
bash
cp ~/openclaw-import/.openclaw/workspace-gzh/SOUL.md ~/.hermes/profiles/gzh/SOUL.md
cp ~/openclaw-import/.openclaw/workspace-gzh/AGENTS.md ~/.hermes/profiles/gzh/AGENTS.md
cp ~/openclaw-import/.openclaw/workspace-hotspot/SOUL.md ~/.hermes/profiles/hotspot/SOUL.md
cp ~/openclaw-import/.openclaw/workspace-hotspot/AGENTS.md ~/.hermes/profiles/hotspot/AGENTS.md3. 复制记忆文件
bash
mkdir -p ~/.hermes/profiles/gzh/memories ~/.hermes/profiles/hotspot/memories
cp ~/openclaw-import/.openclaw/workspace-gzh/USER.md ~/.hermes/profiles/gzh/memories/USER.md
cp ~/openclaw-import/.openclaw/workspace-hotspot/USER.md ~/.hermes/profiles/hotspot/memories/USER.md
cp ~/openclaw-import/.openclaw/workspace-hotspot/MEMORY.md ~/.hermes/profiles/hotspot/memories/MEMORY.md4. 复制Skills
bash
cp -a ~/.hermes/skills/openclaw-imports/* ~/.hermes/profiles/gzh/skills/
cp -a ~/.hermes/skills/openclaw-imports/* ~/.hermes/profiles/hotspot/skills/5. 写入Telegram Bot配置
bash
GZH_TOKEN=$(jq -r '.channels.telegram.accounts.gzh.botToken' ~/openclaw-import/.openclaw/openclaw.json)
HOTSPOT_TOKEN=$(jq -r '.channels.telegram.accounts.hotspot.botToken' ~/openclaw-import/.openclaw/openclaw.json)
ALLOW_USER=$(jq -r '.channels.telegram.allowFrom[0]' ~/openclaw-import/.openclaw/openclaw.json)
cat > ~/.hermes/profiles/gzh/.env <<EOF
TELEGRAM_BOT_TOKEN=$GZH_TOKEN
TELEGRAM_ALLOWED_USERS=$ALLOW_USER
EOF
cat > ~/.hermes/profiles/hotspot/.env <<EOF
TELEGRAM_BOT_TOKEN=$HOTSPOT_TOKEN
TELEGRAM_ALLOWED_USERS=$ALLOW_USER
EOF6. 给Profile配置模型
bash
for p in gzh hotspot; do
$p config set model.provider openai-codex
$p config set model.default gpt-5.4
$p config set model.base_url https://chatgpt.com/backend-api/codex
done7. 分别授权Codex
bash
gzh auth
hotspot auth选择流程:1 → openai-codex → 2(标签/账户名称,可回车跳过)
8. 安装并启动Profile Gateway
bash
for p in gzh hotspot; do
$p gateway install
$p gateway start
done
systemctl --user restart hermes-gateway-gzh hermes-gateway-hotspot9. 检查状态
bash
hermes profile list看到类似输出说明成功:
gzh gpt-5.4 running
hotspot gpt-5.4 running10. Telegram设置Home Channel
分别给两个Bot发送:
/sethome在每个Telegram Bot的私聊窗口发送/sethome,将当前聊天设置为该Agent的Home Channel。
迁移建议
| 建议 | 说明 |
|---|---|
| 迁移前一定先备份 | 防止迁移失败还能恢复 |
| 先执行--dry-run | 看清楚会迁什么 |
| 单Agent可直接走官方迁移 | hermes claw migrate基本够用 |
| 多Agent要额外准备Profile恢复步骤 | 人格、模型、授权、Bot绑定 |
| 迁移完成后通过Telegram实测 | 不是只看命令执行成功 |
总结
| 要点 | 说明 |
|---|---|
| 官方迁移 | 先把记忆、Skills、部分配置搬过来 |
| 多Agent恢复 | 用Hermes Profile重新恢复每个Agent的人格、模型、授权和Bot绑定 |
| Profile机制 | 更适合后续做多Agent隔离 |
迁移不是简单地把一个工具换成另一个工具,而是把过去沉淀下来的Agent资产重新接到新的运行体系里。
关键词:OpenClaw迁移, Hermes Agent, Agent迁移, 多Agent恢复, Profile配置, Telegram Bot
