home / skills / openclaw / skills / migrate

migrate skill

/skills/mrgoodb/migrate

This skill exports and imports Clawdbot installations to migrate, backup, or restore setups across machines.

npx playbooks add skill openclaw/skills --skill migrate

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
2.0 KB
---
name: migrate
description: Export and import Clawdbot installations for migration between machines. Use when the user wants to migrate Clawdbot to a new computer, backup their setup, or restore from a backup. Handles workspace files, config, WhatsApp sessions, and optionally credentials.
---

# Clawdbot Migration

Export and import complete Clawdbot installations.

## Export

Create a portable archive of the current installation:

```bash
bash scripts/export.sh
```

Options:
- `--output, -o PATH` — Output directory (default: current)
- `--workspace PATH` — Workspace path (default: ~/clawd)
- `--include-sessions` — Include session transcripts
- `--include-credentials` — Include credentials ⚠️ handle with care

Example:
```bash
bash scripts/export.sh -o /tmp --include-sessions
```

Creates: `clawdbot-export-YYYYMMDD_HHMMSS.tar.gz`

## Import

Restore from an export archive on a new machine:

```bash
bash scripts/import.sh <archive.tar.gz>
```

Options:
- `--workspace PATH` — Target workspace (default: ~/clawd)
- `--force, -f` — Overwrite without prompting

Example:
```bash
bash scripts/import.sh clawdbot-export-20260129_120000.tar.gz --force
```

## What's Included

| Component | Default | Flag |
|-----------|---------|------|
| Workspace (~/clawd) | ✓ | — |
| Config (clawdbot.json) | ✓ | — |
| Managed skills | ✓ | — |
| WhatsApp session | ✓ | — |
| Session transcripts | ✗ | `--include-sessions` |
| Credentials | ✗ | `--include-credentials` |

**Excluded from workspace** (can be rebuilt):
`node_modules/`, `.next/`, `.open-next/`, `.vercel/`, `.wrangler/`, `.git/`, `dist/`, `build/`

## Migration Workflow

1. On old machine:
   ```bash
   bash scripts/export.sh -o ~/Desktop
   ```

2. Transfer archive to new machine (scp, USB, cloud, etc.)

3. On new machine:
   ```bash
   npm install -g clawdbot
   bash scripts/import.sh ~/clawdbot-export-*.tar.gz
   cd ~/clawd && clawdbot gateway start
   ```

WhatsApp session transfers automatically — no re-scan needed.

Overview

This skill exports and imports complete Clawdbot installations to migrate or back up environments. It packages workspace files, configuration, managed skills, and WhatsApp sessions into a portable archive and restores them on another machine. Optional flags include exporting session transcripts and sensitive credentials. The tool streamlines moving a running Clawdbot setup without manual reconfiguration.

How this skill works

The skill runs two helper scripts: an export routine creates a timestamped tar.gz archive of the installation, and an import routine extracts that archive into a target workspace. By default it includes the workspace, clawdbot.json config, managed skills, and WhatsApp session; transcripts and credentials are included only when explicitly requested. The import script can target a specific workspace path and supports forced overwrite to avoid prompts.

When to use it

  • Move a full Clawdbot installation from one computer to another
  • Create a portable backup before upgrading or reinstalling OS
  • Restore a previous environment after hardware failure or migration
  • Share a configured environment with a colleague or another machine
  • Snapshot and archive deployments for compliance or audit purposes

Best practices

  • Exclude or securely handle credentials: use the include-credentials flag only on trusted systems
  • Transfer the archive over a secure channel (scp, SFTP, encrypted cloud)
  • Run npm install -g clawdbot on the destination before importing to ensure CLI availability
  • Rebuild excluded folders (node_modules, build artifacts) after import by reinstalling dependencies
  • Test the restored instance in a controlled environment before switching production traffic

Example use cases

  • Export from a developer laptop, transfer via USB, and import on a new workstation to continue work immediately
  • Backup a production gateway configuration including WhatsApp session for disaster recovery
  • Clone a configured environment for testing or QA without re-running setup steps
  • Restore an archived installation after replacing a hard drive or migrating to a VM
  • Share a preconfigured environment with teammates to reproduce bugs or demos

FAQ

Are WhatsApp sessions preserved after migration?

Yes. WhatsApp sessions are included by default and should continue to work without re-scanning.

Does the export include node_modules and build artifacts?

No. Large build folders and versioned artifacts (node_modules, .next, dist, .git, etc.) are excluded and should be rebuilt after import.

How do I include session transcripts or credentials?

Use the explicit flags to include them during export. Credentials are sensitive—only include them when you trust the destination and transport.