Six Step Guide to Upgrade from V6 to V7

For all those out there, here is the list of the things you need to do

System: Ubuntu 14.0 Trusty 64 Bit on Rackspace or Digital Ocean

---------------- Do This Under root user ------------------------------------------

Step 1: Uninstall all version of Node js first

sudo apt-get remove nodejs
sudo apt-get remove npm

Then go to /etc/apt/sources.list.d and remove any node list if you have. Then do a

sudo apt-get update

Step 2: Install Nodejs 6.x version

curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install -y nodejs
sudo apt-get install -y build-essential

Make sure you have installed correct nodejs by doing

node -v
npm -v

Step 3: Install Python setup tools

sudo pip install --upgrade setuptools
sudo apt-get install libffi-dev libssl-dev

Step 4: Install Cryptography (make sure you are a root user, sudoing with frappe user will cause some red flags)

sudo pip install cryptography

make sure no red messages are there during cryptography during installation

Step5 : Reboot

reboot

this is essential as cryptography works after the the reboot.

----------------------------------------- End of root session -------------------------------------------

------------------------------- Enter frappe user session --------------------------------------------

absolutely make sure you are in frappe user session as executing the below command in root will cause errors

Step 6: Login through frappe user and

cd frappe-bench/
bench update --upgrade

You should have your system upgraded from V6 to V7, will take few minutes, just sip a frappe in-between.

As a confirmation about the update you can run the

bench version

should see the below result (version build 7.X.XX might be different as new updates coming in everyday).

Enjoy
Amruth

9 Likes

wouldn’t it be adviseable to stop erpnext before doing this operations?

cd /home/frappe/frappe-bench sudo bench stop

or so?

Thanks for the guide!

I think this notice is redundant if sudo is used afterwards.

Well for crytography, you need to be logged in as root, not just sudo.

You can do it, but not necessary. bench update command takes care of this.

1 Like

Yes.
There is nothing crucial, but mention about using root exists in Step 4. Just my 5c.

how to upgrade the v6 to v7 in Centos 7?

Many thanks!

@adam the process is same, but just that you have to use > yum install for centos in place of apt-get.

i guess you miss the step before upgrading bench
git pull
but the problem is i was able to to do it on local machine as the command works in bench-repo folder but i couldnt fine bench-repo folder on digital ocean ubuntu 14 droplet kindly update your post accordingly

@Pirated I’m not getting want you are conveying. You don’t need git pull. The above steps is all you need if you already have V6 version. This is not for fresh install, but rather upgrade from older version.

Hi all,

I try to upgrade from ErpNext v6.15.0 and frappe v6.16.2 on Debian 7 to erpnext V7 following the instruction but I get an error when I run the bench update --upgrade

