You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 54a2f09
Browse filesBrowse the repository at this point in the historyBrowse files
feat(update): clean up retained migration recovery files
Add explicit, profile-aware recovery cleanup with read-only preview, offline consent, durable disposal receipts, and conservative protection of unique history. Preserve one untouched legacy transcript through bounded import repair and retain recovery mappings until their payloads are retired.
Document rollback loss, portable-backup exclusions, and migration resource requirements.
Refs #133805
Copy file name to clipboardExpand all lines: docs/install/updating.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,10 @@ For Docker, Podman, and Kubernetes image replacements, see
13
13
gateway runs startup-safe upgrade work before readiness and exits if mounted
14
14
state needs manual repair.
15
15
16
+
Before a significant update, [create a verified backup](#before-updating-create-a-verified-backup).
17
+
Automatic config copies and migration recovery originals are not a full-state
18
+
backup.
19
+
16
20
## Recommended: `openclaw update`
17
21
18
22
Detects your install type (npm, pnpm, Bun, or git), fetches the latest version, runs `openclaw doctor`, and restarts the gateway.
@@ -77,6 +81,29 @@ default/latest release.
77
81
78
82
See [Release channels](/install/development-channels) for channel semantics.
79
83
84
+
## Retire update recovery data
85
+
86
+
Once you have verified the update and your conversations, preview retained
87
+
migration originals:
88
+
89
+
```bash
90
+
openclaw update cleanup --dry-run
91
+
```
92
+
93
+
Use the same profile and state/config overrides as the update, and check the
94
+
state directory printed in the report. The metadata-only preview can run while
95
+
the Gateway is active. To apply, stop that Gateway yourself, wait for other
96
+
SQLite maintenance to finish, then run `openclaw update cleanup`. Cleanup never
97
+
stops or restarts the Gateway. Confirmation defaults to **No**; automation must
98
+
explicitly pass `--yes`, including when using `--json`.
99
+
100
+
Cleanup permanently gives up rollback to eligible originals, including repaired
101
+
branches and old provider metadata. Current SQLite history, operator backups,
102
+
and protected or unknown artifacts remain. It is not a substitute for a
103
+
[pre-update backup](#before-updating-create-a-verified-backup). See
104
+
[Update cleanup](/cli/update#update-cleanup) for eligibility, JSON output, and
105
+
resuming interrupted deletion.
106
+
80
107
## Switch between npm and git installs
81
108
82
109
Installer-driven switches verify the replacement before the working owner is retired. Source wrappers are published atomically; same-path npm shim transitions use an identity-checked backup that is restored on failure, so a failed candidate leaves the previous command runnable. The `openclaw update` command prints its final success result only after post-core convergence and requested restart health checks succeed.
@@ -473,7 +500,16 @@ omitted files.
473
500
474
501
For a byte-for-byte recovery point that includes volatile artifacts omitted by
475
502
the portable archive, stop the Gateway and use a filesystem, volume, or VM
476
-
snapshot provided by your platform.
503
+
snapshot provided by your platform. This matters for older file-backed installs:
504
+
the portable archive omits matching JSONL transcripts and logs even when they
505
+
are no longer being written.
506
+
507
+
When migrating large legacy histories, leave room for the original files, a
508
+
temporary SQLite spool, and the destination database/WAL simultaneously. SQLite
509
+
can be larger than the original JSONL; streaming import does not imply a fixed
510
+
RAM requirement or migration time. Check free space on both the system temporary
511
+
volume and the state volume. See [Session SQLite migration](/cli/doctor#session-sqlite-migration)
Copy file name to clipboardExpand all lines: docs/reference/session-management-compaction.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,14 @@ Normal Gateway writes flow through the session accessor, which serializes per-ag
79
79
80
80
OpenClaw no longer creates automatic `sessions.json.bak.*` rotation backups during Gateway writes. The current schema rejects the legacy `session.maintenance.rotateBytes` key, and `openclaw doctor --fix` removes it from older configs.
81
81
82
+
Migration recovery originals and exact pre-Doctor recovery files are separate
83
+
from ordinary session retention: they are excluded from the live session disk
84
+
budget and have no automatic expiration. After verifying the upgrade, use
85
+
`openclaw update cleanup --dry-run` to inspect them online. Explicit offline
86
+
[update cleanup](/cli/update#update-cleanup) can retire verified originals
87
+
without removing current SQLite history; exclusion from the disk budget is not
88
+
deletion authority.
89
+
82
90
Transcript mutations pass through the session accessor and SQLite writer queue.
83
91
Each mutation verifies the active run's durable writer claim inside its commit
84
92
transaction, so a superseded run cannot write to the transcript.
@@ -103,6 +111,12 @@ Restore uses migration manifests, moves only recorded archived artifacts whose
103
111
original paths are missing, reports conflicts rather than overwriting existing
104
112
files, and leaves the SQLite database in place for forward recovery.
105
113
114
+
Originals retired by `openclaw update cleanup` can no longer be restored from
115
+
the migration archive. Restore reports intentional disposal or pending cleanup
116
+
instead of treating either as an unexpectedly missing file. An independent
117
+
backup containing the legacy artifacts is required if you need them after
118
+
disposal; see [Pre-update backups](/install/updating#before-updating-create-a-verified-backup).
119
+
106
120
Restore does not export changes made only in SQLite after migration. Sessions
107
121
created after the SQLite flip are SQLite-only and will not appear to an older
108
122
file-backed runtime. If you re-upgrade after a downgrade, run the Doctor
0 commit comments