๐Ÿฆž How to Migrate OpenClaw
to a New Machine

VPS ยท Mac Mini ยท Laptop โ€” Step by Step

~10 min walkthrough ยท Works for any Linux or macOS target

Why Migrate?

Three common scenarios

๐Ÿ–ฅ๏ธ
VPS for 24/7 Uptime
Move from your laptop to a $5/mo VPS. Your agent runs while you sleep. Cron jobs, Discord bot, always on.
๐ŸŽ
Mac Mini Home Server
Apple ecosystem integration. Siri Shortcuts, AirDrop files to your agent, low power draw.
๐Ÿ’ป
New Laptop / Upgrade
Got a new machine? Bring your skills, workspace, and config with you. 15 minutes tops.

What Files Need to Move

Your entire agent lives in one folder

~ โ€” bash
$ tree ~/.openclaw/ -L 2
/home/user/.openclaw/
โ”œโ”€โ”€ ๐Ÿ“ workspace/ # โ† your agent's brain
โ”‚ โ”œโ”€โ”€ SOUL.md # personality & identity
โ”‚ โ”œโ”€โ”€ MEMORY.md # long-term memory
โ”‚ โ”œโ”€โ”€ memory/ # daily context files
โ”‚ โ””โ”€โ”€ skills/ # workspace-level skills
โ”œโ”€โ”€ ๐Ÿ“ skills/ # โ† custom skills you built
โ”‚ โ”œโ”€โ”€ crypto-analysis/
โ”‚ โ”œโ”€โ”€ ssh/
โ”‚ โ””โ”€โ”€ ...
โ”œโ”€โ”€ ๐Ÿ”‘ .env # โ† API keys (IMPORTANT)
โ”œโ”€โ”€ ๐Ÿ“„ openclaw.json # โ† main config
โ”œโ”€โ”€ agents/ # agent definitions
โ””โ”€โ”€ sessions/ # can skip โ€” regenerated
๐Ÿ’ก The workspace/, skills/, openclaw.json, and .env are the critical four. Everything else regenerates.

Step 1: Install Node + OpenClaw

On the NEW machine

๐Ÿง Linux / VPS
ubuntu@vps โ€” bash
# Install Node.js 18+
$ sudo apt update && sudo apt install -y curl
$ curl -fsSL https://deb.nodesource.com/setup_18.x \
  | sudo -E bash -
$ sudo apt install -y nodejs

# Install OpenClaw globally
$ npm install -g openclaw

$ openclaw --version
openclaw v2026.2.23
๐ŸŽ macOS
mac-mini โ€” zsh
# Install Node.js via Homebrew
$ brew install node

# Install OpenClaw globally
$ npm install -g openclaw

$ openclaw --version
openclaw v2026.2.23

# That's it. Homebrew handles
# everything for you.

Step 2: Backup the Old Machine

One command โ€” grab everything that matters

old-machine โ€” bash
$ cd ~

# Bundle the critical files into one archive
$ tar -czf openclaw-backup.tar.gz \
    .openclaw/workspace/ \
    .openclaw/skills/ \
    .openclaw/openclaw.json \
    .openclaw/.env

$ ls -lh openclaw-backup.tar.gz
-rw-r--r-- 1 user user 2.4M Feb 25 12:00 openclaw-backup.tar.gz

# โœ… That's your entire agent in one file
๐Ÿ’ก Skip sessions/ โ€” they're large and regenerate automatically. Skip node_modules/ โ€” npm install handles that.

Step 3: Transfer the Backup

Pick your method

๐Ÿ–ฅ๏ธ VPS โ†’ VPS
scp openclaw-backup.tar.gz \
user@new-vps-ip:~/
๐ŸŽ Mac โ†’ Mac
AirDrop ยท USB Drive
iCloud Drive
๐ŸŒ Cross-Platform
Google Drive ยท Dropbox
rsync ยท USB stick
new-machine โ€” bash
# On the NEW machine โ€” extract into place
$ mkdir -p ~/.openclaw
$ tar -xzf openclaw-backup.tar.gz -C ~/

$ ls ~/.openclaw/
workspace/ skills/ openclaw.json .env
โœ… All files restored

Step 4: Set Up API Keys

Check your .env โ€” update if needed

new-machine โ€” nano ~/.openclaw/.env
# ~/.openclaw/.env
# Your API keys live here โ€” NOT in .bashrc

