OpenClaw Backup and Recovery: Protecting Your Agent Memory
How to back up and recover OpenClaw data. Protect your agent memory, configuration, and skills with a solid backup strategy.
Your OpenClaw agent accumulates valuable memory over time — conversation context, learned preferences, research notes, and automation logic. Losing this data through a server failure, accidental deletion, or upgrade gone wrong is genuinely painful. This guide covers backup strategies for both self-hosted and managed instances.
What to Back Up
Critical (back up daily):
- Agent memory database (
~/.openclaw/memory/) - Configuration file (
openclaw.json) - Skills configuration and custom skills
Important (back up weekly):
- Full OpenClaw data directory
- Docker volumes if using Docker
Document (but don't need to back up):
- API keys (store separately in a password manager)
- Channel bot tokens
- Environment variables
Self-Hosted Backup Options
Option 1: Automated Export Script
#!/bin/bash
# /home/user/backup-openclaw.sh
BACKUP_DIR="/backups/openclaw"
DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_FILE="$BACKUP_DIR/openclaw_$DATE.zip"
mkdir -p "$BACKUP_DIR"
# Export via OpenClaw CLI
docker compose -f /home/user/openclaw/docker-compose.yml exec -T openclaw openclaw export --output "/tmp/backup_$DATE.zip"
docker compose -f /home/user/openclaw/docker-compose.yml cp "openclaw:/tmp/backup_$DATE.zip" "$BACKUP_FILE"
# Keep only last 14 days of backups
find "$BACKUP_DIR" -name "*.zip" -mtime +14 -delete
echo "Backup completed: $BACKUP_FILE"
Schedule with cron:
crontab -e
# Add: 0 2 * * * /home/user/backup-openclaw.sh >> /var/log/openclaw-backup.log 2>&1
Option 2: Rclone to Cloud Storage
# Install rclone
curl https://rclone.org/install.sh | bash
# Configure destination (Cloudflare R2, S3, Backblaze B2, etc.)
rclone config
# Add to backup script:
rclone copy "$BACKUP_FILE" remote:openclaw-backups/
Option 3: VPS Provider Snapshots
Most VPS providers offer full-disk snapshots:
- Hetzner: Snapshots via console, ~€0.01/GB/month
- DigitalOcean: Droplet backups (20% of droplet cost/month)
- Vultr: Automatic backups at $1/month
Snapshots capture everything but are heavier and slower to restore than export-based backups.
nacre.sh Managed Backups
nacre.sh automatically performs nightly backups to Cloudflare R2 with 14-day retention. No configuration required. You can restore any backup from the dashboard:
- Go to Dashboard > Instance > Backups
- Select the backup date
- Click Restore — the instance restores in approximately 2 minutes
You can also download backups for local archiving.
Recovery Procedures
Restoring from Export (Self-Hosted)
# Stop OpenClaw
docker compose stop openclaw
# Restore from backup
docker compose run --rm openclaw openclaw import --input /path/to/backup.zip
# Start OpenClaw
docker compose start openclaw
Disaster Recovery (Full Server Loss)
- Spin up a new VPS
- Install Docker and OpenClaw (see setup guides)
- Copy your latest backup to the new server
- Run the import procedure above
- Re-enter API keys and bot tokens
Total recovery time from scratch: approximately 30–60 minutes with a recent backup.
Frequently Asked Questions
How often should I back up my agent memory?
Daily at minimum. If you use your agent heavily, consider every 6 hours. The export is typically under 50MB even after months of use.
Can I use the backup to clone my agent to a second instance?
Yes — importing a backup creates an identical agent state. This is useful for testing configuration changes on a development instance before applying to your production agent.
nacre.sh
Run OpenClaw without the server headaches
Dedicated instance, automatic TLS, nightly backups, and 290+ LLM integrations. Live in under 90 seconds from $12/month.
Deploy your agent →