How to Migrate OpenClaw State Directory from ~/.moltbot to ~/.openclaw
I just updated OpenClaw and everything disappeared - my configuration, memory, skills, even my custom agents. All gone.
The panic was real.
I opened OpenClaw and was greeted with a fresh installation, as if I’d never used it before. No memory of previous conversations, no custom configurations, nothing. I thought all my work was lost.
But then I checked my home directory and found the culprit: a brand new ~/.openclaw folder sitting right next to my old ~/.moltbot folder.
The directory name changed, and OpenClaw stopped looking in the old location.
The Problem: Silent Breaking Change
OpenClaw renamed its default state directory from ~/.moltbot to ~/.openclaw. While this makes sense for branding consistency, the update doesn’t warn you or offer to migrate your data.
Here’s what happens if you update without migrating first:
Before update:~/.moltbot/ # Your data lives here├── SOUL.md # AI personality config├── USER.md # User preferences├── MEMORY.md # Conversation history├── agents/ # Custom agent definitions├── skills/ # Your custom skills└── .env # API keys and secrets
After update:~/.moltbot/ # Still exists, but ignored~/.openclaw/ # Fresh, empty directory created├── SOUL.md # Default config only├── USER.md # Default preferences├── MEMORY.md # Empty memory├── agents/ # Empty folder├── skills/ # Empty folder└── .env # Missing your keysYour data isn’t lost - it’s just orphaned in the old directory.
The Solution: Two Paths to Recovery
Path 1: Before Updating (The Easy Way)
If you haven’t updated yet, migrate the directory first:
# Check if old directory existsls -la ~/.moltbot
# Rename it to the new namemv ~/.moltbot ~/.openclaw
# Verify everything movedls -la ~/.openclaw
# Now safe to updatenpm install -g openclaw@latestThis is the clean approach - one command and you’re done.
Path 2: After Updating (The Recovery)
I already updated, so I needed the recovery path. Here’s what I did:
# First, verify old data still existsls -la ~/.moltbot
# You have three options:
# Option A: Nuclear (remove empty new dir, rename old one)rm -rf ~/.openclawmv ~/.moltbot ~/.openclaw
# Option B: Conservative (backup new, then replace)mv ~/.openclaw ~/.openclaw-empty-backupmv ~/.moltbot ~/.openclaw
# Option C: Surgical (merge specific files if you have changes in both)cp ~/.moltbot/SOUL.md ~/.openclaw/cp ~/.moltbot/USER.md ~/.openclaw/cp ~/.moltbot/MEMORY.md ~/.openclaw/cp -r ~/.moltbot/skills ~/.openclaw/cp -r ~/.moltbot/agents ~/.openclaw/cp ~/.moltbot/.env ~/.openclaw/I went with Option A since I hadn’t customized anything in the new directory yet.
Verification Steps
After migration, verify OpenClaw recognizes your configuration:
# Check critical files existls ~/.openclaw/{SOUL.md,USER.md,MEMORY.md} 2>/dev/null && echo "✓ Files present"
# Verify OpenClaw can read your configopenclaw config show
# Check if you have skills/agentsls ~/.openclaw/skills/ls ~/.openclaw/agents/Alternative: Keep Using the Old Directory
If you prefer not to move files, you can point OpenClaw to the old location with an environment variable:
# Add to your shell configuration (~/.bashrc or ~/.zshrc)export OPENCLAW_STATE_DIR=~/.moltbot
# Reload your shell configurationsource ~/.bashrc # or source ~/.zshrc
# Verify the variable is setecho $OPENCLAW_STATE_DIRThis approach works but requires you to remember the variable in every environment where you run OpenClaw.
Why This Happened
The directory rename from ~/.moltbot to ~/.openclaw aligns the state directory name with the product name. The previous versions would auto-detect the old ~/.moltbot directory if ~/.openclaw didn’t exist.
However, this auto-detection was removed in the latest version, which is what caused the breakage. No migration prompt, no warning, just silent orphaning of user data.
What You Stand to Lose
If you don’t migrate, here’s what goes missing:
| File/Folder | What’s Inside | Impact |
|---|---|---|
| SOUL.md | AI personality configuration | Agent personality resets |
| USER.md | User preferences | Settings reset to defaults |
| MEMORY.md | Conversation history | Context and knowledge lost |
| agents/ | Custom agent definitions | Workflows unavailable |
| skills/ | Custom skills | Automation tools missing |
| .env | Environment variables | API keys and endpoints missing |
The memory loss is particularly painful if you’ve built up significant context over time.
Migration Checklist
Before I forget again, here’s the checklist I’ll follow next time:
- Check if
~/.moltbotdirectory exists - Run
mv ~/.moltbot ~/.openclawBEFORE updating - Verify critical files present with
ls ~/.openclaw/{SOUL.md,USER.md,MEMORY.md} - Test OpenClaw starts with correct configuration
- Update any scripts that reference the old path
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments