OpenClaw Upgrade Guide: How to Update Without Breaking Your Config
Your OpenClaw agent is running perfectly. Then you see a new feature in the release notes. You think about an openclaw update | openclaw upgrade, update openclaw safely, but you hesitate. What if the new version breaks your custom tools or wipes your agent’s memory? You’re right to be cautious.
Upgrading isn’t just clicking a button. It’s a process. If you do it wrong, you can lose configurations, break integrations, or spend hours debugging. The fear of breaking a working system is real, and it’s the main reason people run outdated, insecure software.
This guide is for that moment. We’ll walk through the exact steps to pull the latest code, update dependencies, and migrate your data without a single hiccup. You’ll learn how to test the upgrade in isolation before touching your live agent.
By the end, you’ll have a repeatable, safe upgrade checklist. You’ll be able to deploy new versions with confidence, not anxiety, and keep your agent on the cutting edge.
What You Need Before Starting
Upgrading is like changing the engine on a moving car. You need the right tools and a safe place to pull over. These prerequisites are your safety gear. Skip them, and you risk breaking the car.
- A working OpenClaw installation: You need a stable base. If your current setup is already broken, fix it first. An upgrade won’t solve existing problems.
- Git installed and configured: This is how you pull the new code. Without it, you’re manually copying files, which is error-prone and messy.
- Docker and Docker Compose: OpenClaw runs in containers. These tools manage the entire environment. Your upgrade process will use them to rebuild services cleanly.
- Access to your project directory: You need to know where your
openclaw/folder lives and have permission to write to it. This is your workshop. - Your agent’s brain backed up: This means your database and any custom tool files. If something goes wrong, this backup is your undo button.
Setting Up Your Environment
This setup creates a controlled upgrade lab. You’re not touching your live agent yet. You’re making a copy, testing the upgrade there, and only then applying it to the real thing. It’s the difference between testing a parachute on the ground versus jumping out of a plane.
1. Navigate to Your OpenClaw Project
You need to be in the right directory. All commands from this point forward assume you’re in the openclaw folder. If you’re not, the commands will fail silently.
You are my OpenClaw agent. Do the following:
1. Find my OpenClaw project directory. Look for common paths like ~/openclaw, /opt/openclaw, or check my environment for an OPENCLAW_DIR variable.
2. Navigate to that directory and confirm you are there by running `pwd` and checking for the `docker-compose.yml` file with `ls -la`.
3. Report the full path back to me.
Your agent will tell you the exact path. If it can’t find it, you’ll need to locate it manually and cd there yourself.
2. Stop Your Running Agent Services
You can’t upgrade software that’s actively running. This step gracefully shuts down the containers. It’s like turning off the engine before an oil change.
You are my OpenClaw agent. Do the following from the OpenClaw project directory:
1. Stop all running services using Docker Compose. Run: `docker-compose down`
2. Verify the containers are stopped by running: `docker ps`. You should not see any containers with names containing "openclaw" or "postgres".
3. Confirm the shutdown is complete.
You’ll see Docker removing containers and networks. When it’s done, your agent is offline. This is normal.
3. Create a Backup of Your Data
This is your single most important step. Your agent’s memories, conversations, and tool configurations live in the PostgreSQL database and the tools/ directory. This command creates a snapshot you can restore in under a minute.
# Run this from your openclaw project directory.
# It creates timestamped backup files right there.
docker-compose exec -T postgres pg_dump -U openclaw openclaw > ./db_backup_$(date +%Y%m%d_%H%M%S).sql
tar czf ./tools_backup_$(date +%Y%m%d_%H%M%S).tar.gz ./tools/ 2>/dev/null || echo "Custom tools directory not found, skipping."
You should see two new files: a .sql file (your database) and a .tar.gz file (your custom tools). Keep these safe. If the tar command warns about a missing tools/ directory, that’s fine, it just means you haven’t created any custom tools yet.
4. Stash or Commit Your Local Changes
If you’ve modified any OpenClaw source files (like adding a custom tool in the project’s tools/ folder), you need to protect those changes before Git pulls new code. Otherwise, they might get overwritten or cause merge conflicts. Think of it as moving your personal belongings out of a room before the cleaners arrive.
You are my OpenClaw agent. Do the following:
1. Check if there are any uncommitted changes in the Git repository. Run: `git status`
2. If there are changes, stash them with a descriptive message. Run: `git stash push -m "Pre-upgrade stash for custom tools, $(date)"`
3. List your stashes to confirm it's saved: `git stash list`
4. Report the outcome. If `git status` was clean, just tell me there were no local changes to save.
Your agent will show you the stash it created. You can apply it back later with git stash pop. If you get a Git error, you might not be in a Git repository, this happens if you installed via a direct download. That’s okay, but be aware that your next step will be different.
