Cross-platform migration tool for OpenClaw. Export on one system, import on another β everything works out of the box.
- β Full Backup: Workspace, config, credentials, sessions, cron, scripts, agents, extensions
- β Cross-Platform Path Conversion: macOS β Ubuntu, Ubuntu β macOS, any to any
- β Zero Re-pairing: Channels reconnect automatically after restore
- β Gateway Token Preservation: Prevents dashboard token mismatch
- β Old Archive Compatible: Auto-detects and converts paths from legacy backups
- β Safe Restore: Dry-run mode, auto-backup before overwrite
| System | Requirements |
|---|---|
| macOS | 10.15+ (Catalina or later) |
| Ubuntu/Debian | 18.04+ |
| Windows | Windows 10+ with WSL2 |
| Raspberry Pi | Raspberry Pi OS (64-bit) |
Prerequisites:
- OpenClaw must be installed on both source and target systems
- Bash 4.0+ (pre-installed on macOS/Linux)
# Download the latest release
curl -fsSL https://raw.githubusercontent.com/oxFFFF-Q/openclaw-migrate/main/openclaw-migrate.sh -o openclaw-migrate.sh
# Make it executable
chmod +x openclaw-migrate.sh
# Optional: Move to PATH for easy access
sudo mv openclaw-migrate.sh /usr/local/bin/openclaw-migrate# Clone the repository
git clone https://github.com/oxFFFF-Q/openclaw-migrate.git
cd openclaw-migrate
# The scripts are ready to use
./backup.sh --help
./restore.sh --help# On your Mac (or any source system)
cd openclaw-migrate
# Create a backup
./backup.sh ~/openclaw-backup.tar.gzThis creates a backup archive with:
- All workspace files (MEMORY.md, skills, agents)
- OpenClaw configuration (openclaw.json)
- Credentials and channel pairing state
- Session history and cron jobs
- MANIFEST.json with
home_dirfor cross-platform restore
Transfer the backup file to your target system using any method:
- USB drive
- Network transfer (scp, rsync)
- Cloud storage (Google Drive, Dropbox, etc.)
- Any file transfer method you prefer
# On your Ubuntu (or any target system)
cd openclaw-migrate
# Preview what will be restored (recommended)
./restore.sh ~/openclaw-backup.tar.gz --dry-run
# Perform the actual restore
./restore.sh ~/openclaw-backup.tar.gz
# Verify everything works
openclaw doctor
openclaw gateway statusThat's it! All paths are automatically converted, channels reconnect, no re-pairing needed.
| Component | Description |
|---|---|
| π§ Workspace | MEMORY.md, skills, agents, SOUL.md, USER.md, PLANS/ |
| βοΈ Config | openclaw.json (bot tokens, API keys, model config) |
| π Credentials | Channel pairing state β no re-pairing after restore |
| π Sessions | Full agent conversation history |
| β° Cron Jobs | All scheduled tasks |
| π‘οΈ Scripts | Guardian, watchdog, start-gateway |
| π€ Agents | Multi-agent configurations and workspaces |
| π Extensions | Installed OpenClaw extensions |
# Basic backup
./backup.sh ~/openclaw-backup.tar.gz
# The archive will include:
# - All OpenClaw data
# - MANIFEST.json with home_dir field for cross-platform restore# Always preview first
./restore.sh ~/backup.tar.gz --dry-run
# Restore with automatic path conversion
./restore.sh ~/backup.tar.gz
# The restore process:
# 1. Validates the archive
# 2. Backs up current ~/.openclaw
# 3. Restores all files
# 4. Converts paths to match current system
# 5. Preserves gateway token
# 6. Restarts OpenClaw Gateway# Check system compatibility
./openclaw-migrate.sh doctor
# View current OpenClaw status
openclaw gateway status# === On macOS ===
./backup.sh ~/my-openclaw.tar.gz
# Transfer to Ubuntu (your preferred method)
# ...
# === On Ubuntu ===
./restore.sh ~/my-openclaw.tar.gz --dry-run # Preview
./restore.sh ~/my-openclaw.tar.gz # Restore
# Paths like /Users/eva/.openclaw/...
# are automatically converted to /home/ubuntu/.openclaw/...# === On Ubuntu ===
./backup.sh ~/my-openclaw.tar.gz
# Transfer to macOS (your preferred method)
# ...
# === On macOS ===
./restore.sh ~/my-openclaw.tar.gz --dry-run # Preview
./restore.sh ~/my-openclaw.tar.gz # Restore
# Paths like /home/ubuntu/.openclaw/...
# are automatically converted to /Users/eva/.openclaw/...# Works the same way!
# Pi paths: /home/pi/.openclaw/...
# Mac paths: /Users/eva/.openclaw/...The tool automatically converts these path types:
| Source Pattern | Target Pattern |
|---|---|
/Users/xxx/.openclaw/... |
$HOME/.openclaw/... |
/home/xxx/.openclaw/... |
$HOME/.openclaw/... |
C:\Users\xxx\.openclaw\... |
$HOME/.openclaw/... (WSL) |
Files with path conversion:
openclaw.json(JSON-aware recursive conversion)*.mdfiles in workspace*.shscriptsagents/*.jsonconfigurationscron/*.jsonscheduled tasks
- Bot tokens
- API keys
- Channel credentials
- Session history
Best practices:
- Always use
--dry-runbefore restore - Keep backups in secure locations
- Use
chmod 600on backup files (applied automatically) - Don't expose backup server to public internet
# Install OpenClaw first
curl -fsSL https://openclaw.ai/install.sh | bash# Make scripts executable
chmod +x backup.sh restore.sh path-convert.shThis happens with very old archives. The tool will:
- Try to read
home_dirfrom MANIFEST.json - If not found, infer from openclaw.json content
- If still not found, warn and skip conversion
# Manual fix if needed
openclaw doctor --fixThis shouldn't happen with v3.0.0+, as the tool preserves the target system's gateway token. If you see this:
# Get the current token
cat ~/.openclaw/openclaw.json | grep -A2 '"auth"'
# Update in OpenClaw Dashboard settingsSee CHANGELOG.md for version history.
Issues and pull requests are welcome! See GitHub.
- Based on openclaw-backup (944β) by LeoYeAI
- Path conversion design by Jarvis (architect)
- Implementation by Walle (builder)
- Testing by Walle + Otto (ops)