Upgrade production version from V12 to V13

Dear,
we need to upgrade our production version erpnext v12 to erpnext v13, can anyone advise us about upgrade steps without and effect on our customization (Field on doctype - custom app )

Regards,

2 Likes

v13 is not yet released for production setup. I would recommend you to wait & wait has been uncertain though.

Dear @mujeerhashmi, the main point is how to upgrade the current version of erpnext to the next version without any effect on the customization on the current version, since when we try to use( bench --update) all customize fields or modification on python files has been removed.

Regards

@Ruba All uncommitted changes are lost during update as only approved changes are moved to new versions during update. The best option to preserver your changes if you cannot commit it to the core is for you to create a custom app and make your changes within the custom app to ensure your changes are not removed anytime you update. If however you cannot create a custom app, the other option for you is to stash your changes in frappe and EPPNext before you update. Here are the steps to stash your changes:

  1. go to frappe and/or erpnext directory: cd ~/frappe-bench/apps/frappe or cd ~/frappe-bench/apps/erpnext
  2. Call up all changes: sudo git status
  3. Add all uncommitted changes: sudo git add -A or if you wish to preserver only specific changes, add the files individually to the list sudo git add <file name>
  4. Stash the changes: sudo git stash

After running these commands, your uncommitted changes should be saved. you can then run bench update to update your instance.

To restore your changes, go to the frappe or erpnext directory: cd ~/frappe-bench/apps/frappe or cd ~/frappe-bench/apps/erpnext and run sudo git stash apply This should restore your changes.

I hope this helps.

Dear @flexy2ky , thanks for your replay

we updated JS files in Frappe like geoloaction.js and we need to save these updates after bench --update.
in your suggestion step 3

  1. Add all uncommitted changes: sudo git add -A or if you wish to preserver only specific changes, add the files individually to the list sudo git add <file name>

the uncommitted changes will be added to frappe repository or we need to create a local branch ??

Thanks

A local albeit temporary branch will be created within the instance to store your changes when you use the sudo git stash command until you apply it back to your instance. To commit it to frappe repository you have to use the git commit command in which case it will have to go through the necessary checks by the frappe team to know if it’s a fix to a bug, a feature that is beneficial to all or a personal addition before deciding whether to merge it to the core or not.

1 Like

For erp update.

ref,

Hey, Step 2 for me was cut short and I didnt get any installations post this

Switching for erpnext
$ git checkout -f version-13
Branch ‘version-13’ set up to track remote branch ‘version-13’ from ‘upstream’.
Switched to a new branch ‘version-13’
SUCCESS: Successfully switched branches for: frappe, erpnext
Please run bench update --patch to be safe from any differences in database schema

I’m getting this error while executing bench update --patch

Traceback (most recent call last):
File “/usr/lib/python3.7/runpy.py”, line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.7/runpy.py”, line 109, in get_module_details
import(pkg_name)
File “/home/brandpackadmin/frappe-bench/apps/frappe/frappe/init.py”, line 1627, in
def log_error(message=None, title=
(“Error”)):
File “/home/brandpackadmin/frappe-bench/apps/frappe/frappe/init.py”, line 69, in _
from frappe.translate import get_full_dict
File “/home/brandpackadmin/frappe-bench/apps/frappe/frappe/translate.py”, line 18, in
from frappe.model.utils import render_include, InvalidIncludePath
File “/home/brandpackadmin/frappe-bench/apps/frappe/frappe/model/utils/init.py”, line 9, in
from frappe.build import html_to_js_template
File “/home/brandpackadmin/frappe-bench/apps/frappe/frappe/build.py”, line 18, in
import psutil
ModuleNotFoundError: No module named ‘psutil’

In the bench folder execute

./env/bin/pip install psutil

2 Likes

DO THE FOLLOWING FOR PRODUCTION SERVER

  1. Update aap form Github

sudo bench switch-to-branch version-14 frappe erpnext --upgrade

  1. update database schema changes

bench update --patch