V4 to V5 - Update Error

After installing V4.x.x I gave the command to update to V5 ‘bench update --upgrade’ which seemed successful but got an error at the subsequent command ‘bench switch-to-v5 --upgrade’.
Are the steps correct?Pasted below is the terminal output

erpnext4@erpnext4ubu9:~/frappe-bench$ bench update --upgrade
Already up-to-date.
From https://github.com/frappe/frappe

Running latest for site1.local

Updating frappe : [========================================]
Updating erpnext : [========================================]
Updating shopping_cart : [========================================]
Wrote ./assets/js/frappe-web.min.js - 90k
Wrote ./assets/js/shopping-cart-web.min.js - 1k
Wrote ./assets/js/print_format_v3.min.js - 18k
Wrote ./assets/js/erpnext.min.js - 15k
Wrote ./assets/css/frappe.css - 221k
Wrote ./assets/css/frappe-web.css - 163k
Wrote ./assets/css/shopping-cart-web.css - 0k
Wrote ./assets/js/editor.min.js - 27k
Wrote ./assets/css/erpnext.css - 0k
Wrote ./assets/js/frappe.min.js - 610k
Wrote ./assets/js/erpnext-web.min.js - 0k
Wrote ./assets/js/slickgrid.min.js - 105k
Wrote ./assets/js/canvasResize.min.js - 22k
frappe-web: stopped
frappe-workerbeat: stopped
frappe-worker: stopped
frappe-worker: started
frappe-web: started
frappe-workerbeat: started


