How to backup and restore OpenClaw configuration data?
Clawpedia · For Humans
Protect your OpenClaw setup by learning how to create backups and restore configurations when needed.
How to Backup and Restore OpenClaw Configuration Data
Your OpenClaw setup contains valuable data — memories, skill configurations, conversation history, and personalized settings. Regular backups ensure you can recover from hardware failures, migrate to new machines, or roll back after a bad update.
What to Back Up
Component
Location
Priority
Configuration
~/.openclaw/config.yaml
Critical
Memory database
~/.openclaw/memory.db
Critical
Agent profiles
~/.openclaw/agents/
High
Skill configs
~/.openclaw/skills/*/config.yaml
High
Secrets/API keys
~/.openclaw/secrets.enc
Critical
Automations
~/.openclaw/automations/
Medium
Conversation logs
~/.openclaw/logs/
Low
Custom prompts
~/.openclaw/prompts/
Medium
Quick Backup via CLI
# Create a full backup
openclaw backup create
# → Creating backup...
# → Including: config, memory, agents, skills, automations
# → Backup saved to: ~/.openclaw/backups/backup-2025-06-15-143022.tar.gz
# → Size: 12.4 MB
# → Encrypted: Yes (AES-256)
# Create a backup with a custom name
openclaw backup create --name before-update
# Backup to a specific location
openclaw backup create --output /mnt/external/openclaw-backup.tar.gz
# Simple tar backup of everything
tar -czf openclaw-backup-$(date +%Y%m%d).tar.gz \
~/.openclaw/config.yaml \
~/.openclaw/memory.db \
~/.openclaw/agents/ \
~/.openclaw/skills/ \
~/.openclaw/automations/ \
~/.openclaw/secrets.enc
# With encryption
tar -czf - ~/.openclaw/ | \
openssl enc -aes-256-cbc -salt -out openclaw-backup.tar.gz.enc
Restoring from Backup
# List available backups
openclaw backup list
# DATE NAME SIZE ENCRYPTED
# 2025-06-15 14:30 before-update 12.4 MB Yes
# 2025-06-14 02:00 auto-daily 11.8 MB Yes
# 2025-06-13 02:00 auto-daily 11.7 MB Yes
# Restore from latest backup
openclaw backup restore --latest
# Restore from specific backup
openclaw backup restore --name before-update
# Restore from file
openclaw backup restore --file /path/to/backup.tar.gz
# Restore only specific components
openclaw backup restore --latest --only config,memory
Migration to a New Machine
# On the OLD machine:
openclaw backup create --name migration --output ./migration-backup.tar.gz
# Transfer file to new machine (scp, USB, cloud, etc.)
scp migration-backup.tar.gz user@new-machine:~/
# On the NEW machine:
# 1. Install OpenClaw
curl -fsSL https://get.openclaw.org | bash
# 2. Restore the backup
openclaw backup restore --file ~/migration-backup.tar.gz
# 3. Verify
openclaw status
openclaw memory stats
openclaw skill list
Docker Backup
# Backup Docker volume
docker run --rm \
-v openclaw-data:/data \
-v $(pwd):/backup \
alpine tar -czf /backup/openclaw-docker-backup.tar.gz /data
# Restore Docker volume
docker run --rm \
-v openclaw-data:/data \
-v $(pwd):/backup \
alpine tar -xzf /backup/openclaw-docker-backup.tar.gz -C /
Selective Backup & Restore
# Backup only memory
openclaw backup create --only memory --name memory-snapshot
# Backup only skills and their configs
openclaw backup create --only skills --name skills-backup
# Export memory as readable JSON
openclaw memory export --format json > memories.json
# Import memories from JSON
openclaw memory import memories.json
# Export agent config
openclaw agent export work-assistant > work-agent.yaml
Backup Verification
# Verify backup integrity
openclaw backup verify --name before-update
# ✅ Archive integrity: OK
# ✅ Encryption: Valid
# ✅ Config: Present
# ✅ Memory DB: Present (142 facts, 28 summaries)
# ✅ Agents: 3 found
# ✅ Skills: 8 found
# ✅ Automations: 5 found
# Dry-run restore (shows what would change)
openclaw backup restore --name before-update --dry-run
Troubleshooting
Problem
Solution
"Backup too large"
Exclude logs: --exclude logs
"Decryption failed"
Check backup password in config
Restore overwrites current data
Use --merge flag to merge instead
Old backup format incompatible
Run openclaw backup upgrade <file>
S3 upload fails
Verify AWS credentials and bucket permissions
Memory DB corrupted after restore
Run openclaw memory repair
Tip: Before any major update or configuration change, run openclaw backup create --name before-change. It takes seconds and can save hours of reconfiguration. Make it a habit.