How to upgrade VM

I downloaded and installed the production VM. I logon and do to bench update to upgrade from 10 to 11. But when I run EPRNext is is still version 10 - Help

#To upgrade to the latest v11.x.x's...
#Since the v11/v12 changes, ERPNext upgrades quite weirdly - gives a bunch of messages which loop on themselves
   #To fix... (thanks to @lasalesi who posted about this on the ERPNext forum)
      #The default .git "config" file has a section...
      [remote "upstream"]
              fetch = +refs/heads/master:refs/remotes/upstream/master
      #"master" needs to become "*" #all occurrences, NB!: without the quotes
      [remote "upstream"]
              fetch = +refs/heads/*:refs/remotes/upstream/*
#Edit the file: apps > erpnext> .git > config :
   #nano ~/frappe-bench/apps/erpnext/.git/config
      #[remote "upstream"]
      #    url = https://github.com/frappe/erpnext
      #    fetch = +refs/heads/*:refs/remotes/upstream/*
#   OR   #
sed -i.bak 's/\/master/\/*/g' ~/frappe-bench/apps/erpnext/.git/config   #replace /master with /* (copy the original file to *.bak)
#Then:
bench switch-to-branch version-11 frappe erpnext   #make sure you switch BOTH! (frappe erpnext)
#This download is ~750MB, so it takes a while
bench update --patch
#IF you want v12, then run....
bench switch-to-branch version-12 frappe erpnext --upgrade
bench update --patch #not generally a requirement, but I prefer to run it anyway

This seems very complex. Could I install the version 11 vm. Then export data from the old version 10 VM and then import the data to the new version 11 vm?

As I feared this does not work. There are other software that needs to be updated. Error messages were given for Python 2.7 pip and others. Also you need to list what directory you are in when you issues the commands. A new VM needs to created for version-12 or a better upgrade script that checks and fixes the system. I was lucky that I exported and imported a copy of the VM version-11 for testing this upgrade…otherwise the entire production VM would have been messed up.

I have a manual sequence here, which includes a link to a fully configured VM on Debian 10 and ERPNext v12. The download is very large (~3G) but I have imported it successfully into Hyper-V, VirtualBox and VMware successfully

Trent I downloaded the VM and got it running. However what is the ERPNext “Administrator” password? I tried admin and erpnext erpnextpassword but could not login.

Trent I found it in your script. It was “adminpassword” to save other users time hunting for it. To get it working I had to change the /etc/network/interfaces file to static with address, netmask, gateway,and dns-nameservers added to match my network and reboot. I also in the browser had to enter “http://myserverip:8249/…” to get the login page to appear. Its working and looks good. ERPNext really should be providing this and address ways to simplify the install and how to maintain all of the software upgrades besides just ERPNext. If one small thing is off ERPNext cannot run.

I’m really glad I can work with this VM as a test environment. Is this the production version even if it is stall being developed? ERPNext renaming and lack on keeping the website updated is causing confusion. Is version 12 in development or is it stable?

Also now that is running as a VM how are patches installed for all of the software including ERPNext. As I say if one thing is changed it can bring the whole ERPNext system down.
Really bad for clients.

Hi Rob.
Glad it’s working for you. This is a production version 12.x.14.
To update the OS and also the ERPNext, you can run the standard commands as you would with a normal setup.
OS update…

sudo apt upgrade && sudo apt upgrade -y

ERPNext upgrade:

#login as user erpnext001
cd ~/frappe-bench
bench update

trentmu
I tried using the commands to update ERPNEXT

I signed is as erpnextuser001 and did the commands. Everything seemed fine until I tried to access using login webpage. Then I get “erroer 503 Your system is being updated refresh after a few moments” and it never goes away. Help please.

Hi trentmu solved the problem. What is the name of the site? How do I list the site name so I can used the “bench --site set-maintenance-mode off” command.

I hope ERPNext fixes this error 503.

Well now I got a new programming error:
After reboot the erpnext showed me a message it had updated. Then it kicks out an programming error:

pymysql.err.ProgrammingError: (‘DocType’, ‘Server Script’)

Researching but could use your help.

Hi trentmu
The problem appears to you needed “sudo bench update” and then I rebooted.
It worked.
Thanks Daniel

A word of caution to avoid sudo with bench commands, bench update and so on should suffice. Otherwise you risk subsequent permission denied errors.

1 Like

clarkj thank you however I signed in as erpnext001. The bench update did not work.
Are you saying I should sign in as root to issue bench update.

No, but the frappe user account normally should have sudo privileges…

So to do ERPNext updates I should login as frappe and then issue “cd ~/frappe-bench” and then issue “bench update”. I will test that. Thanks

Log in as user erpnext001, then

cd ~/frappe-bench
bench update
#OR (if there are any problems with this, you can do...)
bench update --reset