🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Agent Migrate

by @haha8d

Cross-platform agent migration and deployment. Use when: (1) migrating OpenClaw agent to new servers, (2) backing up and restoring agent state, (3) deploying...

Versionv1.0.0
Downloads1,114
TERMINAL
clawhub install agent-migrate

πŸ“– About This Skill


name: agent-migrate description: "Cross-platform agent migration and deployment. Use when: (1) migrating OpenClaw agent to new servers, (2) backing up and restoring agent state, (3) deploying agent configurations across environments, (4) syncing workspace between development and production. NOT for: general file backup, non-agent data migration."

Agent Migration

Migrate OpenClaw agents across servers and platforms while preserving identity, memory, and configuration.

When to Use

βœ… USE this skill when:

  • Moving agent from local machine to remote server
  • Cloning agent configuration to multiple environments
  • Backing up complete agent state for disaster recovery
  • Syncing workspace changes between dev/prod
  • Upgrading OpenClaw with full rollback capability
  • ❌ DON'T use when:

  • Simple file copy operations β†’ use cp/rsync directly
  • Database migrations β†’ use database-specific tools
  • Non-OpenClaw application deployment
  • Core Concepts

    Agent State Components

    Agent State = Identity + Memory + Config + Skills + Extensions
    β”œβ”€β”€ workspace/           # Core identity files
    β”‚   β”œβ”€β”€ IDENTITY.md      # Who the agent is
    β”‚   β”œβ”€β”€ USER.md          # Who they serve
    β”‚   β”œβ”€β”€ SOUL.md          # Personality
    β”‚   β”œβ”€β”€ MEMORY.md        # Long-term memory
    β”‚   β”œβ”€β”€ AGENTS.md        # Operational rules
    β”‚   β”œβ”€β”€ TOOLS.md         # Environment notes
    β”‚   └── memory/          # Daily logs
    β”œβ”€β”€ .openclaw/
    β”‚   β”œβ”€β”€ openclaw.json    # Gateway config
    β”‚   β”œβ”€β”€ agents/          # Session data
    β”‚   └── extensions/      # Custom plugins
    └── skills/              # Custom skills (if any)
    

    Migration Workflows

    #### 1. Export (Source Machine)

    # Full agent export
    ./scripts/export-agent.sh [export-name]

    Creates:

    /tmp/agent-export-[name]/

    β”œβ”€β”€ manifest.json # Export metadata

    β”œβ”€β”€ workspace.tar.gz # Core files

    β”œβ”€β”€ config.tar.gz # OpenClaw config

    └── restore.sh # Self-contained restore

    #### 2. Transfer

    # Via SSH
    scp -r /tmp/agent-export-[name] user@new-server:/tmp/

    Via GitHub (recommended for versioned deployments)

    Push to repo, clone on target

    #### 3. Import (Target Machine)

    # Run self-contained restore
    cd /tmp/agent-export-[name] && ./restore.sh

    Or manual:

    ./scripts/import-agent.sh /tmp/agent-export-[name]

    Scripts

    Export Agent

    scripts/export-agent.sh [name] [--full]
    

    Options:

  • name - Export identifier (default: timestamp)
  • --full - Include session history and logs
  • Import Agent

    scripts/import-agent.sh  [--merge|--replace]
    

    Options:

  • --merge - Merge with existing agent (default)
  • --replace - Wipe existing, clean install
  • Sync to GitHub

    scripts/sync-github.sh  [--push|--pull]
    

    Syncs agent state to GitHub for versioned deployment.

    Platform-Specific Notes

    Linux β†’ Linux

    Direct transfer, no conversion needed.

    macOS β†’ Linux

  • Check for macOS-specific paths in scripts
  • Update file watchers if used
  • Windows WSL β†’ Native Linux

  • Line endings auto-handled
  • Verify executable permissions
  • Docker Deployment

    See references/docker-deploy.md for containerized deployment.

    Security Checklist

  • [ ] Sanitize openclaw.json (remove sensitive tokens before export)
  • [ ] Verify target machine permissions
  • [ ] Rotate any exposed credentials post-migration
  • [ ] Test agent functionality before production cutover
  • Rollback

    Exports are immutable snapshots. To rollback:

    # Re-import previous export
    ./scripts/import-agent.sh /path/to/previous-export --replace
    

    ⚑ When to Use

    TriggerAction
    - Moving agent from local machine to remote server
    - Cloning agent configuration to multiple environments
    - Backing up complete agent state for disaster recovery
    - Syncing workspace changes between dev/prod
    - Upgrading OpenClaw with full rollback capability
    ❌ **DON'T use when:**
    - Simple file copy operations β†’ use `cp`/`rsync` directly
    - Database migrations β†’ use database-specific tools
    - Non-OpenClaw application deployment