Skip to content

docs(backup): document manual restore steps - #78010

Closed
Beandon13 wants to merge 1 commit into
openclaw:mainfrom
Beandon13:fix/openclaw-77849-backup-restore-docs
Closed

Beandon13 wants to merge 1 commit into
openclaw:mainfrom
Beandon13:fix/openclaw-77849-backup-restore-docs

Conversation

@Beandon13

Copy link
Copy Markdown
Contributor

Summary

  • Adds a "Restore from a backup archive" section to docs/cli/backup.md that covers inspecting, same-machine restore, and new-machine restore using tar + the embedded manifest.json.
  • Explicitly documents that openclaw backup does not ship a paired restore subcommand and explains the manual flow.
  • Extends frontmatter read_when and Related links to cover restore + the migrating guide.

Closes #77849

Testing

  • pnpm docs:check-mdx (Docs MDX check passed, 613 files)
  • pnpm docs:check-links (checked_internal_links=4217, broken_links=0)
  • pnpm vitest run src/scripts/docs-link-audit.test.ts (6/6)

Real behavior proof

  • Behavior or issue addressed: Issue [Bug]: No restore step in openclaw backup docs #77849 reports there is no restore step in the openclaw backup docs at https://docs.openclaw.ai/cli/backup. This PR adds the missing restore procedure (same-machine, new-machine, archive layout, manifest inspection) directly to that page, and is honest that there is no openclaw backup restore subcommand today.
  • Real environment tested: Local OpenClaw checkout from this PR branch on macOS (Darwin 25.5.0) at HEAD 1ce2407. Docs build/lint commands run from the branch worktree.
  • Exact steps or command run after this patch:
    pnpm docs:check-mdx
    pnpm docs:check-links
    pnpm vitest run src/scripts/docs-link-audit.test.ts
    
  • Evidence after fix:
    > [email protected] docs:check-mdx /private/tmp/oc-77849-fix
    > node scripts/check-docs-mdx.mjs docs README.md
    Docs MDX check passed (613 files, 5015ms).
    
    > [email protected] docs:check-links /private/tmp/oc-77849-fix
    > node scripts/docs-link-audit.mjs
    checked_internal_links=4217
    broken_links=0
    
     Test Files  1 passed (1)
          Tests  6 passed (6)
    
  • Observed result after fix: Backup docs now include a clear, accurate, manifest-driven restore procedure for both same-machine and new-machine cases; MDX, internal-link audit, and the docs-link-audit unit test all pass.
  • What was not tested: The Mintlify hosted docs site preview was not rendered from this clone; the site preview happens in CI on merge.

Adds a "Restore from a backup archive" section to docs/cli/backup.md
covering:

- How to inspect a backup with verify + reading the embedded manifest.json
- Archive payload layout (<archive-root>/payload/posix/<abs-path>/...)
- Same-machine restore via tar -xzf back to original paths
- New-machine / different-path restore via staging directory + cp -a
- Pointer to /install/migrating for guided cross-machine flows

OpenClaw does not currently ship `openclaw backup restore`, so the docs
explicitly call that out and explain the manual `tar` extract guided by
the manifest. Frontmatter `read_when` is extended to cover restore.

Closes openclaw#77849
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XS labels May 5, 2026
@clawsweeper

clawsweeper Bot commented May 5, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as superseded: the newer restore-docs PR is open, mergeable, proof-positive, and covers the same missing backup restore docs gap with safer trusted-archive, private-staging, cleanup, and manifest-path guidance.

Root-cause cluster
Relationship: superseded
Canonical: #86971
Summary: This PR and the newer restore-docs PR address the same missing manual restore docs gap; the newer PR is the safer canonical landing candidate, while native restore-command work remains broader adjacent scope.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Close this branch, continue review on #86971 as the canonical manual restore guide, and keep native restore-command design in #13616.

So I’m closing this here and keeping the remaining discussion on #86971 and #13616.

Review details

Best possible solution:

Close this branch, continue review on #86971 as the canonical manual restore guide, and keep native restore-command design in #13616.

Do we have a high-confidence way to reproduce the issue?

