openclaw - ✅(Solved) Fix [Bug]: openclaw migrate --no-backup is parsed but ignored [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#73459Fetched 2026-04-29 06:19:41
View on GitHub
Comments
2
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
commented ×2closed ×1cross-referenced ×1

openclaw migrate and openclaw migrate apply register --no-backup, but the CLI action reads opts.backup === false instead of opts.noBackup, so the apply path still creates a pre-migration backup.

Root Cause

openclaw migrate and openclaw migrate apply register --no-backup, but the CLI action reads opts.backup === false instead of opts.noBackup, so the apply path still creates a pre-migration backup.

Fix Action

Fixed

PR fix notes

PR #73463: fix(migrate): honor no-backup CLI option

Description (problem / solution / changelog)

Summary

  • pass Commander’s parsed --no-backup value through opts.noBackup
  • keeps both openclaw migrate and openclaw migrate apply aligned with the apply-layer noBackup option

Closes #73459

Test Plan

  • pnpm exec oxfmt --check --threads=1 src/cli/program/register.migrate.ts
  • pnpm test src/commands/migrate.test.ts

Changed files

  • src/cli/program/register.migrate.ts (modified, +2/-2)

Code Example

src/cli/program/register.migrate.ts:32 registers --no-backup
src/cli/program/register.migrate.ts:62 passes noBackup: opts.backup === false
src/cli/program/register.migrate.ts:100 registers --no-backup for apply
src/cli/program/register.migrate.ts:111 passes noBackup: opts.backup === false
src/commands/migrate/apply.ts:64-66 skips backup only when params.opts.noBackup is true
RAW_BUFFERClick to expand / collapse

Summary

openclaw migrate and openclaw migrate apply register --no-backup, but the CLI action reads opts.backup === false instead of opts.noBackup, so the apply path still creates a pre-migration backup.

Steps to reproduce

  1. Run openclaw migrate apply hermes --yes --force --no-backup.
  2. Observe that the CLI still enters the pre-migration backup path.

Expected behavior

When --no-backup is supplied with --force, migration apply should skip createPreMigrationBackup.

Actual behavior

The CLI passes noBackup: opts.backup === false, but the registered Commander option is --no-backup, so the parsed option is exposed as opts.noBackup. params.opts.noBackup remains false and the backup path runs.

OpenClaw version

Current main after v2026.4.26; observed at commit 0f24a8d8e1.

Operating system

Static repo inspection only.

Install method

Source checkout.

Model

NOT_ENOUGH_INFO

Provider / routing chain

NOT_ENOUGH_INFO

Logs, screenshots, and evidence

src/cli/program/register.migrate.ts:32 registers --no-backup
src/cli/program/register.migrate.ts:62 passes noBackup: opts.backup === false
src/cli/program/register.migrate.ts:100 registers --no-backup for apply
src/cli/program/register.migrate.ts:111 passes noBackup: opts.backup === false
src/commands/migrate/apply.ts:64-66 skips backup only when params.opts.noBackup is true

Impact and severity

Affected: users running non-interactive migrations with explicit backup control.

Severity: Medium.

Frequency: Always when relying on --no-backup.

Consequence: scripted migrations may unexpectedly create backups or fail in environments where backup output is unavailable or intentionally disabled.

Additional information

Likely fix is to pass noBackup: Boolean(opts.noBackup) or equivalent in both migrate action handlers.

extent analysis

TL;DR

The most likely fix is to update the noBackup option to correctly reference opts.noBackup instead of opts.backup === false in the migrate action handlers.

Guidance

  • Review the register.migrate.ts file and update the noBackup option to use Boolean(opts.noBackup) to ensure correct parsing of the --no-backup flag.
  • Verify that the apply command correctly skips the pre-migration backup when --no-backup is supplied by checking the value of params.opts.noBackup.
  • Test the updated code with the provided reproduction steps to confirm the fix.
  • Consider adding additional logging or debugging statements to ensure the noBackup option is being parsed correctly.

Example

// In register.migrate.ts, update the noBackup option to:
noBackup: Boolean(opts.noBackup)

Notes

The provided logs and code snippets suggest that the issue is due to incorrect parsing of the --no-backup flag. The fix should be applied to both migrate action handlers to ensure consistent behavior.

Recommendation

Apply the workaround by updating the noBackup option to correctly reference opts.noBackup, as this will fix the issue and prevent unexpected backups from being created.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

When --no-backup is supplied with --force, migration apply should skip createPreMigrationBackup.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: openclaw migrate --no-backup is parsed but ignored [1 pull requests, 2 comments, 2 participants]