erpnext@erpnext-vm:~/frappe-bench$ bench update --upgrade
remote: Counting objects: 19393, done.
remote: Compressing objects: 100% (122/122), done.
remote: Total 19393 (delta 7725), reused 7837 (delta 7725), pack-reused 11546
Receiving objects: 100% (19393/19393), 23.42 MiB | 3.81 MiB/s, done.
Resolving deltas: 100% (15460/15460), completed with 1089 local objects.
From https://github.com/frappe/frappe
b0a002b…86a0604 develop -> upstream/develop

  • [new branch] bot -> upstream/bot
  • [new branch] gantt -> upstream/gantt
    bb5ee2f…19b07b8 gh-pages -> upstream/gh-pages
  • [new branch] hotfix -> upstream/hotfix
    7066a6c…21aaca4 master -> upstream/master
  • [new branch] revert-1943-patch-40 -> upstream/revert-1943-patch-40
  • [new branch] v6.x.x -> upstream/v6.x.x
  • [new tag] v6.27.24 -> v6.27.24
  • [new tag] v7.0.32 -> v7.0.32
    From https://github.com/frappe/frappe
  • [new tag] v6.16.3 -> v6.16.3
  • [new tag] v6.16.4 -> v6.16.4
  • [new tag] v6.17.0 -> v6.17.0
  • [new tag] v6.17.1 -> v6.17.1
  • [new tag] v6.17.2 -> v6.17.2
  • [new tag] v6.17.3 -> v6.17.3
  • [new tag] v6.17.4 -> v6.17.4
  • [new tag] v6.17.5 -> v6.17.5
  • [new tag] v6.17.6 -> v6.17.6
  • [new tag] v6.18.0 -> v6.18.0
  • [new tag] v6.18.1 -> v6.18.1
  • [new tag] v6.19.0 -> v6.19.0
  • [new tag] v6.19.1 -> v6.19.1
  • [new tag] v6.19.2 -> v6.19.2
  • [new tag] v6.19.3 -> v6.19.3
  • [new tag] v6.20.0 -> v6.20.0
  • [new tag] v6.20.1 -> v6.20.1
  • [new tag] v6.20.2 -> v6.20.2
  • [new tag] v6.21.0 -> v6.21.0
  • [new tag] v6.22.0 -> v6.22.0
  • [new tag] v6.22.1 -> v6.22.1
  • [new tag] v6.22.2 -> v6.22.2
  • [new tag] v6.22.3 -> v6.22.3
  • [new tag] v6.22.4 -> v6.22.4
  • [new tag] v6.22.5 -> v6.22.5
  • [new tag] v6.22.6 -> v6.22.6
  • [new tag] v6.22.7 -> v6.22.7
  • [new tag] v6.23.0 -> v6.23.0
  • [new tag] v6.23.1 -> v6.23.1
  • [new tag] v6.23.2 -> v6.23.2
  • [new tag] v6.23.3 -> v6.23.3
  • [new tag] v6.24.0 -> v6.24.0
  • [new tag] v6.24.1 -> v6.24.1
  • [new tag] v6.24.10 -> v6.24.10
  • [new tag] v6.24.2 -> v6.24.2
  • [new tag] v6.24.3 -> v6.24.3
  • [new tag] v6.24.4 -> v6.24.4
  • [new tag] v6.24.5 -> v6.24.5
  • [new tag] v6.24.6 -> v6.24.6
  • [new tag] v6.24.7 -> v6.24.7
  • [new tag] v6.24.8 -> v6.24.8
  • [new tag] v6.24.9 -> v6.24.9
  • [new tag] v6.25.0 -> v6.25.0
  • [new tag] v6.25.1 -> v6.25.1
  • [new tag] v6.25.2 -> v6.25.2
  • [new tag] v6.25.3 -> v6.25.3
  • [new tag] v6.25.4 -> v6.25.4
  • [new tag] v6.25.5 -> v6.25.5
  • [new tag] v6.25.6 -> v6.25.6
  • [new tag] v6.26.0 -> v6.26.0
  • [new tag] v6.26.1 -> v6.26.1
  • [new tag] v6.26.2 -> v6.26.2
  • [new tag] v6.26.3 -> v6.26.3
  • [new tag] v6.26.4 -> v6.26.4
  • [new tag] v6.26.5 -> v6.26.5
  • [new tag] v6.26.6 -> v6.26.6
  • [new tag] v6.27.0 -> v6.27.0
  • [new tag] v6.27.1 -> v6.27.1
  • [new tag] v6.27.10 -> v6.27.10
  • [new tag] v6.27.11 -> v6.27.11
  • [new tag] v6.27.12 -> v6.27.12
  • [new tag] v6.27.13 -> v6.27.13
  • [new tag] v6.27.14 -> v6.27.14
  • [new tag] v6.27.15 -> v6.27.15
  • [new tag] v6.27.16 -> v6.27.16
  • [new tag] v6.27.17 -> v6.27.17
  • [new tag] v6.27.18 -> v6.27.18
  • [new tag] v6.27.19 -> v6.27.19
  • [new tag] v6.27.2 -> v6.27.2
  • [new tag] v6.27.20 -> v6.27.20
  • [new tag] v6.27.21 -> v6.27.21
  • [new tag] v6.27.22 -> v6.27.22
  • [new tag] v6.27.23 -> v6.27.23
  • [new tag] v6.27.3 -> v6.27.3
  • [new tag] v6.27.4 -> v6.27.4
  • [new tag] v6.27.5 -> v6.27.5
  • [new tag] v6.27.6 -> v6.27.6
  • [new tag] v6.27.7 -> v6.27.7
  • [new tag] v6.27.8 -> v6.27.8
  • [new tag] v6.27.9 -> v6.27.9
  • [new tag] v7.0.0 -> v7.0.0
  • [new tag] v7.0.1 -> v7.0.1
  • [new tag] v7.0.10 -> v7.0.10
  • [new tag] v7.0.11 -> v7.0.11
  • [new tag] v7.0.12 -> v7.0.12
  • [new tag] v7.0.13 -> v7.0.13
  • [new tag] v7.0.14 -> v7.0.14
  • [new tag] v7.0.15 -> v7.0.15
  • [new tag] v7.0.16 -> v7.0.16
  • [new tag] v7.0.17 -> v7.0.17
  • [new tag] v7.0.18 -> v7.0.18
  • [new tag] v7.0.19 -> v7.0.19
  • [new tag] v7.0.2 -> v7.0.2
  • [new tag] v7.0.20 -> v7.0.20
  • [new tag] v7.0.21 -> v7.0.21
  • [new tag] v7.0.22 -> v7.0.22
  • [new tag] v7.0.23 -> v7.0.23
  • [new tag] v7.0.24 -> v7.0.24
  • [new tag] v7.0.25 -> v7.0.25
  • [new tag] v7.0.26 -> v7.0.26
  • [new tag] v7.0.27 -> v7.0.27
  • [new tag] v7.0.28 -> v7.0.28
  • [new tag] v7.0.29 -> v7.0.29
  • [new tag] v7.0.3 -> v7.0.3
  • [new tag] v7.0.30 -> v7.0.30
  • [new tag] v7.0.31 -> v7.0.31
  • [new tag] v7.0.4 -> v7.0.4
  • [new tag] v7.0.5 -> v7.0.5
  • [new tag] v7.0.6 -> v7.0.6
  • [new tag] v7.0.7 -> v7.0.7
  • [new tag] v7.0.8 -> v7.0.8
  • [new tag] v7.0.9 -> v7.0.9
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
    File “/home/erpnext/bench-repo/bench/cli.py”, line 60, in cli
    bench()
    File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 610, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 590, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 936, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 416, in invoke
    return callback(*args, **kwargs)
    File “/home/erpnext/bench-repo/bench/cli.py”, line 211, in _update
    version_upgrade = is_version_upgrade()
    File “/home/erpnext/bench-repo/bench/app.py”, line 94, in is_version_upgrade
    upstream_version = get_upstream_version(‘frappe’, bench=bench, branch=branch)
    File “/home/erpnext/bench-repo/bench/app.py”, line 137, in get_upstream_version
    return get_version_from_string(contents)
    File “/home/erpnext/bench-repo/bench/app.py”, line 193, in get_version_from_string
    return match.group(2)
    AttributeError: ‘NoneType’ object has no attribute ‘group’

