Install
openclaw skills install backup-openclaw-configBackup and restore OpenClaw configuration files. Use when backing up OpenClaw settings before upgrades, transferring configuration to another machine, restoring from a previous backup, or preparing for system maintenance.
openclaw skills install backup-openclaw-configThis skill provides automated backup and restore functionality for all OpenClaw configuration files. It creates timestamped archives containing your complete OpenClaw setup, including main configuration, workspace, skills, and user data.
What gets backed up:
~/.openclaw/ - Main configuration~/.config/openclaw/ - System-level configuration~/.local/share/openclaw/ - Local data~/.openclaw/workspace/ - Workspace, skills, and memoryRun the backup script:
~/.openclaw/workspace/skills/backup-openclaw-config/scripts/backup_openclaw.sh [output-directory]
Example:
# Backup to default location ($HOME/backups/openclaw)
~/.openclaw/workspace/skills/backup-openclaw-config/scripts/backup_openclaw.sh
# Backup to custom location
~/.openclaw/workspace/skills/backup-openclaw-config/scripts/backup_openclaw.sh ~/my-backups
Output:
openclaw_backup_YYYYMMDD_HHMMSS.tar.gz archiveopenclaw_backup_YYYYMMDD_HHMMSS.info metadata fileRun the restore script:
~/.openclaw/workspace/skills/backup-openclaw-config/scripts/restore_openclaw.sh <backup-archive.tar.gz>
Example:
~/.openclaw/workspace/skills/backup-openclaw-config/scripts/restore_openclaw.sh \
~/backups/openclaw/openclaw_backup_20260306_095000.tar.gz
Process:
After restore:
# Restart OpenClaw Gateway to apply changes
systemctl --user restart openclaw-gateway
Check prerequisites
Create backup structure
Copy configuration files
~/.openclaw/ (main config)~/.config/openclaw/ (system config)~/.local/share/openclaw/ (local data)Create archive
.tar.gz archive.info file with metadata (timestamp, hostname, user, size)Report results
Validate backup
Safety confirmation
Backup existing files
.bakExtract and restore
~/.openclaw/, ~/.config/openclaw/, ~/.local/share/openclaw/Complete and notify
# Backup before updating OpenClaw
~/.openclaw/workspace/skills/backup-openclaw-config/scripts/backup_openclaw.sh
# Then upgrade
openclaw update
# On old machine: create backup
~/.openclaw/workspace/skills/backup-openclaw-config/scripts/backup_openclaw.sh
# Transfer backup archive to new machine (scp, rsync, etc.)
scp ~/backups/openclaw/openclaw_backup_*.tar.gz user@new-machine:~/
# On new machine: restore
~/.openclaw/workspace/skills/backup-openclaw-config/scripts/restore_openclaw.sh \
~/backups/openclaw/openclaw_backup_*.tar.gz
# Restore from backup after system failure
~/.openclaw/workspace/skills/backup-openclaw-config/scripts/restore_openclaw.sh \
/path/to/backup/openclaw_backup_20260306.tar.gz
# Restart services
systemctl --user restart openclaw-gateway
For detailed information about what gets backed up, see config-locations.md.
Summary:
~/.openclaw/ - Gateway config, extensions, tokens~/.openclaw/workspace/ - Skills, memory, user data~/.config/openclaw/ - systemd services, preferences~/.local/share/openclaw/ - Cache, runtime dataCreate backups regularly, especially after:
After creating a backup, verify it:
# Test extraction to temporary location
tar -tzf backup.tar.gz | head
# Verify critical files are present
tar -tzf backup.tar.gz | grep -E "(config.json|AGENTS.md|MEMORY.md)"
If you see permission errors:
# Ensure scripts are executable
chmod +x ~/.openclaw/workspace/skills/backup-openclaw-config/scripts/*.sh
# Ensure backup directory is writable
mkdir -p ~/backups/openclaw
chmod 755 ~/backups/openclaw
If Gateway fails to start after restore:
# Check Gateway logs
journalctl --user -u openclaw-gateway -n 50
# Restore from .bak if needed
mv ~/.openclaw ~/.openclaw.bad
mv ~/.openclaw.bak ~/.openclaw
systemctl --user restart openclaw-gateway
The backup script gracefully handles missing directories: