迁移工具概述
OpenClaw v2026.4.26 引入了统一的迁移工具,让从其他 Agent 工具切换到 OpenClaw 变得简单。
支持迁移源:
- Claude Desktop:Anthropic 桌面端
- Hermes Agent:Hermes 系统
- ChatGPT:通过历史导出(v2026.4.11+ 已支持)
- 更多 Agent 工具(持续添加)
为什么要迁移
从 Claude 迁移
如果你之前用 Claude 桌面端,但想:
- 本地控制:数据不出本地
- 多 Provider:不只用 Anthropic
- 频道集成:微信、飞书等
- Cron 自动化:定时任务
- 更多 Skills:ClawHub 33K+ Skills
OpenClaw 都能满足。
从 Hermes 迁移
如果之前用 Hermes:
- 想要更活跃的开源社区
- 需要更多功能(Memory-Wiki、Active Memory 等)
- 多 Agent 协作更强
- 生态系统更完善
openclaw migrate 命令
列出可迁移源
openclaw migrate list
输出:
可用的迁移源:
- claude : Claude Desktop / CLI
- hermes : Hermes Agent
- chatgpt : ChatGPT 历史导出
- cursor : Cursor IDE 配置
- cline : Cline VS Code 扩展
基础语法
openclaw migrate from <source> [options]
从 Claude 迁移
自动检测
openclaw migrate from claude
OpenClaw 会自动检测 Claude 配置位置:
- macOS:
~/Library/Application Support/Claude/ - Windows:
%APPDATA%/Claude/ - Linux:
~/.config/Claude/
指定源
openclaw migrate from claude \
--source ~/Library/Application\ Support/Claude/config.json
迁移内容
从 Claude 迁移:
- Custom Instructions:自定义指令
- MCP Servers:MCP 服务器配置
- Custom Skills:自定义技能
- System Prompts:系统提示
不会迁移:
- API Keys(出于安全)
- 对话历史(用 ChatGPT 导入器或单独迁移)
干跑(Dry Run)
先看看会发生什么
openclaw migrate from claude --dry-run
输出:
迁移计划(dry-run):
将创建:
✓ 1 个 Agent: claude-imported
✓ 3 个 MCP 服务器
✓ 5 个 Custom Skills
✓ Custom Instructions(800 字符)
将修改:
✓ config.yaml(添加 imported 段落)
将跳过:
! API Keys(请手动配置)
! 对话历史(使用 chatgpt 导入器)
不会执行实际操作。使用 --apply 执行。
仅查看计划
openclaw migrate from claude --plan
显示详细计划但不执行。
JSON 输出
openclaw migrate from claude --json
便于脚本处理。
实际执行迁移
# 实际执行
openclaw migrate from claude --apply
或先看计划后确认:
openclaw migrate from claude --plan
# 检查计划...
openclaw migrate from claude --apply
迁移示例
场景:从 Claude Desktop 迁移
Claude 中的配置:
{
"instructions": "你是一个专业编程助手...",
"mcpServers": {
"github": {
"command": "node",
"args": ["github-mcp.js"]
},
"filesystem": {
"command": "uvx",
"args": ["mcp-server-filesystem", "/projects"]
}
}
}
执行迁移:
openclaw migrate from claude --apply
OpenClaw 中的结果:
# config.yaml(自动添加)
agents:
claude-imported:
provider: "anthropic"
model: "claude-opus-4-7"
systemPrompt: "你是一个专业编程助手..."
mcp:
- github
- filesystem
mcp:
servers:
github:
command: "node"
args: ["github-mcp.js"]
filesystem:
command: "uvx"
args: ["mcp-server-filesystem", "/projects"]
从 Hermes 迁移
自动检测
openclaw migrate from hermes
检测路径:
~/.hermes/~/Library/Application Support/Hermes/
迁移内容
- Agent 配置:Hermes 自定义 Agent
- 工作流:自动化任务
- 历史记录(可选)
部分迁移
只迁移 MCP 服务器
openclaw migrate from claude --only mcp
只迁移 Skills
openclaw migrate from claude --only skills
只迁移指令
openclaw migrate from claude --only instructions
合并模式
合并到现有配置
openclaw migrate from claude --merge
不覆盖现有配置,而是合并新内容。
替换现有配置
openclaw migrate from claude --replace
谨慎使用。
重命名冲突
openclaw migrate from claude --rename-on-conflict
例如:
github→github-from-claude- 避免覆盖现有配置
高级选项
指定目标
openclaw migrate from claude \
--target agents.claude-team
# 迁移到 agents.claude-team 命名空间
过滤
openclaw migrate from claude \
--filter mcp.github,skills.code-review
只迁移指定项目。
排除
openclaw migrate from claude \
--exclude mcp.filesystem
排除某些项目。
团队迁移
共享配置迁移
# 团队管理员
openclaw migrate from claude \
--source /shared/team-claude \
--target /shared/openclaw \
--apply
批量迁移多人
# 脚本批量迁移
for user in user1 user2 user3; do
openclaw migrate from claude \
--source /home/$user/.config/Claude \
--target /home/$user/.openclaw \
--apply
done
Git 化管理
迁移到 Git 仓库:
openclaw migrate from claude \
--target ./team-config \
--apply
cd team-config
git init
git add .
git commit -m "Initial team config from Claude"
迁移后验证
验证配置
openclaw doctor
会检查:
- 配置语法
- 引用完整性
- 依赖可用
测试 Agent
openclaw chat --agent claude-imported
实际对话验证。
测试 MCP
openclaw mcp test claude-imported
验证 MCP 服务器可达。
测试 Skills
openclaw skills test --imported
测试导入的 Skills。
常见问题
MCP 服务器找不到
错误:mcp 服务器 github 启动失败
检查:
- 命令是否在 PATH 中
- 依赖是否安装
- 路径是否正确
Skills 不工作
可能原因:
- Skill 需要的 API Key 未配置
- 依赖的工具不存在
- 平台差异(macOS only 等)
Custom Instructions 太长
警告:导入的指令超过 5000 字符
OpenClaw 会自动转为 Standing Orders 文件,无需担心。
反向迁移
如果想从 OpenClaw 迁移到其他工具:
openclaw export claude --output ~/Desktop/openclaw-export.json
生成 Claude 可导入的格式(如果对方支持)。
注意事项
- 迁移工具需要 OpenClaw v2026.4.26 或更高版本
- API Keys 不会自动迁移,需要手动配置
- 对话历史用
openclaw memory import chatgpt等单独迁移 - 迁移前备份当前 OpenClaw 配置
- 复杂配置可能需要手动调整
- 跨平台迁移(如 Mac 配置到 Linux)注意路径
- 迁移过程不会修改源配置,可以反复尝试
- 团队迁移建议先在 staging 验证
- 迁移后全面测试Agent 行为