bench switch-to-master
bench update --patch
bench migrate

bench switch-to-master return an error
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/home/erpnext/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/home/erpnext/bench-repo/bench/cli.py”, line 318, in _switch_to_master
switch_to_master(upgrade=upgrade)
File “/home/erpnext/bench-repo/bench/app.py”, line 179, in switch_to_master
switch_branch(‘master’, apps=apps, bench=bench, upgrade=upgrade)
File “/home/erpnext/bench-repo/bench/app.py”, line 150, in switch_branch
version_upgrade = is_version_upgrade(bench=bench, branch=branch)
File “/home/erpnext/bench-repo/bench/app.py”, line 94, in is_version_upgrade
upstream_version = get_upstream_version(‘frappe’, bench=bench, branch=branch)
File “/home/erpnext/bench-repo/bench/app.py”, line 137, in get_upstream_version
return get_version_from_string(contents)
File “/home/erpnext/bench-repo/bench/app.py”, line 195, in get_version_from_string

I’ve retry and I continue to get this error

erpnext@erpnext-vm:~/frappe-bench$ bench update --upgrade
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/home/erpnext/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click-3.3-py2.7.egg/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/home/erpnext/bench-repo/bench/cli.py”, line 211, in _update
version_upgrade = is_version_upgrade()
File “/home/erpnext/bench-repo/bench/app.py”, line 94, in is_version_upgrade
upstream_version = get_upstream_version(‘frappe’, bench=bench, branch=branch)
File “/home/erpnext/bench-repo/bench/app.py”, line 137, in get_upstream_version
return get_version_from_string(contents)
File “/home/erpnext/bench-repo/bench/app.py”, line 193, in get_version_from_string
return match.group(2)
AttributeError: ‘NoneType’ object has no attribute ‘group’

