is there a standardised procedure for keeping erpnext software patched and up to date - for instance on a linux system i would update all repositories and then upgrade everything - this can generally be accomplished with a couple of commands. I ask the question because I have an instance at v13.24.0 and another instance at v13.29.0 and i would like to keep everything up to date and consistant (and importantly understand how that is achieved and how ive managed to get distinct code levels without trying!)
The short answer is you run this command:
bench update
Now hereās the longer explanation. This command does a lot of small tasks. Tasks you ācouldā do yourself manually, in your console. Thereās no magic here: Bench is just saving you some keystrokes. Here is the general idea of what happens when you run that command.
For each App you have installed (Frappe, ERPNext, others):
- A
'git pull'
command is executed in your Appās root directory. Your local code and files are updated, based on whatever is currently in GitHub/GitLab for your git ābranchā. - Python packages are installed/updated based on the new contents of the Appās
'requirements.txt'
file. Updates are (mostly) made from PyPi.org repositories. - Node.js packages are installed/updated, based on the new contents of the Appās
'package.json'
files. (using the yarn package manager) - JS and CSS assets are ārolled upā (minified, concatenated, bundled) to create new asset files.
- Based on DocType schema definitions inside .json text files, your MariaDB SQL databaseās schema is updated (tables, columns, indexes)
- If it exists, āpatch codeā is run. By āpatch codeā, I mean scripts that update your SQL databaseās existing records, based on the new schema and requirements from step 5.
If everything goes well, then thatās it. Youāre on the newest minor and patch version.
To upgrade a major version (e.g. v13 ā v14), we used to type this command:
bench update --upgrade
Does this command still work today? I have no idea. The official documentation never explains how to upgrade.
I tried to answer this for myself, by running bench update --help
. However, the '--upgrade'
flag is gone. Thereās a --force
flag, but Iām reluctant to say thatās the answer (in most CLI Iāve seen, --force
is a suffix usually reserved for doing something potentially breaking.)
So who knows.
Hopefully this information helps, @alpresidente. I stopped using ābench updateā years ago, so Iām not an expert. Hopefully someone else can chime in about the major version upgrades.
Major version upgrades are done through github branches, so the command would be bench switch-to-branch version-1*
. Without doing that, your site will always stay on the same major version but accept minor version updates.
with a few repeats of ābench updateā and some reboots ive been able to get the code levels the same on 2 instances. I do get the following errors although ābench setup requirementsā seems to run without fault - both instances now at:
ERPNext: v13.31.1 (version-13)
Frappe Framework: v13.30.0 (version-13)
ā¦which i think is current
UNRESOLVED_IMPORT : āvue/dist/vue.jsā is imported by ā¦/erpnext/erpnext/public/js/hub/vue-plugins.js, but could not be resolved ā treating it as an external dependency
Cannot find some dependencies. You may have to run ābench setup requirementsā to install them.
UNRESOLVED_IMPORT : āvue/dist/vue.jsā is imported by ā¦/erpnext/erpnext/public/js/hub/marketplace.js, but could not be resolved ā treating it as an external dependency
Cannot find some dependencies. You may have to run ābench setup requirementsā to install them.
MISSING_GLOBAL_NAME : No name was provided for external module āvue/dist/vue.jsā in output.globals ā guessing āVueā
Built js/marketplace.min.js
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Built css/erpnext-web.css
Built css/marketplace.css
Built css-rtl/marketplace.css
Built css-rtl/erpnext-web.css
Built css/erpnext.css
Built css-rtl/erpnext.css