Skip to content
Back to search

myclaw-backup

SkillWorks with Claude CodeGitHub

"Backup and restore all OpenClaw configuration, agent memory, skills, and workspace data. Part of the MyClaw.ai (https://myclaw.ai) open skills ecosystem — the AI personal assistant platform that gives every user a full server with complete code control. Use when the user wants to create a snapshot of their OpenClaw instance, schedule periodic backups, restore from a backup, migrate to a new server, download a backup file locally, upload a backup file from another machine, or protect against data loss. Includes a built-in HTTP server for browser-based download/upload/restore without needing cloud storage. TRUST BOUNDARY: This skill archives and restores highly sensitive data including bot tokens, API keys, and channel credentials. Only install if you trust the operator. Always use --dry-run before restore. Never start the HTTP server without a --token."

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/leoyeai--openclaw-backup/badge.svg)](/listings/leoyeai--openclaw-backup)

HTML

<a href="/listings/leoyeai--openclaw-backup"><img src="/api/listings/leoyeai--openclaw-backup/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Just tell your OpenClaw agent:

> **"Help me install backup"**

Or manually:

clawhub install myclaw-backup

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 171 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: myclaw-backup
  3. description: "Backup and restore all OpenClaw configuration, agent memory, skills, and workspace data. Part of the MyClaw.ai (https://myclaw.ai) open skills ecosystem — the AI personal assistant platform that gives every user a full server with complete code control. Use when the user wants to create a snapshot of their OpenClaw instance, schedule periodic backups, restore from a backup, migrate to a new server, download a backup file locally, upload a backup file from another machine, or protect against data loss. Includes a built-in HTTP server for browser-based download/upload/restore without needing cloud storage. TRUST BOUNDARY: This skill archives and restores highly sensitive data including bot tokens, API keys, and channel credentials. Only install if you trust the operator. Always use --dry-run before restore. Never start the HTTP server without a --token."
  4. metadata:
  5. openclaw:
  6. requires:
  7. bins: ["node", "rsync", "tar", "python3", "openclaw"]
  8. trust: high
  9. permissions:
  10. - read: ~/.openclaw
  11. - write: ~/.openclaw
  12. - network: listen
  13. ---
  14. # MyClaw Backup
  15. > **Built on [MyClaw.ai](https://myclaw.ai)** — the AI personal assistant platform that gives every user a full server with complete code control, networking, and tool access. This skill is part of the MyClaw.ai open skills ecosystem.
  16. Backs up all critical OpenClaw data to a single `.tar.gz` archive and restores it to any OpenClaw instance. Includes a built-in HTTP server for browser-based backup management.
  17. ## ⚠️ Trust Boundary & Security Model
  18. This skill handles **highly sensitive data**: bot tokens, API keys, channel credentials, session history. Understand the security model before use:
  19. ### What each script does
  20. - **backup.sh** — reads `~/.openclaw/` and writes a `chmod 600` archive to disk. No network access.
  21. - **restore.sh** — overwrites `~/.openclaw/` from an archive. Requires typing `yes` to confirm. Always run `--dry-run` first.
  22. - **serve.sh / server.js** — starts a local HTTP server. Token is **mandatory** (refuses to start without one). Shell-execution endpoints (`/backup`, `/restore`) are **localhost-only** — remote access can only download and upload files, not trigger execution.
  23. - **schedule.sh** — modifies your system crontab to run backup.sh on a schedule. Prints the cron entry before adding. Use `--disable` to remove.
  24. ### Access control summary
  25. | Endpoint | Remote (token required) | Localhost only |
  26. |---|---|---|
  27. | GET /health | ✅ (no token) | — |
  28. | GET /backups | ✅ | — |
  29. | GET /download/:file | ✅ | — |
  30. | POST /upload | ✅ | — |
  31. | POST /backup | ❌ | ✅ |
  32. | POST /restore | ❌ | ✅ |
  33. ### Best practices
  34. - Never start the HTTP server without `--token`
  35. - Never expose the HTTP server to the public internet without TLS
  36. - Always run `restore.sh --dry-run` before applying a restore
  37. - Store backup archives securely — they contain all credentials
  38. ## Dependencies
  39. Requires: `node`, `rsync`, `tar`, `python3`, `openclaw` CLI (all standard on OpenClaw instances).
  40. Check: `which node rsync tar python3 openclaw`
  41. ## Scripts
  42. | Script | Purpose |
  43. |---|---|
  44. | `scripts/backup.sh [output-dir]` | Create backup (default: `/tmp/openclaw-backups/`) |
  45. | `scripts/restore.sh <archive> [--dry-run] [--overwrite-gateway-token]` | Restore — **always dry-run first** |
  46. | `scripts/serve.sh start --token TOKEN [--port 7373]` | Start HTTP server — **token required** |
  47. | `scripts/serve.sh stop\|status` | Stop/check server |
  48. | `scripts/schedule.sh [--interval daily\|weekly\|hourly]` | System cron scheduling |
  49. > **Gateway token behavior (v1.6+):** By default, `restore.sh` preserves the new server's `gateway.auth.token` after restoring `openclaw.json`. This prevents the `"gateway token mismatch"` error in Control UI / Dashboard after migration. Use `--overwrite-gateway-token` only for full disaster recovery on the same server.
  50. ## What Gets Backed Up
  51. See `references/what-gets-saved.md` for full details.
  52. **Includes:** workspace (MEMORY.md, skills, agent files), openclaw.json (bot tokens + API keys), credentials, channel pairing state, agent config + session history, devices, identity, cron jobs, guardian scripts.
  53. **Excludes:** logs, binary media, node_modules, canvas system files.
  54. ## Common Workflows
  55. ### Create backup
  56. ```bash
  57. bash scripts/backup.sh /tmp/openclaw-backups
  58. # → /tmp/openclaw-backups/openclaw-backup_TIMESTAMP.tar.gz (chmod 600)
  59. ```
  60. ### Restore — always dry-run first
  61. ```bash
  62. # Step 1: preview what will change
  63. bash scripts/restore.sh openclaw-backup_TIMESTAMP.tar.gz --dry-run
  64. # Step 2: review the output, then apply
  65. bash scripts/restore.sh openclaw-backup_TIMESTAMP.tar.gz
  66. ```
  67. The restore script saves a pre-restore snapshot before overwriting anything.
  68. ### HTTP server — token is mandatory
  69. ```bash
  70. # Token is required — server refuses to start without one
  71. bash scripts/serve.sh start --token $(openssl rand -hex 16) --port 7373
  72. # → http://localhost:7373/?token=<generated-token>
  73. ```
  74. **Never share the URL on a public network without a reverse proxy + TLS.**
  75. The Web UI provides: create backup, download `.tar.gz`, upload, dry-run preview, restore.
  76. **HTTP API (all require token except /health):**
  77. - `GET /health` — Health check (unauthenticated, read-only)
  78. - `GET /backups` — List backups
  79. - `POST /backup` — Create backup
  80. - `GET /download/:filename` — Download archive
  81. - `POST /upload` — Upload archive (multipart, field: `backup`)
  82. - `POST /restore/:filename` — Restore; add `?dry_run=1` to preview
  83. ### Migrate to a new instance
  84. **Old machine:**
  85. ```bash
  86. bash scripts/serve.sh start --token MYTOKEN --port 7373
  87. ```
  88. **New machine (after installing OpenClaw):**
  89. ```bash
  90. # Download
  91. curl -O "http://OLD_IP:7373/download/openclaw-backup_TIMESTAMP.tar.gz?token=MYTOKEN"
  92. # Always dry-run first
  93. bash scripts/restore.sh openclaw-backup_TIMESTAMP.tar.gz --dry-run
  94. # Apply
  95. bash scripts/restore.sh openclaw-backup_TIMESTAMP.tar.gz
  96. # All channels reconnect automatically — no re-pairing needed
  97. ```
  98. ### Schedule daily auto-backup (OpenClaw cron)
  99. ```json
  100. {
  101. "name": "daily-openclaw-backup",
  102. "schedule": { "kind": "cron", "expr": "0 3 * * *", "tz": "UTC" },
  103. "payload": {
  104. "kind": "agentTurn",
  105. "message": "Run a backup using the myclaw-backup skill. Output dir: /tmp/openclaw-backups",
  106. "timeoutSeconds": 120
  107. },
  108. "sessionTarget": "isolated"
  109. }
  110. ```
  111. ## Post-Restore: Automatic Recovery Report
  112. After `restore.sh` completes, it writes `workspace/.restore-complete.json`. On the next heartbeat/startup, the Agent should:
  113. 1. Check if `workspace/.restore-complete.json` exists
  114. 2. If yes: read it, send a restore report to the user, then **delete the file** (one-shot — never report twice)
  115. 3. **Send the report in the user's primary language** (read from `workspace/USER.md`)
  116. ### Report format (adapt language from USER.md)
  117. ```
  118. ✅ [Restore complete — in user's language]
  119. 📦 Backup: {backup_name}
  120. 🤖 Agent: {agent_name}
  121. 🕐 Restored at: {restored_at}
  122. 💾 Contents restored: workspace, config, credentials, history, cron...
  123. [Channel reconnect instructions in user's language]
  124. ```
  125. ## Future: MyClaw Cloud Backup
  126. The HTTP API is designed to be compatible with a future MyClaw cloud backup service. When available, replace the local server URL with the MyClaw API endpoint — the upload/download/restore flow stays identical.
README.md · README · 88 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. [English](README.md) | [中文](README.zh-CN.md) | [Français](README.fr.md) | [Deutsch](README.de.md) | [Русский](README.ru.md) | [日本語](README.ja.md) | [Italiano](README.it.md) | [Español](README.es.md)
  2. [![Powered by MyClaw.ai](https://img.shields.io/badge/Powered%20by-MyClaw.ai-6366f1?style=flat-square)](https://myclaw.ai)
  3. [![ClaWHub](https://img.shields.io/badge/ClaWHub-myclaw--backup-orange?style=flat-square)](https://clawhub.com/skills/myclaw-backup)
  4. [![License: MIT](https://img.shields.io/badge/License-MIT-green?style=flat-square)](LICENSE)
  5. ---
  6. ## Built on MyClaw.ai
  7. **[MyClaw.ai](https://myclaw.ai)** is an AI personal assistant platform that gives every user a full server with complete code control, networking, and tool access. Your AI agent isn't just a chatbot — it can write code, manage files, run scripts, and now: back itself up and restore to any new instance.
  8. This skill is part of the [MyClaw.ai](https://myclaw.ai) open skills ecosystem. Install it on any OpenClaw instance in seconds.
  9. ---
  10. # 🦞 OpenClaw Backup
  11. **One-click backup & restore for OpenClaw instances.**
  12. Backs up everything — workspace, memory, skills, credentials, bot tokens, API keys, agent session history — into a single archive. Restore to any new OpenClaw instance with zero re-pairing.
  13. ## ⚡ Install
  14. Just tell your OpenClaw agent:
  15. > **"Help me install backup"**
  16. Or manually:
  17. ```bash
  18. clawhub install myclaw-backup
  19. ```
  20. ## What Gets Backed Up
  21. | Component | Details |
  22. |---|---|
  23. | 🧠 Workspace | MEMORY.md, skills, agent files, SOUL.md, USER.md |
  24. | ⚙️ Config | openclaw.json (bot tokens, API keys, model config) |
  25. | 🔑 Credentials | Channel pairing state — no re-pairing after restore |
  26. | 📜 Sessions | Full agent conversation history |
  27. | ⏰ Cron jobs | All scheduled tasks |
  28. | 🛡️ Scripts | Guardian, watchdog, start-gateway |
  29. ## Usage
  30. ### Create a backup
  31. ```bash
  32. bash scripts/backup.sh /tmp/openclaw-backups
  33. ```
  34. ### Restore (always dry-run first)
  35. ```bash
  36. bash scripts/restore.sh openclaw-backup_TIMESTAMP.tar.gz --dry-run
  37. bash scripts/restore.sh openclaw-backup_TIMESTAMP.tar.gz
  38. ```
  39. ### Browser UI (download / upload / restore)
  40. ```bash
  41. bash scripts/serve.sh start --token $(openssl rand -hex 16) --port 7373
  42. # Open: http://localhost:7373/?token=YOUR_TOKEN
  43. ```
  44. ### Migrate to a new server
  45. 1. Start server on old machine → download backup via browser
  46. 2. On new machine: install OpenClaw → install this skill → upload backup → restore
  47. 3. All channels reconnect automatically — no re-pairing needed
  48. ## ⚠️ Security
  49. This skill handles **highly sensitive data** (bot tokens, API keys, credentials).
  50. - Always set `--token` when starting the HTTP server (required, server refuses to start without it)
  51. - Backup archives are `chmod 600` automatically
  52. - Always run `--dry-run` before applying a restore
  53. - Never expose the backup server to the public internet without TLS
  54. ## ClaWHub
  55. Published at: [clawhub.com/skills/myclaw-backup](https://clawhub.com/skills/myclaw-backup)
  56. ---
  57. <p align="center">
  58. <a href="https://myclaw.ai">
  59. <img src="https://img.shields.io/badge/Powered%20by-MyClaw.ai-6366f1?style=for-the-badge" alt="Powered by MyClaw.ai">
  60. </a>
  61. </p>

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.