Your OpenClaw agent accumulates valuable data over time: conversation history, memory, skills, and configuration files. Losing this data means starting from scratch — rebuilding your agent's personality, knowledge, and automation. This guide covers everything you need to back up and restore your OpenClaw installation.
OpenClaw backup strategy overview
What You Need to Back Up
1. Configuration Files
Location:~/.openclaw/config.yaml
This file contains all your settings: model preferences, channel configurations, cron jobs, safety rules, and more. Losing this means reconfiguring everything from scratch.
2. SOUL.md
Location:~/.openclaw/SOUL.md
Your agent's personality, instructions, and context. This is often the most time-consuming thing to recreate because it is refined over weeks of use.
3. Memory Database
Location:~/.openclaw/data/memory.db
The SQLite database containing your agent's long-term memory, conversation history, and learned preferences. This is what makes your agent "know" you.
4. Skills
Location:~/.openclaw/skills/
Installed skills and their configurations. While skills can be reinstalled, custom skill configurations and any locally modified skills should be preserved.
5. Cron Jobs
Location: Stored in memory.db but worth exporting separately.
# Sync backups to a remote server
rsync -avz --delete "$BACKUP_DIR/" user@backup-server:/backups/openclaw/
Google Drive (via rclone)
# Configure rclone for Google Drive
rclone config
# Upload backup
rclone copy "$BACKUP_DIR/$BACKUP_NAME.tar.gz" gdrive:openclaw-backups/
Restore Process
Full Restore
# Stop OpenClaw
openclaw stop
# Extract backup
tar xzf openclaw-20260405-020000.tar.gz
cd openclaw-20260405-020000
# Restore configuration
cp config.yaml ~/.openclaw/
cp SOUL.md ~/.openclaw/
# Restore database
cp memory.db ~/.openclaw/data/
# Restore skills
tar xzf skills.tar.gz -C ~/.openclaw/
# Restore drive
tar xzf drive.tar.gz -C ~/.openclaw/
# Restore environment
gpg --decrypt env.gpg > ~/.openclaw/.env # If encrypted
# OR
cp .env ~/.openclaw/ # If unencrypted
# Import cron jobs
openclaw cron import cron-jobs.yaml
# Start OpenClaw
openclaw start
# Verify
openclaw status
openclaw memory stats
openclaw cron list
Partial Restore
Sometimes you only need to restore specific components:
# Restore only SOUL.md
cp backup/SOUL.md ~/.openclaw/
# Restore only memory
openclaw stop
cp backup/memory.db ~/.openclaw/data/
openclaw start
# Restore only cron jobs
openclaw cron import backup/cron-jobs.yaml
Restore to a New Server
When migrating to a new server:
Install OpenClaw on the new server
Copy the backup archive to the new server
Follow the full restore process above
Update channel webhooks (they point to the old server's URL)
Update DNS if using a custom domain
Test all channels
Restore process flowchart
Docker Backup
If you run OpenClaw in Docker, back up the mounted volumes:
# Stop the container
docker compose down
# Back up volumes
tar czf openclaw-docker-backup-$(date +%Y%m%d).tar.gz \
config/ data/ skills/
# Restart
docker compose up -d
For zero-downtime backups, use Docker volume snapshots:
# Create a snapshot while running (brief pause)
docker run --rm \
-v openclaw_data:/source:ro \
-v $(pwd):/backup \
alpine tar czf /backup/data-snapshot.tar.gz -C /source .
Backup Verification
A backup is worthless if you cannot restore it. Verify your backups regularly:
#!/bin/bash
# verify-backup.sh — Test backup integrity
LATEST_BACKUP=$(ls -t ~/openclaw-backups/openclaw-*.tar.gz | head -1)
# Test archive integrity
tar tzf "$LATEST_BACKUP" > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "FAILED: Backup archive is corrupted"
# Send alert
exit 1
fi
# Check expected files exist
tar tzf "$LATEST_BACKUP" | grep -q "config.yaml"
tar tzf "$LATEST_BACKUP" | grep -q "memory.db\|memory.json"
tar tzf "$LATEST_BACKUP" | grep -q "SOUL.md"
echo "PASSED: Backup verified successfully"
Schedule verification and get notified of failures via Inbounter:
openclaw cron add --name "verify-backup" "0 3 * * *" \
"Run /home/user/scripts/verify-backup.sh.
If verification fails, send an urgent email via Inbounter to admin@company.com
with subject 'OpenClaw Backup Verification Failed'."
Backup verification checklist
Backup Best Practices
1. Follow the 3-2-1 Rule
3 copies of your data
2 different storage media
1 offsite copy
For OpenClaw: local backup + cloud backup + the live system itself.
2. Encrypt Sensitive Data
API keys, credentials, and personal conversation history should always be encrypted:
Set a calendar reminder to test a full restore every three months. Use a separate server or Docker container for testing.
4. Monitor Backup Size
Track backup size over time. Unexpected growth might indicate a memory leak or runaway logging:
du -sh ~/openclaw-backups/openclaw-*.tar.gz | tail -5
5. Exclude Unnecessary Files
Logs and temporary files waste backup space:
# In your backup script, exclude:
--exclude='*.log'
--exclude='tmp/'
--exclude='cache/'
--exclude='node_modules/'
6. Document Your Backup Process
Store your backup scripts and restore instructions alongside your backups. Future you (or a colleague) will thank you.
Disaster Recovery Plan
Have a written plan for when things go wrong:
Detection: How will you know something went wrong? Set up health checks that alert you via Inbounter email or SMS.
Assessment: Check what was lost (config only? memory? everything?).
Recovery: Follow the restore process for the appropriate scope.
Verification: Test all channels, cron jobs, and skills after restore.
Post-mortem: Document what caused the failure and how to prevent it.
Recovery Time Objective (RTO): With proper backups, you should be able to restore a fully functional OpenClaw agent in under 30 minutes.
Frequently Asked Questions
How often should I back up?
Daily for most users. If your agent handles critical tasks, consider more frequent database backups (every 6 hours).
How much storage do backups need?
A typical OpenClaw installation is 50-200 MB. With 30-day retention of daily backups, budget 2-6 GB of storage.
Can I back up while OpenClaw is running?
For configuration and skills, yes. For the database, use openclaw memory export or sqlite3 .backup for consistency. Copying the database file while it is being written can result in corruption.
Do I need to back up skills if they are from the public registry?
Skills can be reinstalled, but custom configurations and locally modified skills should be backed up. The backup script in this guide handles this by excluding node_modules and compressing the rest.
What if I lose my API keys?
Regenerate them from your provider's dashboard (Anthropic, OpenAI, Google). This is why encrypting your .env backup is important — it is the only copy of these keys outside the provider.
Can OpenClaw back itself up?
Yes, by scheduling a backup script via OpenClaw cron. Just make sure the backup process does not require the agent to be stopped, or use the sqlite3 .backup method for the database.
Never miss a backup failure alert. Inbounter provides email and SMS APIs for AI agents — get instant notifications when your OpenClaw backups fail.
Build faster with SuperBuilder
Run parallel Claude Code agents with built-in cost tracking, task queuing, and worktree isolation. Free and open source.