Install
openclaw skills install @servicosmkt/backup-to-r2Set up and run complete, encrypted, off-site backups of an OpenClaw install to Cloudflare R2 via restic, plus portable restore. Use when the user wants to back up, protect, restore, or migrate their OpenClaw config, agents, and credentials.
openclaw skills install @servicosmkt/backup-to-r2This skill helps the user create complete, encrypted, off-site backups of their OpenClaw installation and restore them on any machine. It backs up everything OpenClaw's built-in .bak misses: credentials, agents, workspace, and cron — not just openclaw.json.
openclaw doctor --fix) and wants protection going forward.openclaw backup create --verify produces a verified .tar.gz containing config, credentials, agents, workspace, and cron. restic then encrypts and deduplicates it locally and uploads to Cloudflare R2. Retention keeps 7 daily + 4 weekly + 6 monthly snapshots.
./restic/restic.exe)..env.example → .env and fill RESTIC_REPOSITORY, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY..restic-pass with a strong password. Critical: this is the only key to the encrypted backups — store it safely and separately. Without it, restore is impossible.restic init.Never commit
.envor.restic-pass. They are git-ignored. Never print their contents.
.\backup.ps1
This runs openclaw backup create --verify, uploads via restic to R2, prunes old snapshots, and removes the local tar. Logs go to logs/.
.\test-restore.ps1
Downloads the latest snapshot, extracts it, and validates with openclaw backup verify. Does not touch the live .openclaw.
Copy the portable/ folder (with restic/restic.exe, .env, .restic-pass) to the target machine and run:
.\portable\restore-portable.ps1
It stops the gateway, pulls the latest backup from R2, and installs to %USERPROFILE%\.openclaw.
⚠️ This OVERWRITES the live
.openclaw. Anything created after the last backup is lost. The script requires the user to typeRESTAURARto confirm and moves the current folder to.openclaw.backup-<date>first (this local backup can fail if files are locked, in which case it overwrites in place). Always have the user runtest-restore.ps1first to inspect the backup non-destructively, and only run the real restore when they accept replacing the active install.$env:OPENCLAW_RESTORE_YES = 1skips the prompt for automation — never set it on the user's behalf without explicit consent.
Register a Task Scheduler job that runs backup.ps1 daily with -StartWhenAvailable so it catches up if the PC was off. See the README for the exact Register-ScheduledTask command.
.restic-pass somewhere safe before relying on backups. It is the only key — losing it makes every backup unrecoverable..env/.restic-pass themselves.portable/ folder (it bundles both the R2 credentials and the decryption key)..openclaw as a timestamped backup (so it is reversible) — but that safety copy can fail if files are locked. Recommend test-restore.ps1 before any real restore.