This 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
~/.openclaw/ (main config)~/.config/openclaw/ (system config)~/.local/share/openclaw/ (local data).tar.gz archive.info file with metadata (timestamp, hostname, user, size).bak~/.openclaw/, ~/.config/openclaw/, ~/.local/share/openclaw/# 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:
共 1 个版本