$npx -y skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-ops-upgradesUse when upgrading Frappe/ERPNext between major versions (v14 to v15, v15 to v16), troubleshooting failed migrations, or planning rollback. Prevents broken upgrades from skipped patches, incompatible customizations, and missing pre-upgrade checks. Covers version upgrade paths, be
| 1 | # Version Upgrades |
| 2 | |
| 3 | Complete guide for upgrading Frappe/ERPNext between major versions, handling failed migrations, and rolling back safely. |
| 4 | |
| 5 | **Versions**: v14 → v15 → v16 |
| 6 | |
| 7 | --- |
| 8 | |
| 9 | ## Quick Reference: Upgrade Commands |
| 10 | |
| 11 | | Task | Command | |
| 12 | |------|---------| |
| 13 | | Full update | `bench update` | |
| 14 | | Update specific app | `bench update --pull --app erpnext` | |
| 15 | | Switch branch | `bench switch-to-branch version-15 frappe erpnext` | |
| 16 | | Run migrations only | `bench --site mysite migrate` | |
| 17 | | Check migration readiness | `bench --site mysite ready-for-migration` | |
| 18 | | Backup before upgrade | `bench --site mysite backup` | |
| 19 | | Restore from backup | `bench --site mysite restore /path/to/backup.sql.gz` | |
| 20 | | Re-run failed patch | Add `#YYYY-MM-DD` suffix in patches.txt | |
| 21 | |
| 22 | --- |
| 23 | |
| 24 | ## Decision Tree: Upgrade Strategy |
| 25 | |
| 26 | ``` |
| 27 | Need to upgrade? |
| 28 | ├── Single minor version bump (e.g., v15.10 → v15.20)? |
| 29 | │ └── YES → Run `bench update` directly |
| 30 | ├── Major version jump (e.g., v14 → v15)? |
| 31 | │ ├── Have custom apps? |
| 32 | │ │ ├── YES → Test on staging FIRST, check breaking changes |
| 33 | │ │ └── NO → Follow standard upgrade path |
| 34 | │ └── Multiple major versions (v14 → v16)? |
| 35 | │ └── ALWAYS upgrade one version at a time: v14 → v15 → v16 |
| 36 | └── Production environment? |
| 37 | ├── YES → ALWAYS test on staging clone first |
| 38 | └── NO → Proceed with standard upgrade |
| 39 | ``` |
| 40 | |
| 41 | --- |
| 42 | |
| 43 | ## Pre-Upgrade Checklist |
| 44 | |
| 45 | **ALWAYS** complete these steps before ANY major version upgrade: |
| 46 | |
| 47 | 1. **Full backup** — `bench --site mysite backup --with-files` |
| 48 | 2. **Test on staging** — Clone production to a staging bench and test there first |
| 49 | 3. **Check breaking changes** — Review the breaking changes section below |
| 50 | 4. **Audit custom apps** — Run custom apps against new version's API changes |
| 51 | 5. **Check Python/Node versions** — v15 requires Node 18+; v16 requires Node 24+, Python 3.14+ |
| 52 | 6. **Disable scheduler** — `bench --site mysite scheduler disable` |
| 53 | 7. **Check pending jobs** — `bench --site mysite ready-for-migration` |
| 54 | 8. **Read release notes** — Check GitHub release notes for each version |
| 55 | |
| 56 | --- |
| 57 | |
| 58 | ## Standard Upgrade Process |
| 59 | |
| 60 | ### Step-by-Step |
| 61 | |
| 62 | ```bash |
| 63 | # 1. Backup all sites |
| 64 | bench backup-all-sites |
| 65 | |
| 66 | # 2. Switch to target version branch |
| 67 | bench switch-to-branch version-15 frappe erpnext |
| 68 | |
| 69 | # 3. Update (pulls code, installs deps, builds, migrates) |
| 70 | bench update |
| 71 | |
| 72 | # 4. Verify |
| 73 | bench --site mysite migrate # if not done by update |
| 74 | bench version # confirm versions |
| 75 | ``` |
| 76 | |
| 77 | ### What `bench update` Executes (In Order) |
| 78 | |
| 79 | 1. Backup all sites |
| 80 | 2. Pull latest code for all apps (`git pull`) |
| 81 | 3. Install Python requirements (`pip install`) |
| 82 | 4. Install Node requirements (`yarn install`) |
| 83 | 5. Build static assets (`bench build`) |
| 84 | 6. Run migrations on all sites (`bench migrate`) |
| 85 | 7. Restart bench processes |
| 86 | |
| 87 | --- |
| 88 | |
| 89 | ## v14 → v15 Breaking Changes |
| 90 | |
| 91 | ### Environment Requirements |
| 92 | |
| 93 | | Requirement | v14 | v15 | |
| 94 | |-------------|-----|-----| |
| 95 | | Node.js | v14+ | **v18+** | |
| 96 | | Python packaging | setup.py | **pyproject.toml** | |
| 97 | |
| 98 | ### Backend Breaking Changes |
| 99 | |
| 100 | - **`db.set()` removed** — Use `doc.db_set()` instead |
| 101 | - **`db.sql()` parameters removed** — `as_utf8` and `formatted` no longer accepted |
| 102 | - **`db.set_value()` for Singles** — Use `frappe.db.set_single_value()` instead |
| 103 | - **`job_name` deprecated** — Use `job_id` parameter in `enqueue()` |
| 104 | - **`frappe.new_doc()` arguments** — `parent_doc`, `parentfield`, `as_dict` MUST be keyword args |
| 105 | - **`frappe.get_installed_apps()`** — No longer accepts `sort` or `frappe_last` args |
| 106 | - **Method override order reversed** — Last override now takes precedence |
| 107 | - **Timezone functions renamed** — `convert_utc_to_user_timezone` → `convert_utc_to_system_timezone` |
| 108 | |
| 109 | ### Frontend Breaking Changes |
| 110 | |
| 111 | - **Vue 2 → Vue 3** — All Vue components MUST be migrated |
| 112 | - **Window globals removed** — `get_today` → `frappe.datetime.get_today`, `user` → `frappe.session.user` |
| 113 | - **`this` in Client Scripts** — Local scope access no longer supported |
| 114 | - **Image lazy loading** — Replace `website-image-lazy` class with native `loading="lazy"` |
| 115 | |
| 116 | ### Security Changes |
| 117 | |
| 118 | - **Server Scripts disabled by default** — Enable: `bench set-config -g server_script_enabled 1` |
| 119 | - **"Desk User" role added** — Replaces "All" role for desk user permissions |
| 120 | - **`currentsite.txt` removed** — Use `bench u |