I’d like to add to what our friend @rmeyer already said, for future readers.
TLDR: There is no such thing as a downgrade. Before upgrading ERPNext, backup your entire environment. That way you can restore it later, if you change your mind.
When you run the command
bench switch-branch <new-branch>, this only performs a few git commands. Git checks out different commit hashes for frappe, erpnext, and other Apps. This modifies the files within your
../apps/ subdirectory. Notice I did not say all files in your environment. Only files located beneath
Also, that Bench command does not alter the MariaDB database. It does not restore the previous schema. It does not restore the previous data.
As an example. Let’s say you upgrade from v12 to v13. During that upgrade, several things happen to SQL table named
- A column named ‘amount’ is renamed to ‘amount_currency’
- A column named ‘widget’ is dropped.
- A new column ‘margin’ is added, and populated with calculated data.
Everything upgrades successfully. You’re now using ERPNext v13. Great.
Later, you decide to run
bench switch-branch. What happens to SQL table foo?
Even if you follow-up with a
bench migrate command, that will not restore SQL table foo to its earlier v12 condition. You must restore a SQL backup of your site’s database, taken prior to the v13 upgrade.
Remember too, ERPNext is more than Python Apps and SQL. When upgrading versions, probably Python dependencies were upgraded. Node.js dependencies were upgraded. If you want to use v12 again, those dependencies need to get rolled back, your Virtual Environment updated, rollups and bundles fixed.
ERPNext also contains a few other files (Procfile, common_site_config, etc.) which may have been modified during the Upgrade. Those too would need to be fixed.
There are a lot of ingredients that make a ERPNext environment. Everything must be synchronized for proper behavior.
Make regular backups of your entire ERPNext environment. Document the versions of everything you’re using, including MariaDB, Redis, Python, and more. If your VPS crashes and burns, make sure you know how to perform a complete recovery.