Clawdie Migration Plan

Move from OpenClaw v2 (domedog) → controlplane jail (FreeBSD/Bastille)

Overview

CurrentTarget
/home/clawdija/asistent/v2 /jail/controlplane/home/clawdie
OpenClaw v2 (full stack) NanoClaw-based controlplane (minimal)
Linux (Ubuntu/Debian) FreeBSD 15 jail with VNET
34+ extensions Telegram only (skill-based)
Supabase memory (existing) Same Supabase (migrated scripts)

Skills to Activate

SkillPurposePhase
warden-bootstrapCreate controlplane jail0
warden-zfsDataset layout, snapshots0
bastille-networkBridge + VNET setup0
warden-pfNAT and firewall0
add-telegramTelegram channel code1
telegram-adminBot token + chat registration2
sanoidAutomated ZFS snapshots3
nginx-glasspaneWeb operator surface3
tmux-screenshotPane capture to PNG3
browser-vmFuture Linux VM for browser4

Memory System Migration

The memory system must survive the migration unchanged. Same Supabase backend, same scripts (adapted for FreeBSD paths), same continuity.

Files to migrate

# Identity (my "self")
SOUL.md          → workspace/SOUL.md
IDENTITY.md      → workspace/IDENTITY.md
USER.md          → workspace/USER.md

# Memory system
MEMORY.md        → workspace/MEMORY.md
HEARTBEAT.md     → workspace/HEARTBEAT.md
memory/*.md      → workspace/memory/*.md

# Scripts (adapt paths)
memory-common.sh → workspace/scripts/memory-common.sh
memory-archive.sh → workspace/scripts/memory-archive.sh
memory-recall.sh → workspace/scripts/memory-recall.sh
memory-hydrate.sh → workspace/scripts/memory-hydrate.sh

# Secrets
.env (SUPABASE_*) → workspace/.env

Path adaptations needed

# Current (Linux)
ASISTENT_DIR="/home/clawdija/asistent"
WORKSPACE_DIR="${ASISTENT_DIR}/current/workspace"

# Target (FreeBSD jail)
ASISTENT_DIR="/home/clawdie"
WORKSPACE_DIR="${ASISTENT_DIR}/workspace"

# Or use relative paths from script location:
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
WORKSPACE_DIR="$(dirname "$SCRIPT_DIR")"

Phase 0: Jail Creation

Prerequisites

  • FreeBSD 15 host with ZFS
  • Bastille installed
  • warden0 bridge configured
  • pf NAT for 10.0.0.0/24

Commands (from warden-bootstrap skill)

# Bootstrap FreeBSD 15 release
bastille bootstrap -p 15.0-RELEASE

# Create thick VNET control-plane jail
bastille create -T -B controlplane 15.0-RELEASE 10.0.0.100/24 warden0

# Set canonical hostname
bastille config controlplane set host.hostname ai.clawdie.si
bastille restart controlplane

# Verify
jls
jexec controlplane hostname

Phase 1: Runtime Setup

Inside the jail

# Enter jail
bastille console controlplane

# Install dependencies
pkg install -y node npm git python3 gmake bash

# Create clawdie user
pw useradd -n clawdie -m -s /usr/local/bin/bash

# Clone repo
su - clawdie
git clone git@codeberg.org:Clawdie/Clawdie-AI.git ~/controlplane
cd ~/controlplane
npm install

Phase 2: Identity & Memory

Migrate identity files

# From domedog host
scp /home/clawdija/asistent/v2/workspace/SOUL.md \
    clawdie@controlplane:~/controlplane/workspace/

scp /home/clawdija/asistent/v2/workspace/IDENTITY.md \
    clawdie@controlplane:~/controlplane/workspace/

scp /home/clawdija/asistent/v2/workspace/USER.md \
    clawdie@controlplane:~/controlplane/workspace/

scp /home/clawdija/asistent/v2/workspace/MEMORY.md \
    clawdie@controlplane:~/controlplane/workspace/

scp /home/clawdija/asistent/v2/workspace/HEARTBEAT.md \
    clawdie@controlplane:~/controlplane/workspace/

Migrate memory scripts (with path adaptations)

# Copy scripts
scp /home/clawdija/asistent/v2/workspace/memory-*.sh \
    clawdie@controlplane:~/controlplane/workspace/scripts/

# Edit memory-common.sh to update paths
# ASISTENT_DIR="/home/clawdie"
# WORKSPACE_DIR="/home/clawdie/workspace"

Migrate Supabase credentials

# Create .env in jail
cat > ~/controlplane/workspace/.env << 'EOF'
SUPABASE_URL=https://auyhdxukhhthlunivdqa.supabase.co
SUPABASE_SERVICE_ROLE_KEY=
EOF

Phase 3: Telegram Setup

Apply add-telegram skill

cd ~/controlplane
npm run setup  # or the skill apply command

Configure bot token

# Add to .env
TELEGRAM_BOT_TOKEN=

Register admin chat (telegram-admin skill)

  1. Start Clawdie: npm run dev
  2. Send a message to the bot from Telegram
  3. Discover chats and register admin

Phase 4: Validation

Pre-cutover checklist

  • [ ] Jail running: jls shows controlplane
  • [ ] Outbound network: jexec controlplane fetch -qo- https://api.telegram.org
  • [ ] Node works: jexec controlplane node --version
  • [ ] Identity files present in workspace/
  • [ ] Memory scripts executable and working
  • [ ] Supabase connection: ./memory-recall.sh recent
  • [ ] Telegram responds to messages
  • [ ] ZFS snapshot created: zfs snapshot zroot/clawdie-runtime/jails/controlplane@pre-cutover

Phase 5: Cutover

Switch from v2 to controlplane

# On domedog host (not in jail)

# 1. Stop v2 gateway
tmux send-keys -t openclaw:gateway C-c
# or: pkill -f "openclaw gateway"

# 2. Verify stopped
curl -s http://127.0.0.1:18789/health || echo "v2 stopped"

# 3. Start controlplane (in jail)
# Option A: tmux inside jail
# Option B: bastille cmd with background process

# 4. Test Telegram message

# 5. Archive v2 (don't delete yet)
mv /home/clawdija/asistent/v2 /home/clawdija/asistent/v2-archived-$(date +%Y%m%d)

Phase 6: Post-Migration

Enable automation

  • sanoid skill: Automated ZFS snapshots
  • nginx-glasspane: Web operator surface
  • Cron jobs for heartbeat, memory archive

Future enhancements

  • browser-vm: Linux VM for browser automation
  • Worker jails for parallel agent execution
  • Tailscale inside jail (optional)

Rollback Plan

If something goes wrong, rollback is simple:
# 1. Stop controlplane
bastille stop controlplane

# 2. Rollback ZFS snapshot (if created)
zfs rollback zroot/clawdie-runtime/jails/controlplane@pre-cutover

# 3. Restart v2
cd /home/clawdija/asistent/v2
# ... start v2 gateway

# 4. Or restore archived v2
mv /home/clawdija/asistent/v2-archived-YYYYMMDD /home/clawdija/asistent/v2