Oh no!!! its showing this error
frappe@vNTDACLSERPND01:~/frappe-bench$ bench update --upgrade
INFO:bench.utils:updating bench
error: cannot open .git/FETCH_HEAD: Permission denied

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/bench-repo/bench/commands/update.py”, line 34, in update
update_bench()
File “/home/frappe/bench-repo/bench/utils.py”, line 194, in update_bench
exec_cmd(“git pull”, cwd=cwd)
File “/home/frappe/bench-repo/bench/utils.py”, line 100, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull

What can i do?

Hi all,

I followed this guide to upgrade from V6 to V7 for CentOS but was unsuccessful, can someone kindly take a look at the error message and suggest any solution?

[frappe@centos frappe-bench]$ bench update --upgrade
INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
You are using pip version 8.1.0, however version 8.1.2 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.
INFO:bench.app:pulling frappe
From https://github.com/frappe/frappe

  • branch master -> FETCH_HEAD
    Updating 98a230a…dc4b554
    error: Your local changes to the following files would be overwritten by merge:
    frappe/public/js/frappe/ui/toolbar/navbar.html
    frappe/public/js/frappe/ui/toolbar/offcanvas_left_sidebar.html
    Please, commit your changes or stash them before you can merge.
    Aborting
    Traceback (most recent call last):
    File “/usr/bin/bench”, line 9, in
    load_entry_point(‘bench==0.0.0’, ‘console_scripts’, ‘bench’)()
    File “/home/frappe/bench-repo/bench/cli.py”, line 40, in cli
    bench_command()
    File “/usr/lib64/python2.7/site-packages/click/core.py”, line 716, in call
    return self.main(*args, **kwargs)
    File “/usr/lib64/python2.7/site-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/usr/lib64/python2.7/site-packages/click/core.py”, line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/lib64/python2.7/site-packages/click/core.py”, line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/lib64/python2.7/site-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/bench-repo/bench/commands/update.py”, line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
    File “/home/frappe/bench-repo/bench/commands/update.py”, line 76, in _update
    pull_all_apps(bench_path=bench_path)
    File “/home/frappe/bench-repo/bench/app.py”, line 140, in pull_all_apps
    remote=remote, branch=get_current_branch(app, bench_path=bench_path)), cwd=app_dir)
    File “/home/frappe/bench-repo/bench/utils.py”, line 127, in exec_cmd
    raise CommandFailedError(cmd)
    bench.utils.CommandFailedError: git pull upstream master
    [frappe@centos frappe-bench]$ bench version
    erpnext 6.26.0
    frappe 6.26.6

Thanks a lot!

https://discuss.erpnext.com/t/error-in-erpnext-after-update/7644/8

That has been solved in the post above!!