Yes for the underlying docs gap: current main backup docs and CLI registration expose create/verify only. This branch and the newer canonical PR both target that same missing restore guidance.

Is this the best way to solve the issue?

No. Manual restore documentation is the right narrow current-surface fix, but this branch is not the best landing path because the newer PR handles trust, private staging, cleanup, and manifest paths more safely.

Security review:

Security review needs attention: The docs-only diff would publish unsafe restore staging guidance for archives that can contain credentials, sessions, auth profiles, and workspace data.

  • [medium] Predictable staging for sensitive archives — docs/cli/backup.md:155
    The restore example extracts backup contents into /tmp/openclaw-restore and does not remove it; backup archives may include credentials, auth profiles, sessions, and workspace data.
    Confidence: 0.92

AGENTS.md: found and applied where relevant.

What I checked:

  • Repository policy read and applied: Root AGENTS.md and docs/AGENTS.md were read fully; the docs rules on source-backed CLI content, generic examples, and sensitive restore guidance affected the review. (AGENTS.md:1, 010b61746379)
  • Current main still has the underlying docs gap: Current main docs list backup create/verify examples and have no restore section, so the linked missing-docs problem remains until one canonical docs PR lands. Public docs: docs/cli/backup.md. (docs/cli/backup.md:13, 010b61746379)
  • Current CLI has no restore subcommand: registerBackupCommand registers only backup create and backup verify, supporting manual restore docs as the narrow current-surface fix rather than documenting an existing restore command. (src/cli/program/register.backup.ts:22, 010b61746379)
  • This branch has unsafe staging guidance: The PR diff extracts sensitive backup contents into a predictable /tmp/openclaw-restore directory without private mktemp staging or cleanup. Public docs: docs/cli/backup.md. (docs/cli/backup.md:155, 1ce240738fb0)
  • This branch derives archive root from filename: The PR says the archive root matches the archive basename, but current backup creation records archiveRoot and asset archivePath in the manifest while output can be custom. Public docs: docs/cli/backup.md. (docs/cli/backup.md:122, 1ce240738fb0)
  • Canonical replacement PR is viable: Live GitHub data shows docs(backup): describe manual restore flow #86971 is open, draft=false, mergeable=true, mergeable_state=clean, and its diff adds trusted-archive, private mktemp staging, cleanup, and manifest-driven restore guidance for the same docs issue. Public docs: docs/cli/backup.md. (docs/cli/backup.md:84, b5d5cb524c88)

Likely related people:

  • shichangs: Authored the merged local backup CLI feature that added the backup docs and create/verify command surface this PR extends. (role: feature introducer; confidence: high; commits: 0ecfd37b4465; files: docs/cli/backup.md, src/cli/program/register.backup.ts, src/commands/backup.ts)
  • Gustavo Madeira Santana: Authored backup verifier path-validation hardening and backup path helper extraction relevant to archive-root and restore-safety guidance. (role: backup safety contributor; confidence: high; commits: 09acbe65289d, 3ba64916599b; files: src/commands/backup-verify.ts, src/commands/backup-shared.ts, src/infra/backup-create.ts)
  • Abner Shang: Authored recent volatile-file skipping and tar retry backup work that affects what backup archives can contain and what restore docs must warn about. (role: recent backup behavior contributor; confidence: medium; commits: 9eaca28ef715; files: docs/cli/backup.md, src/infra/backup-create.ts, src/infra/backup-volatile-filter.ts)
  • Peter Steinberger: Recent backup path-plan test extraction touched shared backup planning helpers relevant to archive asset mapping and restore expectations. (role: recent adjacent contributor; confidence: medium; commits: 86679ba84e7c; files: src/commands/backup-shared.ts, src/commands/backup.test.ts)

Codex review notes: model internal, reasoning high; reviewed against 010b61746379.

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 14, 2026
@openclaw-barnacle openclaw-barnacle Bot added the proof: supplied External PR includes structured after-fix real behavior proof. label May 14, 2026
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 15, 2026
@RomneyDa

Copy link
Copy Markdown
Member

Heads up: this PR needs to be updated against current main before the new required Dependency Guard check can pass.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jun 14, 2026
@steipete steipete closed this Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: No restore step in openclaw backup docs

3 participants