Migrating OpenClaw to a new machine
Setting up a new machine is always a bit of a headache. I usually spend a lot of time trying to remember which config files I need to move so I don’t lose my history or have to log in to every service again.
If you are moving your OpenClaw setup, you definitely don’t want to redo the onboarding process or lose your agent’s memory. This guide helps you move everything to a new machine while keeping your sessions and credentials intact.
What You’ll Need
Section titled “What You’ll Need”- Access to your old machine to run commands and copy files.
- The path to your state directory (usually
~/.openclaw/). - The path to your workspace directory (usually
~/.openclaw/workspace/). - OpenClaw CLI installed on your new machine.
Quick Start
Section titled “Quick Start”- Locate your data: On your old machine, run
openclaw status. Look for theOPENCLAW_STATE_DIRor profile name in the output so you know exactly which folders to copy. - Stop the gateway: Run
openclaw gateway stopon the old machine. This prevents files from changing while you are trying to copy them. - Create backups: Archive your state and workspace directories.
Terminal window cd ~tar -czf openclaw-state.tgz .openclawtar -czf openclaw-workspace.tgz .openclaw/workspace - Install on the new machine: Install the CLI on your new computer. It is fine if the installation process creates a fresh
~/.openclaw/folder, as you will replace it in the next step. - Move and extract: Copy your archives to the new machine. Extract them to the correct locations, making sure you include hidden directories like
.openclaw/. - Repair and start: Run
openclaw doctoron the new machine to fix services and apply any needed migrations. Then, runopenclaw gateway restart.
Troubleshooting
Section titled “Troubleshooting”- Profile or state-dir mismatch: If you used a specific
--profileon your old machine, you must use that same profile on the new one. If you don’t, you might see empty session histories or missing channels. Runopenclaw doctorafter you switch to the correct profile. - Missing credentials: If you only copied the
openclaw.jsonfile, your logins will not work. You must copy the entire$OPENCLAW_STATE_DIRfolder because that is where credentials and agent states are stored. - Permissions and ownership: If you copied files using a different user or as root, the gateway might fail to read your data. Check the file ownership and ensure the user running the gateway has full access to the state and workspace folders.
- Remote vs Local mode: If your UI is pointing at a remote gateway, moving files on your local laptop won’t change anything. In this case, you need to migrate the actual host where the gateway is running.
Verification Checklist
Section titled “Verification Checklist”Before you get back to work, check these four things on your new machine:
- Run
openclaw statusto confirm the gateway is running. - Open the dashboard to see if your existing sessions are there.
- Check that your channels (like WhatsApp) are still connected without needing to re-pair.
- Verify that your workspace files, like memory and skills notes, are present.
If you run into any other issues during the move, check out the AI Setup Assistant.
What’s Next
Section titled “What’s Next”OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.