Bench: Open source installer + admin for Frappe and ERPNext (https://erpnext.com )


https://frappe.io/buy - Donate to help make better free and open source tools

erpnext4@erpnext4ubu9:~/frappe-bench$ bench switch-to-v5 --upgrade

Branch v5.x.x set up to track remote branch v5.x.x from upstream.
Switched to a new branch ‘v5.x.x’
Already up-to-date.
remote: Counting objects: 141213, done.
remote: Compressing objects: 100% (36631/36631), done.
remote: Total 141213 (delta 104442), reused 139810 (delta 103063), pack-reused 0
Receiving objects: 100% (141213/141213), 55.76 MiB | 3.65 MiB/s, done.
Resolving deltas: 100% (104442/104442), completed with 874 local objects.
From https://github.com/frappe/erpnext

  • [new branch] develop -> upstream/develop
  • [new branch] fix-travis -> upstream/fix-travis
  • [new branch] master -> upstream/master
  • [new branch] multi-currency -> upstream/multi-currency
  • [new branch] travis-mysql-purge -> upstream/travis-mysql-purge
  • [new branch] v5.x.x -> upstream/v5.x.x
  • [new tag] v5.6.4 -> v5.6.4
    remote: Counting objects: 163, done.
    remote: Total 163 (delta 0), reused 0 (delta 0), pack-reused 163
    Receiving objects: 100% (163/163), 20.43 KiB | 0 bytes/s, done.
  • [new tag] 4.0.0 -> 4.0.0
  • [new tag] 4.0.0-beta1 -> 4.0.0-beta1
  • [new tag] v3.1.0 -> v3.1.0
  • [new tag] v3.1.1 -> v3.1.1
  • [new tag] v3.1.2 -> v3.1.2
  • [new tag] v3.2.0 -> v3.2.0
  • [new tag] v3.2.1 -> v3.2.1
  • [new tag] v3.2.2 -> v3.2.2
  • [new tag] v3.2.3 -> v3.2.3
  • [new tag] v3.3.0 -> v3.3.0
  • [new tag] v3.3.1 -> v3.3.1
  • [new tag] v3.3.2 -> v3.3.2
  • [new tag] v3.3.3 -> v3.3.3
  • [new tag] v3.3.4 -> v3.3.4
  • [new tag] v3.3.5 -> v3.3.5
  • [new tag] v3.3.6 -> v3.3.6
  • [new tag] v3.3.7 -> v3.3.7
  • [new tag] v3.3.8 -> v3.3.8
  • [new tag] v3.4.0 -> v3.4.0
  • [new tag] v3.4.1 -> v3.4.1
  • [new tag] v3.4.2 -> v3.4.2
  • [new tag] v3.4.3 -> v3.4.3
  • [new tag] v3.4.4 -> v3.4.4
  • [new tag] v3.4.5 -> v3.4.5
  • [new tag] v3.4.6 -> v3.4.6
  • [new tag] v3.4.7 -> v3.4.7
  • [new tag] v3.4.8 -> v3.4.8
  • [new tag] v3.4.9 -> v3.4.9
  • [new tag] v3.5.0 -> v3.5.0
  • [new tag] v3.5.1 -> v3.5.1
  • [new tag] v3.6.0 -> v3.6.0
  • [new tag] v3.6.1 -> v3.6.1
  • [new tag] v3.6.2 -> v3.6.2
  • [new tag] v3.6.3 -> v3.6.3
  • [new tag] v3.6.4 -> v3.6.4
  • [new tag] v3.6.5 -> v3.6.5
  • [new tag] v3.6.6 -> v3.6.6
  • [new tag] v3.7.0 -> v3.7.0
  • [new tag] v3.7.1 -> v3.7.1
  • [new tag] v3.8.0 -> v3.8.0
  • [new tag] v3.8.1 -> v3.8.1
  • [new tag] v3.8.2 -> v3.8.2
  • [new tag] v3.8.3 -> v3.8.3
  • [new tag] v3.8.4 -> v3.8.4
  • [new tag] v3.8.5 -> v3.8.5
  • [new tag] v3.8.6 -> v3.8.6
  • [new tag] v4-beta2 -> v4-beta2
  • [new tag] v4.0.1 -> v4.0.1
  • [new tag] v4.10.0 -> v4.10.0
  • [new tag] v4.11.0 -> v4.11.0
  • [new tag] v4.11.1 -> v4.11.1
  • [new tag] v4.11.2 -> v4.11.2
  • [new tag] v4.12.0 -> v4.12.0
  • [new tag] v4.13.0 -> v4.13.0
  • [new tag] v4.13.1 -> v4.13.1
  • [new tag] v4.14.0 -> v4.14.0
  • [new tag] v4.15.0 -> v4.15.0
  • [new tag] v4.15.1 -> v4.15.1
  • [new tag] v4.15.2 -> v4.15.2
  • [new tag] v4.15.3 -> v4.15.3
  • [new tag] v4.15.4 -> v4.15.4
  • [new tag] v4.16.0 -> v4.16.0
  • [new tag] v4.17.0 -> v4.17.0
  • [new tag] v4.18.0 -> v4.18.0
  • [new tag] v4.18.1 -> v4.18.1
  • [new tag] v4.19.0 -> v4.19.0
  • [new tag] v4.20.0 -> v4.20.0
  • [new tag] v4.20.1 -> v4.20.1
  • [new tag] v4.20.2 -> v4.20.2
  • [new tag] v4.21.0 -> v4.21.0
  • [new tag] v4.21.1 -> v4.21.1
  • [new tag] v4.21.2 -> v4.21.2
  • [new tag] v4.21.3 -> v4.21.3
  • [new tag] v4.21.4 -> v4.21.4
  • [new tag] v4.22.0 -> v4.22.0
  • [new tag] v4.22.1 -> v4.22.1
  • [new tag] v4.22.2 -> v4.22.2
  • [new tag] v4.23.0 -> v4.23.0
  • [new tag] v4.24.0 -> v4.24.0
  • [new tag] v4.24.1 -> v4.24.1
  • [new tag] v4.24.2 -> v4.24.2
  • [new tag] v4.24.3 -> v4.24.3
  • [new tag] v4.24.4 -> v4.24.4
  • [new tag] v4.25.0 -> v4.25.0
  • [new tag] v4.25.1 -> v4.25.1
  • [new tag] v4.25.2 -> v4.25.2
  • [new tag] v4.25.3 -> v4.25.3
  • [new tag] v4.25.4 -> v4.25.4
  • [new tag] v4.25.5 -> v4.25.5
  • [new tag] v4.25.6 -> v4.25.6
  • [new tag] v4.25.7 -> v4.25.7
  • [new tag] v4.3.0 -> v4.3.0
  • [new tag] v4.4.0 -> v4.4.0
  • [new tag] v4.4.1 -> v4.4.1
  • [new tag] v4.4.2 -> v4.4.2
  • [new tag] v4.5.0 -> v4.5.0
  • [new tag] v4.5.1 -> v4.5.1
  • [new tag] v4.5.2 -> v4.5.2
  • [new tag] v4.6.0 -> v4.6.0
  • [new tag] v4.6.1 -> v4.6.1
  • [new tag] v4.6.2 -> v4.6.2
  • [new tag] v4.7.0 -> v4.7.0
  • [new tag] v4.7.1 -> v4.7.1
  • [new tag] v4.7.2 -> v4.7.2
  • [new tag] v4.8.0 -> v4.8.0
  • [new tag] v4.9.0 -> v4.9.0
  • [new tag] v4.9.1 -> v4.9.1
  • [new tag] v4.9.2 -> v4.9.2
  • [new tag] v4.9.3 -> v4.9.3
  • [new tag] v5.0.0 -> v5.0.0
  • [new tag] v5.0.1 -> v5.0.1
  • [new tag] v5.0.10 -> v5.0.10
  • [new tag] v5.0.11 -> v5.0.11
  • [new tag] v5.0.12 -> v5.0.12
  • [new tag] v5.0.13 -> v5.0.13
  • [new tag] v5.0.14 -> v5.0.14
  • [new tag] v5.0.15 -> v5.0.15
  • [new tag] v5.0.16 -> v5.0.16
  • [new tag] v5.0.17 -> v5.0.17
  • [new tag] v5.0.18 -> v5.0.18
  • [new tag] v5.0.19 -> v5.0.19
  • [new tag] v5.0.2 -> v5.0.2
  • [new tag] v5.0.20 -> v5.0.20
  • [new tag] v5.0.21 -> v5.0.21
  • [new tag] v5.0.22 -> v5.0.22
  • [new tag] v5.0.23 -> v5.0.23
  • [new tag] v5.0.24 -> v5.0.24
  • [new tag] v5.0.25 -> v5.0.25
  • [new tag] v5.0.26 -> v5.0.26
  • [new tag] v5.0.27 -> v5.0.27
  • [new tag] v5.0.28 -> v5.0.28
  • [new tag] v5.0.29 -> v5.0.29
  • [new tag] v5.0.3 -> v5.0.3
  • [new tag] v5.0.4 -> v5.0.4
  • [new tag] v5.0.5 -> v5.0.5
  • [new tag] v5.0.6 -> v5.0.6
  • [new tag] v5.0.7 -> v5.0.7
  • [new tag] v5.0.8 -> v5.0.8
  • [new tag] v5.0.9 -> v5.0.9
  • [new tag] v5.1.0 -> v5.1.0
  • [new tag] v5.1.1 -> v5.1.1
  • [new tag] v5.1.2 -> v5.1.2
  • [new tag] v5.1.3 -> v5.1.3
  • [new tag] v5.1.4 -> v5.1.4
  • [new tag] v5.1.5 -> v5.1.5
  • [new tag] v5.1.6 -> v5.1.6
  • [new tag] v5.2.0 -> v5.2.0
  • [new tag] v5.2.1 -> v5.2.1
  • [new tag] v5.3.0 -> v5.3.0
  • [new tag] v5.3.1 -> v5.3.1
  • [new tag] v5.4.0 -> v5.4.0
  • [new tag] v5.4.1 -> v5.4.1
  • [new tag] v5.4.2 -> v5.4.2
  • [new tag] v5.5.0 -> v5.5.0
  • [new tag] v5.5.1 -> v5.5.1
  • [new tag] v5.6.0 -> v5.6.0
  • [new tag] v5.6.1 -> v5.6.1
  • [new tag] v5.6.2 -> v5.6.2
  • [new tag] v5.6.3 -> v5.6.3
  • [new tag] v5.7.0 -> v5.7.0
  • [new tag] v5.7.1 -> v5.7.1
  • [new tag] v5.7.2 -> v5.7.2
  • [new tag] v5.7.3 -> v5.7.3
  • [new tag] v5.7.4 -> v5.7.4
  • [new tag] v5.7.5 -> v5.7.5
  • [new tag] v5.7.6 -> v5.7.6
  • [new tag] v5.7.7 -> v5.7.7
  • [new tag] v5.8.0 -> v5.8.0
  • [new tag] v5.8.1 -> v5.8.1
  • [new tag] v5.8.2 -> v5.8.2
    Branch v5.x.x set up to track remote branch v5.x.x from upstream.
    Switched to a new branch ‘v5.x.x’
    Already up-to-date.
    remote: Counting objects: 970, done.
    remote: Compressing objects: 100% (287/287), done.
    remote: Total 970 (delta 707), reused 924 (delta 662), pack-reused 0
    Receiving objects: 100% (970/970), 241.36 KiB | 125.00 KiB/s, done.
    Resolving deltas: 100% (707/707), completed with 46 local objects.
    From https://github.com/frappe/shopping_cart
  • [new branch] master -> upstream/master
  • [new branch] staging -> upstream/staging
  • [new branch] v4.x.x -> upstream/v4.x.x
  • [new tag] v0.7.0 -> v0.7.0
    remote: Counting objects: 3, done.
    remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 3
    Unpacking objects: 100% (3/3), done.
  • [new tag] v0.1.0 -> v0.1.0
  • [new tag] v0.2.0 -> v0.2.0
  • [new tag] v0.4.0 -> v0.4.0
  • [new tag] v0.5.0 -> v0.5.0
  • [new tag] v0.6.0 -> v0.6.0
  • [new tag] v1-beta1 -> v1-beta1
    error: pathspec ‘v5.x.x’ did not match any file(s) known to git.
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
    File “/home/erpnext4/bench-repo/bench/cli.py”, line 60, in cli
    bench()
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 700, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 680, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 508, in invoke
    return callback(*args, **kwargs)
    File “/home/erpnext4/bench-repo/bench/cli.py”, line 345, in _switch_to_v5
    switch_to_v5(upgrade=upgrade)
    File “/home/erpnext4/bench-repo/bench/app.py”, line 183, in switch_to_v5
    switch_branch(‘v5.x.x’, apps=apps, bench=bench, upgrade=upgrade)
    File “/home/erpnext4/bench-repo/bench/app.py”, line 161, in switch_branch
    exec_cmd(“git checkout {branch}”.format(branch=branch), cwd=app_dir)
    File “/home/erpnext4/bench-repo/bench/utils.py”, line 104, in exec_cmd
    raise CommandFailedError(cmd)
    bench.utils.CommandFailedError: git checkout v5.x.x

@DNGupta Fixed, please pull update.

Thanks for reply…!
I tried "bench update on fresh installation…Now I getting another error

Error as follows

erpnext4:~/bench switch-to-v5 --upgrade
Executing erpnext.patches.v5_4.stock_entry_additional_costs in site1.local (1bd3e0294d)
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/erpnext4/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 77, in
main()
File “/home/erpnext4/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 14, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 700, in call
return self.main(*args, **kwargs)
File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 680, in main
rv = self.invoke(ctx)
File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 508, in invoke
return callback(*args, **kwargs)
File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 16, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py”, line 27, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py”, line 202, in migrate
frappe.modules.patch_handler.run_all()
File “/home/erpnext4/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
if not run_single(patchmodule = patch):
File “/home/erpnext4/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/erpnext4/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/erpnext4/frappe-bench/apps/erpnext/erpnext/patches/v5_4/stock_entry_additional_costs.py”, line 17, in execute
“”")
File “/home/erpnext4/frappe-bench/apps/frappe/frappe/database.py”, line 146, in sql
self._cursor.execute(query)
File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1054, “Unknown column ‘additional_operating_cost’ in ‘where clause’”)
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
File “/home/erpnext4/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 700, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 680, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 508, in invoke
return callback(*args, **kwargs)
File “/home/erpnext4/bench-repo/bench/cli.py”, line 345, in _switch_to_v5
switch_to_v5(upgrade=upgrade)
File “/home/erpnext4/bench-repo/bench/app.py”, line 186, in switch_to_v5
switch_branch(‘v5.x.x’, apps=apps, bench=bench, upgrade=upgrade)
File “/home/erpnext4/bench-repo/bench/app.py”, line 172, in switch_branch
patch_sites()
File “/home/erpnext4/bench-repo/bench/utils.py”, line 158, in patch_sites
run_frappe_cmd(’–site’, ‘all’, ‘migrate’, bench=bench)
File “/home/erpnext4/bench-repo/bench/utils.py”, line 489, in run_frappe_cmd
raise CommandFailedError(args)
bench.utils.CommandFailedError: (’–site’, ‘all’, ‘migrate’)