部署教程 中等 20-40分钟

升级到 OpenClaw 2.0(v2026.8.x 稳定线)

从任意 2026.x 版本安全升级到 OpenClaw 2.0:备份、升级、doctor 迁移、验证与回滚,覆盖 OpenProse 移除与 codex/* 路由迁移两条破坏性变更线。

#Upgrade #OpenClaw 2.0 #Migration

准备工作

  • A running OpenClaw 2026.x install (any channel)
  • Terminal access and free disk space
  • A verified backup completed before upgrading (step 1)

操作步骤

1

确认当前版本并创建验证备份

OpenClaw 2.0 带配置迁移,先记录当前版本号,再用官方备份命令生成带校验的完整状态恢复点。openclaw update 只自动保留配置副本,不等于完整备份。

命令 / 操作

Windows / macOS / Linux
openclaw --version
Windows / macOS / Linux
mkdir -p ~/Backups/openclaw && openclaw backup create --output ~/Backups/openclaw --verify

小提示

  • Backup archives may contain credentials and channel state; store them owner-only
  • Note the backup point: restoring state later discards changes made after it
2

预览并执行升级

openclaw update 会检测安装类型(npm/pnpm/Bun/git)、拉取最新版、跑 doctor 并重启 Gateway。先用 --dry-run 预览计划再执行;生产环境保持 stable 渠道。

命令 / 操作

Windows / macOS / Linux
openclaw update --dry-run
Windows / macOS / Linux
openclaw update

小提示

  • v2026.8.2 (Sep 1) is the stable line's first update: dock the Home agent with Cmd/Ctrl+Shift+H; a Linux .deb/AppImage desktop companion lands; upgrade protection improved (newer config preserved, incomplete migrations no longer claim success). Upgrading straight to it is recommended.
  • For long-lived stability switch to extended-stable: openclaw update --channel extended-stable (long-lived channel with backported fixes)
  • Avoid the beta channel on production installs
3

运行 doctor 完成两条迁移线

OpenClaw 2.0 有两条破坏性变更:内置 OpenProse 插件与 /prose 命令移除;codex/* 与 openai-codex/* 引用迁移到 openai/*(覆盖 provider 配置、已存会话与自动化路由)。openclaw doctor --fix 会自动处理,冲突项会标记出来。

命令 / 操作

Windows / macOS / Linux
openclaw doctor --fix

小提示

  • Gateway startup also auto-runs safe config migrations, but an explicit doctor --fix after upgrade is more reliable
4

重启 Gateway 并逐项验证

迁移完成后重启 Gateway,再依次确认版本、健康状态、插件清单与深度探测全部通过。

命令 / 操作

Windows / macOS / Linux
openclaw gateway restart
Windows / macOS / Linux
openclaw health
Windows / macOS / Linux
openclaw plugins list --json
Windows / macOS / Linux
openclaw gateway status --deep --json

小提示

  • Expect version 2026.8.1; if plugins list is missing BytePlus, Mistral, Volcengine or other provider packages, run openclaw update repair and restart — providers now install on demand in 2.0
5

善后:.prose 文件与路由冲突

两条迁移线的收尾:原有的 .prose 文件会被保留,按上游 Agent Skill 的方式继续使用;doctor 标记出的 openai/* 路由冲突需要手动检查修复——尤其是自定义 provider 配置和自动化任务里硬编码的 codex/ 引用。

小提示

  • Search your config and automations for codex/ and openai-codex/ and switch them to openai/
  • Smoke-test any Codex-model-routed task before returning it to daily use
6

插件与 SDK 开发者:9 月 1 日门禁

如果维护自定义插件,注意多个 plugin-sdk-* 子路径导入将收敛为 openclaw/plugin-sdk/ 聚焦导入,官方门禁时间为 2026 年 9 月 1 日。保留的公开 helper 保持原有调用名,可先在测试环境跑兼容警告定位受影响的导入。

小提示

  • The official SDK migration guide lists the full subpath mapping — replace them one by one
  • Unmigrated plugins will hard-fail on the new runtime after September 1
7

出问题时分两层回滚

官方把回滚拆成两层:第一层只回退 OpenClaw 代码、保留当前状态(先试这层);第二层才恢复更新前的备份状态(会丢弃备份之后的更改,最后手段)。

命令 / 操作

Windows / macOS / Linux
npm i -g openclaw@2026.7.1 # 代码级回滚示例:重装旧版并保留状态
Windows / macOS / Linux
openclaw gateway restart

小提示

  • Restore the backup state only when the old code cannot read the migrated config or database

常见问题

升级后部分 provider 插件不见了?
OpenClaw 2.0 起 provider 包(BytePlus、ComfyUI、Mistral、NovitaAI、OpenCode、火山引擎、小米等)改为按需安装。执行 openclaw update repair(或 doctor)后重启 Gateway 即可恢复。
codex 相关模型或任务路由失效?
v2026.8.1 把 codex/* 与 openai-codex/* 全量迁移到 openai/*。先跑 openclaw doctor --fix,再检查被标记的冲突项;自定义配置里硬编码的 codex/ 引用手动改为 openai/。
Android 客户端应该装哪个版本?
官方提示 v2026.8.1 的 iOS 与 Android 原生分发「随后跟上」,早期的 Android 下载包不是 2026.8.1 原生产物——Android 用户请使用 Google Play 版本或等待官方新包。
Linux root 全局安装升级时报 EACCES?
先停止 Gateway(openclaw gateway stop),再用系统 npm 手动替换:sudo /usr/bin/npm i -g openclaw@latest,然后 openclaw gateway install --force && openclaw gateway restart。