OPENROUTER_API_KEY=sk-or-v1-xxxxxxxxxxxxxxxxxxxx
ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxx
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxx

# Optional โ€” for specific features
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_KEY=eyJhbGciOi...
DISCORD_TOKEN=MTIzNDU2Nzg5...
โš ๏ธ Keep keys in .env, not in shell profiles. The .env file is loaded by OpenClaw directly and stays out of your shell history.

Step 5: Configure & Start

Fire it up

new-machine โ€” bash
$ openclaw gateway start

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘ ๐Ÿฆž OpenClaw Gateway v2026.2.23 โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โœ“ Loading workspace from ~/.openclaw/workspace
โœ“ 4 skills loaded
โœ“ Discord channel connected
โœ“ Gateway started on port 3000

Ready. Listening for messages...

# Test it โ€” send a message in Discord
[Discord] Michael: hey, you alive?
[Discord] ๐Ÿฆž: I'm here! Running on the new machine.
Migration successful. ๐ŸŽ‰

Step 6: Auto-Start on Boot โ€” Linux

systemd service โ€” survives reboots

nano /etc/systemd/system/openclaw.service
[Unit]
Description=OpenClaw Gateway
After=network.target

[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu
ExecStart=/usr/bin/openclaw gateway start
Restart=on-failure
RestartSec=5
EnvironmentFile=/home/ubuntu/.openclaw/.env

[Install]
WantedBy=multi-user.target
ubuntu@vps โ€” bash
$ sudo systemctl daemon-reload
$ sudo systemctl enable openclaw
Created symlink ... โ†’ openclaw.service
$ sudo systemctl start openclaw
$ sudo systemctl status openclaw
โ— openclaw.service - OpenClaw Gateway
Active: active (running) since Tue 2026-02-25 12:05:00 UTC

Step 6: Auto-Start on Boot โ€” macOS

launchd plist โ€” the Mac way

nano ~/Library/LaunchAgents/com.openclaw.gateway.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.openclaw.gateway</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/bin/openclaw</string>
    <string>gateway</string>
    <string>start</string>
  </array>
  <key>RunAtLoad</key><true/>
  <key>KeepAlive</key><true/>
</dict></plist>
mac-mini โ€” zsh
$ launchctl load ~/Library/LaunchAgents/com.openclaw.gateway.plist
โœ… Service loaded โ€” starts automatically on login

Step 7: Reboot Test

The moment of truth

new-machine โ€” bash
$ sudo reboot

Connection to new-machine closed.
...
# Wait 30 seconds, SSH back in
...

$ systemctl status openclaw

โ— openclaw.service - OpenClaw Gateway
Loaded: loaded (/etc/systemd/system/openclaw.service; enabled)
Active: active (running) since Tue 2026-02-25 12:06:32 UTC; 45s ago
Main PID: 1842 (node)
Memory: 128.4M
CPU: 2.1s

Feb 25 12:06:33 vps openclaw[1842]: ๐Ÿฆž Gateway started on port 3000
Feb 25 12:06:34 vps openclaw[1842]: โœ“ Discord connected
Feb 25 12:06:34 vps openclaw[1842]: โœ“ Ready. Listening for messages...
๐Ÿ’ก If it doesn't start, check journalctl -u openclaw -f for logs. Most common issue: wrong Node.js path in the service file.

โœ… Migration Checklist

Everything in one place

โœ… Install Node.js 18+ on new machine
โœ… npm install -g openclaw
โœ… Backup: tar workspace, skills, config, .env
โœ… Transfer backup to new machine
โœ… Extract into ~/.openclaw/
โœ… Verify / update API keys in .env
โœ… openclaw gateway start
โœ… Set up auto-start (systemd / launchd)
โœ… Reboot test โ€” confirm it survives
โš ๏ธ Common Issues

Gateway won't start?
โ†’ Check node path: which openclaw

Bot not responding?
โ†’ Verify DISCORD_TOKEN in .env

Skills missing?
โ†’ Ensure skills/ was in your tar backup

Permission denied?
โ†’ Check file ownership: chown -R $USER ~/.openclaw

๐Ÿฆž

That's it. Your agent is migrated.

The whole process takes about 15 minutes.
Your skills, memory, and personality come with you.

๐Ÿ‘ Subscribe for more OpenClaw guides

Drop a comment if you hit any snags โ€” I'll help you debug it.

github.com/openclaw/openclaw ยท MIT License ยท Free forever