Migrate your OpenClaw setup from one machine to another with minimal downtime.
- Overview
- Pre-Migration Checklist
- Core Directories
- Secret Management (BWS)
- External Tool Re-Authentication
- QMD Semantic Search Index
- Cron Jobs
- Skills
- Agents
- Post-Migration Verification
OpenClaw stores all its data under ~/.openclaw/. This includes:
| Path | Contents |
|---|---|
~/.openclaw/openclaw.json |
Gateway configuration (ports, channel configs, model settings) |
~/.openclaw/workspace/ |
Your workspace files: SOUL.md, USER.md, MEMORY.md, AGENTS.md, TOOLS.md, memory/ directory |
~/.openclaw/agents/ |
Agent configurations and session transcripts |
~/.openclaw/skills/ |
User-installed skills |
~/.openclaw/sessions/ |
Session data |
~/.openclaw/logs/ |
Gateway and agent logs |
The migration process is: export → transfer → import → re-auth → verify.
Before starting:
- Stop the OpenClaw gateway:
openclaw gateway stop - Note your current OpenClaw version:
openclaw --version - List active cron jobs:
openclaw cron list - List installed skills: check
~/.openclaw/skills/ - List your agents:
ls ~/.openclaw/agents/ - Ensure you have your BWS (Bitwarden Secrets) access token stored somewhere safe
- Back up any custom scripts or tools referenced by your agents
- Check disk space — the migration bundle can be large if you have extensive session history
The entire ~/.openclaw/ directory is the migration target. Key subdirectories:
The main gateway configuration file. Contains:
- Gateway port and host settings
- Channel configurations (Telegram bot tokens are referenced via BWS, not stored in plaintext)
- Model provider settings
- Agent routing rules
Your agent's brain:
SOUL.md— Agent personality and identityUSER.md— Information about you (the user)MEMORY.md— Long-term curated memoryAGENTS.md— Agent behavior rules and workflowsTOOLS.md— Tool configuration notesmemory/— Daily memory files (YYYY-MM-DD.md), error logs, references
This is the most important directory to preserve.
User-installed skills (ClawHub or custom). System skills ship with the npm package and don't need copying.
Each agent has its own subdirectory:
~/.openclaw/agents/
├── myagent/
│ ├── agent.json # Agent configuration
│ └── sessions/ # Session transcripts
└── anotheragent/
├── agent.json
└── sessions/
Important: Agent IDs are permanent identifiers. Do not rename agent directories.
OpenClaw integrates with Bitwarden Secrets Manager (BWS) for secure secret injection.
- On gateway startup, OpenClaw reads secret references from
openclaw.json - It calls BWS to fetch the actual values
- Secrets are injected as environment variables for the gateway process
- Secrets are never stored on disk in plaintext
-
Install BWS CLI on the new machine:
# macOS brew install bitwarden/tap/bws # Or download from https://bitwarden.com/help/secrets-manager-cli/
-
Set your BWS access token:
# Add to your shell profile (~/.zshrc, ~/.bashrc, etc.) export BWS_ACCESS_TOKEN="your-access-token-here"
-
Verify access:
bws secret list
-
Secrets that OpenClaw typically pulls from BWS:
- API keys for model providers (OpenAI, Anthropic, Azure, etc.)
- Channel tokens (Telegram bot token, Discord bot token, etc.)
- Third-party service credentials
- Any custom secrets referenced in your
openclaw.json
If your secrets are set via environment variables directly, ensure they're added to your shell profile on the new machine.
These tools store auth locally and need re-authentication on the new machine:
# Re-authenticate for Gmail, Calendar, Drive access
gog auth login
# Follow the OAuth browser flow
# Verify:
gog gmail list --limit 1
gog calendar list --limit 1gh auth login
# Choose: GitHub.com → HTTPS → Browser
# Verify:
gh auth statuswacli auth
# Scan the QR code with WhatsApp on your phone
# This creates a new linked device
# Verify:
wacli statuscodex login
# Or set OPENAI_API_KEY in your environment
# Verify:
codex --versionclaude auth
# Follow the browser OAuth flow
# Or set ANTHROPIC_API_KEY in your environment
# Verify:
claude --version# Open Cursor IDE and sign in via the UI
# Settings → Account → Sign In# Re-join your tailnet
tailscale up
# Or on macOS, open the Tailscale app and sign in
# Verify:
tailscale statusQMD maintains a local semantic search index with embeddings. Embeddings are not portable — they must be regenerated on the new machine.
-
Install QMD on the new machine (if not already installed)
-
List existing collections (on old machine, for reference):
qmd collection list
-
Re-index collections on the new machine:
# Re-index your workspace qmd index ~/.openclaw/workspace # Re-index any other directories you had indexed qmd index /path/to/your/documents # List collections to verify qmd collection list
-
Embeddings are regenerated automatically during indexing — no need to copy the old index database.
OpenClaw cron jobs handle scheduled tasks (heartbeats, reminders, workflow polling, etc.).
# List all cron jobs
openclaw cron list
# Save the output for reference
openclaw cron list > ~/openclaw-cron-backup.txtCron jobs are stored in the agent configuration. After restoring ~/.openclaw/, they should be automatically available. Verify with:
openclaw cron listIf any are missing, re-create them:
openclaw cron add --agent myagent --schedule "*/15 * * * *" --task "your task description"| Type | Location | Migration |
|---|---|---|
| System skills | Inside the openclaw npm package |
Auto-installed with OpenClaw |
| User skills | ~/.openclaw/skills/ |
Copied with migration bundle |
| ClawHub skills | ~/.openclaw/skills/ (installed from ClawHub) |
Re-install from ClawHub if missing |
-
Verify user skills are present:
ls ~/.openclaw/skills/ -
Re-install any ClawHub skills if needed:
openclaw skill install <skill-name>
-
System skills come with the OpenClaw package — just ensure you're on the same (or newer) version:
npm install -g openclaw@latest
~/.openclaw/agents/<agent-id>/
├── agent.json # Agent identity, model, channel bindings
└── sessions/
├── <session-id>.jsonl # Session transcripts
└── ...
- Agent IDs are permanent. The directory name IS the agent ID. Never rename these directories.
- Session history can be large. You may choose to skip
sessions/directories to reduce bundle size if you don't need historical transcripts. - Agent configs (
agent.json) contain the agent's model assignment, channel bindings, and behavior settings.
# Verify agents are recognized
openclaw gateway start
# Check logs for agent loading
openclaw gateway logsRun through this checklist after migration:
- OpenClaw installed:
openclaw --version - Gateway starts:
openclaw gateway start - Gateway status:
openclaw gateway status - Config loaded: check
openclaw gateway logsfor errors
- BWS accessible:
bws secret list - API keys injected (gateway starts without auth errors)
- Agents listed and responsive
- Send a test message through each configured channel
- Workspace files intact:
ls ~/.openclaw/workspace/ - Memory files present:
ls ~/.openclaw/workspace/memory/
-
gh auth status— GitHub authenticated -
gog auth status— Google authenticated (if used) -
wacli status— WhatsApp connected (if used) -
tailscale status— Connected to tailnet (if used)
-
openclaw cron list— All cron jobs present - Wait for a scheduled task to fire and verify it works
- QMD re-indexed:
qmd collection list - Test a search:
qmd search "test query"
- Session history accessible (if copied)
- Skills loaded: check agent logs
- Canvas/browser features working
# OLD MACHINE
openclaw gateway stop
./openclaw-migrate.sh export
# TRANSFER
scp ~/openclaw-migration-bundle.tar.gz newmachine:~/
# NEW MACHINE
npm install -g openclaw@latest
./openclaw-migrate.sh import ~/openclaw-migration-bundle.tar.gz
# Then re-auth external tools (see sections above)
openclaw gateway start| Issue | Fix |
|---|---|
| Gateway won't start | Check openclaw gateway logs — usually a missing secret or port conflict |
| Agent not responding | Verify agent config in ~/.openclaw/agents/<id>/agent.json |
| BWS errors | Ensure BWS_ACCESS_TOKEN is set and valid |
| Missing skills | Re-install from ClawHub: openclaw skill install <name> |
| QMD search empty | Re-index: qmd index ~/.openclaw/workspace |
| Cron jobs not firing | Check openclaw cron list and gateway logs |
Last updated: 2026-02-12