Preflight: find what breaks before you upgrade a site from v15 to v16

Preflight scans a v15 site and lists what will break on v16, before you upgrade. It changes nothing on the site. It’s on PyPI as prefly, MIT licensed.

From the bench directory, into the bench’s own env:

./env/bin/pip install prefly
./env/bin/preflight --site mysite.local --target v16

It checks the custom apps on the bench (Python, hooks, JS, Vue), Server and Client Scripts saved on the site, Custom Fields and Property Setters on doctypes v16 removed, and whether the bench can install v16 at all. Each finding names the file and line, what changed, and whether to fix it before upgrading or with the upgrade. Apps on frappe’s own version branch, such as erpnext, are listed apart and not counted, since the upgrade replaces their code.

Some options:

  • --open: opens the report as an HTML page in the browser
  • --format html > report.html: the same page as a file; json and sarif too
  • --app my_app: scans one app; --app erpnext counts an upstream app’s findings
  • --online: also checks each app’s v16 branch, wheels for Python 3.14, and node
  • --baseline old.json: leaves out findings already in an earlier report
  • --path . --target v16: scans an app’s checkout with no site or bench, for CI

A # preflight: ignore[rule-id] comment on a line leaves that finding out.

A clean report means no known problems were found, not that the upgrade is safe. The docs in the repo cover the first scan, CI, reading a report, every rule and the upgrade checklist. Issues for anything it missed or flagged wrongly are welcome; rules are YAML files.

1 Like