Skip to content

feat(restore): Allow skipping migrate in New Site from Backup (backport #626) - #627

Merged
regdocs merged 1 commit into
masterfrom
mergify/bp/master/pr-626
Oct 11, 2026
Merged

regdocs merged 1 commit into
masterfrom
mergify/bp/master/pr-626

Conversation

@mergify

@mergify mergify Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Problem

New Site from Backup always runs bench migrate after the restore. If migrate fails, the whole job fails. That can happen because of a broken patch in an app, or a schema change that the site's existing data can't take (for example, a Data custom field turned into Float while rows still hold text). A site migration then rolls back, and there's no way to move the site while leaving migrate for later.

Change

  • POST /benches/<bench>/sites/restore accepts an optional skip_migrate (default false).
  • Bench.new_site_from_backup skips site.migrate() when it's set. Everything else runs as before: new-site, restore, config update, uninstalling unavailable apps, admin password, scheduler, nginx.

Requests without the key behave exactly as they do today.

The press side, which sends this from a desk-only Site Migration checkbox, is in a separate frappe/press PR. Deploy this agent change first, because an older agent ignores the key and still migrates.

Tests

Two tests in agent/tests/test_site.py run new_site_from_backup with the bench, site and nginx calls mocked:

  • By default, migrate is called with skip_failing_patches.
  • With skip_migrate=True, migrate isn't called, and the admin password and scheduler steps still run.

🤖 Generated with Claude Code


This is an automatic backport of pull request #626 done by [Mergify](https://mergify.com).

New Site from Backup always ran bench migrate after the restore. A migrate
failure (a broken patch, a schema change that existing data can't take)
then fails the whole job, and a site migration rolls back with it.

Accept an optional skip_migrate in the restore request. When it is set, the
site is restored and set up as before, but migrate doesn't run. It defaults
to false, so existing callers behave the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 2e64688)
@mergify

mergify Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@regdocs
regdocs merged commit f5f1ba3 into master Oct 11, 2026
4 of 5 checks passed
@regdocs
regdocs deleted the mergify/bp/master/pr-626 branch October 11, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant