Install
openclaw skills install vps-agent-migrationClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.
将本地 OpenClaw 子 Agent 迁移到 VPS 上运行。包括:rsync 复制文件、配置 Discord Bot、添加 bindings 路由、禁用本地账号避免冲突。使用场景:当需要将本地的 creative/dev/qa/strategist/pojun 等子 Agent 迁移到远程 VPS 时使用此 skill。
openclaw skills install vps-agent-migration将本地 OpenClaw Agent 迁移到 VPS 上运行。
# 连接 VPS
sshpass -p 'VPS密码' ssh -o StrictHostKeyChecking=no root@VPS_IP
# 复制 Agent 文件(排除 sessions、.DS_Store、memory.md)
rsync -avz --exclude='sessions' --exclude='.DS_Store' --exclude='memory.md' \
~/.openclaw/agents/[agent名]/ root@VPS_IP:/root/.openclaw/agents/[agent名]/
从本地 ~/.openclaw/openclaw.json 中查找对应 Agent 的 token:
cat ~/.openclaw/openclaw.json | grep -A5 '"[Discord_ID]":'
在 VPS 上使用 Python 更新配置:
sshpass -p 'VPS密码' ssh -o StrictHostKeyChecking=no root@VPS_IP 'python3 -c "
import json
with open(\"/root/.openclaw/openclaw.json\") as f:
data = json.load(f)
data[\"channels\"][\"discord\"][\"accounts\"][\"[Discord_ID]\"] = {
\"name\": \"[Agent名字]\",
\"enabled\": True,
\"token\": \"[Token]\",
\"groupPolicy\": \"allowlist\",
\"streaming\": \"off\"
}
with open(\"/root/.openclaw/openclaw.json\", \"w\") as f:
json.dump(data, f, indent=2)
"'
sshpass -p 'VPS密码' ssh -o StrictHostKeyChecking=no root@VPS_IP 'openclaw config set bindings \"[{\\\"agentId\\\":\\\"[agentId]\\\",\\\"match\\\":{\\\"channel\\\":\\\"discord\\\",\\\"accountId\\\":\\\"[Discord_ID]\\\"}}]\"'
sshpass -p 'VPS密码' ssh -o StrictHostKeyChecking=no root@VPS_IP "openclaw gateway restart"
# 禁用本地账号
openclaw config patch --json '{"channels": {"discord": {"accounts": {"[Discord_ID]": {"enabled": false}}}}}'
# 重启本地 Gateway
openclaw gateway restart
true 会导致 Agent 不自动回复,需要在 guilds 中设为 falsechannels.discord.token 是默认账号,channels.discord.accounts[id].token 是多账号模式channels.discord.accounts[id].token 中