For those old users who need to do this and may have failed in the past, here’s a step by step that works.
Upgrade steps for anyone moving from an old version like 6 or 7
SO… head to the terminal and navigate to frappe-bench folder, prompt should look like
frappe@erpnext:~/frappe-bench$
install psutil if absent or fails…
sudo pip install psutil
remove nodejs, sudo apt-get remove nodejs
install nodejs v6 or v8, the newer the better
– install curl,
do… sudo apt-get install curl
if you have any errors or 404s, just type sudo apt-get update, this should update aptitude, then try installing curl again: sudo apt-get install curl
THEN…
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
THEN
sudo apt-get install -y nodejs
bench update --reset or just bench update if you don’t have changes in the code
ASIDE – if you have some python errors and you have the developer bench-repo folder, navigate to bench-repo and do
git fetch THEN
git pull, if you made any modifications, do git stash. same with erpnext folder
You may have errors with new columns in doctype, add columns and proceed…
so… from frappe-bench do
bench mysql
THEN… these 2 were needed for my case… so…
ALTER TABLE tabDocType ADD COLUMN restrict_to_domain VARCHAR(40)
ALTER TABLE tabDocType ADD COLUMN in_dialog VARCHAR(40)
THEN optionally:
7. bench build
THEN
8. to patch up and upgrade, type: bench migrate,
skip any non-critical patches[not recommended, but I found no issues yet] skip carefully. patches in apps patches.txt files found in apps/frappe/frappe/patches.txt, similar location for erpnext patches. ** The skipping proved a necessary evil, because I realized this is the reason I never got any updates to work** thanks to @H_N for this insight. So edit document, save and enter bench migrate again, update will progress. use # at the beginning of a line to comment and skip
once done, you’re ready.
depends on your data, some patches will take a while, like some invoice and inventory patches such as adjusting valuation for negative inventory, took a while due to the sheer amount of negative inventory.