Skip to content

Instantly share code, notes, and snippets.

@marclar
Last active March 13, 2026 12:55
Show Gist options
  • Select an option

  • Save marclar/ac89f9c71d8e8cad58d13787591ca693 to your computer and use it in GitHub Desktop.

Select an option

Save marclar/ac89f9c71d8e8cad58d13787591ca693 to your computer and use it in GitHub Desktop.

Revisions

  1. marclar revised this gist Mar 13, 2026. 1 changed file with 76 additions and 37 deletions.
    113 changes: 76 additions & 37 deletions mac-studio-to-nuc-migration-plan.md
    Original file line number Diff line number Diff line change
    @@ -4,15 +4,23 @@
    **Current Setup:** Mac Studio (M2 Ultra, macOS 15.2, ARM64)
    **Target Setup:** Intel NUC (Linux-based, likely Ubuntu/Debian, x86_64)

    ⚠️ **Updated Requirements:**
    - No local models (NUC not powerful enough)
    - Default model: Claude Sonnet (anthropic/claude-sonnet-4-20250514)
    - Must install Claude Code CLI
    - Discard workspace repos (will re-clone fresh)
    - Discard session history (fresh start)
    - Re-establish Slack/Signal connections

    ---

    ## 📋 Pre-Migration Checklist

    ### Current State Assessment
    - [x] **OpenClaw Gateway:** Running as LaunchAgent (PID 67650)
    - [x] **Active Sessions:** 1712 sessions, main agent active
    - [x] **Models:** Default qwen3-coder-next:latest (local), Anthropic Claude available
    - [x] **Channels:** Slack + Signal configured and operational
    - [x] **Models:** Default qwen3-coder-next:latest (local)**WILL CHANGE TO:** Claude Sonnet (cloud-only)
    - [x] **Channels:** Slack + Signal configured and operational**WILL NEED:** Re-establishment on NUC
    - [x] **Security:** 3 critical + 3 warn + 1 info (mainly Slack groupPolicy="open")
    - [x] **Storage:** 11GB used of 926GB available (~720GB free)
    - [x] **Workspace:** `/Users/cb/.openclaw/workspace` (~2.2GB with cerebruh.is repo)
    @@ -27,17 +35,19 @@
    - BWS access token and profile config
    - GitHub SSH key: `~/.openclaw/workspace/.ssh/github_marclar`
    - All API keys stored in Bitwarden Secrets (remote, safe)
    - **Slack/Signal:** Connection tokens (will need re-auth on NUC)

    3. **Workspace Data**
    - Repository: `cerebruh.is` (cloned with git history)
    3. **Workspace Data** ✂️ **SIMPLIFIED**
    - Documentation: `AGENTS.md`, `SOUL.md`, `USER.md`, etc.
    - Memory files: `MEMORY.md` + `memory/*.md`
    - Project files and scripts
    - ~~Repository clones~~ (will re-clone fresh)
    - ~~Session history~~ (fresh start on NUC)

    4. **Platform-Specific Dependencies**
    - Homebrew packages (`node`, `openclaw`)
    - Claude CLI (Anthropic subscription-based)
    - macOS-specific integrations (if any)
    - Node.js + OpenClaw
    - **Claude Code CLI** (required for GitHub automation)
    - BWS CLI from Bitwarden
    - Git, curl, basic CLI tools

    ---

    @@ -53,32 +63,40 @@
    ```
    4. **Install Required Tools**
    - `git`, `curl`, `wget`
    - `claude` CLI (if available on Linux/x86_64)
    - BWS CLI from Bitwarden
    - Any other CLI tools found in current setup
    - **Claude Code CLI** (critical for GitHub automation)
    - BWS CLI from Bitwarden
    - Basic development tools

    ### Phase 2: Data Migration
    1. **Export OpenClaw Configuration**
    1. **Export OpenClaw Configuration** ✂️ **SELECTIVE**
    ```bash
    # On Mac Studio
    tar -czf openclaw-backup.tar.gz ~/.openclaw/
    # On Mac Studio - only config + memory, skip sessions
    mkdir migration-data
    cp ~/.openclaw/openclaw.json migration-data/
    cp -r ~/.openclaw/workspace/memory migration-data/
    cp ~/.openclaw/workspace/{AGENTS,SOUL,USER,TOOLS,MEMORY,IDENTITY,HEARTBEAT}.md migration-data/
    cp ~/.openclaw/workspace/.ssh migration-data/ -r
    tar -czf migration-essentials.tar.gz migration-data/
    ```

    2. **Export Workspace**
    ```bash
    # On Mac Studio
    tar -czf workspace-backup.tar.gz ~/.openclaw/workspace/
    ```
    2. **Skip Large Data** 🚫
    - ~~Session history~~ (fresh start)
    - ~~Repository clones~~ (will re-clone)
    - ~~Local models~~ (cloud-only on NUC)

    3. **Secure Transfer**
    - Use `scp` or encrypted transfer to move archives
    - Transfer only `migration-essentials.tar.gz` (~few MB vs GB)
    - Verify checksums after transfer

    4. **Import on NUC**
    ```bash
    # On NUC
    tar -xzf openclaw-backup.tar.gz -C ~/
    tar -xzf workspace-backup.tar.gz -C ~/
    tar -xzf migration-essentials.tar.gz
    cp migration-data/openclaw.json ~/.openclaw/
    mkdir -p ~/.openclaw/workspace
    cp migration-data/*.md ~/.openclaw/workspace/
    cp -r migration-data/memory ~/.openclaw/workspace/
    cp -r migration-data/.ssh ~/.openclaw/workspace/
    ```

    ### Phase 3: Service Configuration
    @@ -99,10 +117,11 @@
    - Test Signal integration
    - Verify GitHub API access

    4. **Model Configuration**
    - Set up local models (qwen3-coder-next)
    - Configure Anthropic API access
    - Test Claude CLI if available on Linux
    4. **Model Configuration** 🌐 **CLOUD-ONLY**
    - Set default model to `anthropic/claude-sonnet-4-20250514`
    - Verify Anthropic API access
    - Test Claude Code CLI functionality
    - Remove any local model references from config

    ### Phase 4: Service Migration
    1. **Update External Service Endpoints**
    @@ -129,12 +148,19 @@
    - **Mitigation:** Download x86_64 versions of all binaries
    - **Specific Concern:** Local qwen3-coder model may need re-download

    ### Claude CLI Availability
    - **Risk:** Claude CLI might not be available on Linux
    ### Claude Code CLI Requirement ⚠️ **CRITICAL**
    - **Risk:** Claude Code CLI availability/installation on Linux x86_64
    - **Mitigation:**
    - Test availability during Phase 1
    - Alternative: Use API directly through OpenClaw
    - Fallback: Adjust github-agent workflow to use sessions_spawn
    - Test installation during Phase 1 (required before proceeding)
    - GitHub automation depends on this - no fallback to local models
    - If unavailable: Must revise GitHub agent workflow to use sessions_spawn + API

    ### Channel Re-establishment
    - **Risk:** Slack/Signal connections lost, need fresh setup
    - **Mitigation:**
    - Slack: Re-authenticate bot tokens, verify workspace permissions
    - Signal: May need device re-registration (QR code process)
    - Document new connection process for future reference

    ### Platform-Specific Features
    - **Risk:** macOS-specific integrations may break
    @@ -171,10 +197,12 @@
    - [ ] PR creation and merging works
    - [ ] CI gate scripts execute

    4. **Model Access**
    - [ ] Local models load and respond
    4. **Model Access** 🌐 **CLOUD-ONLY**
    - [ ] ~~Local models~~ (not using on NUC)
    - [ ] Anthropic API calls succeed
    - [ ] Claude Code CLI responds correctly
    - [ ] Token usage tracking accurate
    - [ ] Default model set to Claude Sonnet

    5. **Workspace Operations**
    - [ ] File read/write operations
    @@ -208,9 +236,10 @@ If migration fails or issues arise:
    ## 🎯 Post-Migration Optimization

    ### Performance Tuning
    - Monitor CPU/memory usage vs Mac Studio baseline
    - Monitor CPU/memory usage vs Mac Studio baseline
    - Adjust concurrent agent limits if needed
    - Optimize local model performance on x86_64
    - ~~Local model optimization~~ (cloud-only setup)
    - Monitor Anthropic API rate limits and costs

    ### Security Review
    - Complete security audit on new platform
    @@ -251,6 +280,16 @@ If migration fails or issues arise:

    ---

    **Estimated Migration Time:** 4-6 hours
    **Estimated Migration Time:** 3-4 hours**SIMPLIFIED**
    **Recommended Migration Window:** Weekend or low-activity period
    **Success Criteria:** All current functionality preserved, no data loss, <1hr total downtime
    **Success Criteria:**
    - OpenClaw gateway running on NUC
    - Claude Code CLI functional
    - Slack/Signal channels re-connected
    - GitHub automation working
    - Essential files preserved (configs, memory, docs)

    **What We're NOT Preserving:**
    - Session history (fresh start)
    - Repository clones (re-clone as needed)
    - Local models (cloud-only on NUC)
  2. marclar created this gist Mar 13, 2026.
    256 changes: 256 additions & 0 deletions mac-studio-to-nuc-migration-plan.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,256 @@
    # OpenClaw Migration Plan: Mac Studio → NUC

    **Migration Date:** TBD (Mac Studio return planned)
    **Current Setup:** Mac Studio (M2 Ultra, macOS 15.2, ARM64)
    **Target Setup:** Intel NUC (Linux-based, likely Ubuntu/Debian, x86_64)

    ---

    ## 📋 Pre-Migration Checklist

    ### Current State Assessment
    - [x] **OpenClaw Gateway:** Running as LaunchAgent (PID 67650)
    - [x] **Active Sessions:** 1712 sessions, main agent active
    - [x] **Models:** Default qwen3-coder-next:latest (local), Anthropic Claude available
    - [x] **Channels:** Slack + Signal configured and operational
    - [x] **Security:** 3 critical + 3 warn + 1 info (mainly Slack groupPolicy="open")
    - [x] **Storage:** 11GB used of 926GB available (~720GB free)
    - [x] **Workspace:** `/Users/cb/.openclaw/workspace` (~2.2GB with cerebruh.is repo)

    ### Critical Data Inventory
    1. **OpenClaw Configuration**
    - `~/.openclaw/openclaw.json` (6.8KB, modified Mar 8)
    - Agent configurations in `~/.openclaw/agents/`
    - Session history in `~/.openclaw/agents/main/sessions/`

    2. **Credentials & Secrets**
    - BWS access token and profile config
    - GitHub SSH key: `~/.openclaw/workspace/.ssh/github_marclar`
    - All API keys stored in Bitwarden Secrets (remote, safe)

    3. **Workspace Data**
    - Repository: `cerebruh.is` (cloned with git history)
    - Documentation: `AGENTS.md`, `SOUL.md`, `USER.md`, etc.
    - Memory files: `MEMORY.md` + `memory/*.md`
    - Project files and scripts

    4. **Platform-Specific Dependencies**
    - Homebrew packages (`node`, `openclaw`)
    - Claude CLI (Anthropic subscription-based)
    - macOS-specific integrations (if any)

    ---

    ## 🚀 Migration Strategy

    ### Phase 1: Environment Setup (NUC Preparation)
    1. **Install Base OS** (Ubuntu LTS or Debian Stable)
    2. **Install Node.js** (v25.7.0+ to match current)
    3. **Install OpenClaw**
    ```bash
    npm install -g openclaw
    # or curl install script
    ```
    4. **Install Required Tools**
    - `git`, `curl`, `wget`
    - `claude` CLI (if available on Linux/x86_64)
    - BWS CLI from Bitwarden
    - Any other CLI tools found in current setup

    ### Phase 2: Data Migration
    1. **Export OpenClaw Configuration**
    ```bash
    # On Mac Studio
    tar -czf openclaw-backup.tar.gz ~/.openclaw/
    ```

    2. **Export Workspace**
    ```bash
    # On Mac Studio
    tar -czf workspace-backup.tar.gz ~/.openclaw/workspace/
    ```

    3. **Secure Transfer**
    - Use `scp` or encrypted transfer to move archives
    - Verify checksums after transfer

    4. **Import on NUC**
    ```bash
    # On NUC
    tar -xzf openclaw-backup.tar.gz -C ~/
    tar -xzf workspace-backup.tar.gz -C ~/
    ```

    ### Phase 3: Service Configuration
    1. **Initialize OpenClaw Gateway**
    ```bash
    openclaw gateway start
    openclaw status # verify
    ```

    2. **Configure BWS Authentication**
    ```bash
    bws config # re-auth if needed
    # Test access to key credentials
    ```

    3. **Verify Channel Connectivity**
    - Test Slack bot connection
    - Test Signal integration
    - Verify GitHub API access

    4. **Model Configuration**
    - Set up local models (qwen3-coder-next)
    - Configure Anthropic API access
    - Test Claude CLI if available on Linux

    ### Phase 4: Service Migration
    1. **Update External Service Endpoints**
    - Hetzner VMs: Update any hardcoded Mac Studio IPs
    - Webhooks: Redirect to NUC endpoints if applicable
    - DNS/networking: Ensure NUC is reachable

    2. **Cron Jobs & Automation**
    - Migrate any scheduled tasks
    - Verify GitHub agent automation works
    - Test heartbeat functionality

    3. **Security Hardening**
    - Address security audit findings
    - Configure firewall rules
    - Set up proper systemd services (vs macOS LaunchAgents)

    ---

    ## ⚠️ Migration Risks & Mitigation

    ### Architecture Differences (ARM64 → x86_64)
    - **Risk:** Binary incompatibility, especially local models
    - **Mitigation:** Download x86_64 versions of all binaries
    - **Specific Concern:** Local qwen3-coder model may need re-download

    ### Claude CLI Availability
    - **Risk:** Claude CLI might not be available on Linux
    - **Mitigation:**
    - Test availability during Phase 1
    - Alternative: Use API directly through OpenClaw
    - Fallback: Adjust github-agent workflow to use sessions_spawn

    ### Platform-Specific Features
    - **Risk:** macOS-specific integrations may break
    - **Mitigation:**
    - Audit current skills for macOS dependencies
    - Replace with Linux equivalents where possible
    - Document any lost functionality

    ### Service Interruption
    - **Risk:** Downtime during migration
    - **Mitigation:**
    - Perform migration during low-activity period
    - Keep Mac Studio running until NUC is fully verified
    - Gradual cutover with rollback plan

    ---

    ## 🔍 Testing & Validation Plan

    ### Core Functionality Tests
    1. **OpenClaw Gateway**
    - [ ] Dashboard accessible
    - [ ] WebSocket connections stable
    - [ ] Agent spawning works

    2. **Channel Integration**
    - [ ] Slack bot responds to mentions
    - [ ] Signal messages route correctly
    - [ ] Message delivery and reactions work

    3. **GitHub Automation**
    - [ ] GitHub agent can scan issues
    - [ ] Claude Code integration functional
    - [ ] PR creation and merging works
    - [ ] CI gate scripts execute

    4. **Model Access**
    - [ ] Local models load and respond
    - [ ] Anthropic API calls succeed
    - [ ] Token usage tracking accurate

    5. **Workspace Operations**
    - [ ] File read/write operations
    - [ ] Git operations (clone, push, pull)
    - [ ] BWS credential access
    - [ ] Memory search functionality

    ---

    ## 📅 Rollback Plan

    If migration fails or issues arise:

    1. **Keep Mac Studio Available**
    - Don't wipe until NUC is 100% validated
    - Maintain parallel operation initially

    2. **Quick Revert Procedure**
    ```bash
    # On Mac Studio
    openclaw gateway start # if stopped
    # Update any external service endpoints back
    ```

    3. **Data Sync Back**
    - If work happened on NUC, sync changes back to Mac Studio
    - Ensure no data loss during transition

    ---

    ## 🎯 Post-Migration Optimization

    ### Performance Tuning
    - Monitor CPU/memory usage vs Mac Studio baseline
    - Adjust concurrent agent limits if needed
    - Optimize local model performance on x86_64

    ### Security Review
    - Complete security audit on new platform
    - Implement systemd service isolation
    - Configure proper user permissions
    - Set up fail2ban or similar protection

    ### Monitoring Setup
    - Set up health check automation
    - Configure log rotation
    - Implement backup schedules for critical data

    ---

    ## 📝 Migration Log Template

    ```markdown
    ## Migration Execution Log

    ### Pre-Migration (Date: _______)
    - [ ] Mac Studio data backed up
    - [ ] NUC environment ready
    - [ ] All stakeholders notified

    ### Migration Day (Date: _______)
    - [ ] Data transferred successfully
    - [ ] OpenClaw started on NUC
    - [ ] Basic functionality verified
    - [ ] Channels responding
    - [ ] GitHub integration tested

    ### Post-Migration (Date: _______)
    - [ ] 24-hour stability confirmed
    - [ ] Performance benchmarked
    - [ ] All automation verified
    - [ ] Mac Studio safely decommissioned
    ```

    ---

    **Estimated Migration Time:** 4-6 hours
    **Recommended Migration Window:** Weekend or low-activity period
    **Success Criteria:** All current functionality preserved, no data loss, <1hr total downtime