Upgrade from v8 to v11

Hello, I am not a programmer and having problem to upgrade from v8 to v11. Currently my server use ubuntu 14.04, and installation is not using user frappe:frappe, and instead of having single folder ~/frappe-bench it also have ~/bench-repo folder that bench update command also pulling git on ~/bench-repo folder.
I believe I do not use custom apps because this ERP only used for invoicing and accounting for service company only.

I tried to do bench update and the site broke, and by reading error printed, it seems some dependencies are not installable on 14.04.
I also unable to upgrade OS to 16.04 or 18.04 using do-release-upgrade because it keep rolling back.

I also tried to follow this guide here and import on v11 instance on ubuntu 18.04, the site broke.
I tried to bench switch-to-branch v8.x.x then bench update, not importing data yet, i cannot see user and password text box to login into erpnext.
returning using switch-to-master then bench update, text box is back.

Can you please help me to upgrade my instance using easiest method to follow? I don’t mind to migrate to a fresh install instance as long as my data are preserved.

Hi @Tej,

it seems like you have soma package issue… Can you share your output of

$ sudo apt-get update && sudo apt-get upgrade

If this passes, run

$ sudo do-release-upgrade

and share errors should you find any.

You can upgrade ERPNext step-by-step using

$ cd ~/frappe-bench/apps/erpnext
$ git fetch upstream
$ git checkout v9.x.x
$ cd ../frappe
$ git fetch upstream
$ git checkout v9.x.x
$ cd ../..
$ bench update

and repeat the same for v10.x.x and then go to master

You mention that the ERP is currently broken, what do you see on the web front-end?

As a last resort:

$ bench backup --with-files

Then copy your backup & files; make a clean install and restore from your backup.

Hope this helps.

1 Like

Thank you for fast reply @lasalesi

I do bench update on development instance, a clone of production instance with same IP, thus all sites will still accessible using domain name. So production instance is still untouched.

This is the text that shown on front end when I say that erpnext is broken:

Sorry!
We will be back soon.
Don’t panic. It’s not you, it’s us.
Most likely, our engineers are updating the code, and it should take a minute for the new code to load into memory.
Try refreshing after a minute or two.

I am currently running apt-get update and upgrade on development instance, a newly restored instance from production instance, so it may take a while. When it is updated, I will edit this post.
However, the problem is on

do-release-upgrade

SSH’ed as root, I believe I do not need sudo.

I prefer to use this as solution, it looks like previous installer run install script as root, and I believe it is not the way erpnext suggest. The result is python apps have problem when upgrading, not enough permission, so that I have to

sudo pip install --upgrade some-apps

Can you elaborate how to restore the backup from v8.x.x to new instance installed with easy install on ubuntu 18.04?
as far as I know, this is what should I do on fresh ubuntu 18.04:

apt-get update && sudo apt-get upgrade
apt-get install python-minimal
apt-get install build-essential python-setuptools
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
python install.py --develop --user frappe

what I did on my previous attempt is not finishing the wizard on front end and do this:

cd /home/frappe/frappe-bench
bench switch-to-branch v8.x.x
bench update

then I can see every component on login page on front end, but without username and password box, hence I cannot login.

Can you explain what is wrong with my previous step?

I now understand my fault that I should

bench switch-to-branch v9.x.x
bench update

instead of straight

bench switch-to-master
bench update

Here is interactive window when doing apt-get upgrade with my answer in bold

Configuration file β€˜/etc/sudoers’
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer’s version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** sudoers (Y/I/N/O/D/Z) [default=N] ? N

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Configuring grub-pc β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ A new version of configuration file /etc/default/grub is available, but β”‚
β”‚ the version installed currently has been locally modified. β”‚
β”‚ β”‚
β”‚ What do you want to do about modified configuration file grub? β”‚
β”‚ β”‚
β”‚ install the package maintainer’s version β”‚
β”‚ keep the local version currently installed this is my choice β”‚
β”‚ show the differences between the versions β”‚
β”‚ show a side-by-side difference between the versions β”‚
β”‚ show a 3-way difference between available versions β”‚
β”‚ do a 3-way merge between available versions (experimental) β”‚
β”‚ start a new shell to examine the situation β”‚
β”‚

β”‚ Continue without installing GRUB? YES

do-release-upgrade error result will update tomorrow

The β€œSorry! …” error message can indicate that the server instance cannot be found. Do you have a dns multitenant in the production setup? Does the address you are trying to access the server point to a valid site?

root login or sudo are interchangeable, where it is often recommended for access-level protection and traceability to use sudo. But feel free to use the root login.

Restore your backup with

$ cd /home/frappe/frappe-bench
$ sudo bench restore --with-private-files /home/.../[...]_private_files.tar --with-public-files /home/.../[...]_files.tar /home/.../[...]_database.sql.gz
$ sudo bench migrate
$ sudo bench restart

The config changes on apt-get upgrade are ok, you can use default and get through.

Current production instance have multiple sites, that only 1 is used, and currently I do not understand how to delete sites.

However new instance is a fresh install instance, I can access site:site1.local (default site installed from easy install script) using my.domain.com before

bench switch-to-branch v8.x.x
bench update

can I restore v8.x.x backup on v11.x.x instance? or I have to switch to v8.x.x branch before restoring?

If site1.local is accessible from my.domain.com you probably have dns multitenant disabled. As long as you intend to run only one ERPNext, this will be fine.

I recommend to restore the database into the same version and then upgrade so that the patches are applied. Otherwise, you might run into issues such as Column 'translatable' cannot be null

The backup will export one site per run. It will be the site, in which folder you find the backup. On restore, define the site to restore to

$ bench --site my.domain.com backup
$ bench --site site1.local restore
2 Likes

I have managed to upgrade to v11. My solution is here https://discuss.frappe.io/t/unable-to-install-erpnext-v8-due-to-pip-v19/47892/6

I now understand that

$ bench --site my.domain.com backup

make latest sql database downloadable from front end, I thought I have to restore from tar file generated by $ bench --site my.domain.backup

How I upgrade it is by:

  1. cloning disk
  2. reinstall bench using easy install script
  3. do what I do on link above
  4. restore database and files to new site on v8.x.x

Now I have latest version with my old database, still have to backup and restore to newer OS: ubuntu 18.04 but I believe it is way much easier than upgrading.