Error Upgrade from Version 7 to latest version

I am trying to upgrade ERPNext to latest version but encounter below error. Now I cant access my ERPNext and I can’t restore it as well.

frappe@erpnext:~/frappe-bench$ bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow) frappe
INFO:bench.utils:git pull upstream master

  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete erpnext
    INFO:bench.utils:git pull upstream master
  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    Updating Python libraries…
    INFO:bench.utils:./env/bin/pip install --upgrade pip
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/.bench/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
    Updating node packages…
    INFO:bench.utils:npm install
    npm WARN frappe@ No description
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

up to date in 4.225s
Backing up sites…
Patching sites…
Migrating site1.local
Traceback (most recent call last):
File “/usr/lib/python2.7/”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 94, in
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 18, in main
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 222, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 31, in migrate
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/”, line 69, in execute_patch
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/”, line 118, in block_user
frappe.db.set_global(’__session_status’, block and ‘stop’ or None)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 719, in set_global
self.set_default(key, val, user)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 727, in set_default
frappe.defaults.set_default(key, val, parent, parenttype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 109, in set_default
add_default(key, value, parent)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 120, in add_default
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 245, in insert
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 905, in run_post_save_methods
if self.meta.track_changes and self._doc_before_save and not self.flags.ignore_version:
AttributeError: ‘Meta’ object has no attribute ‘track_changes’

@fachmi Try to upgrade version wise like 7 to 8, then 8 to 9 and so on. Don’t upgrade directly from 7 to 10.

Do you have the step to upgrade just to version 8?

Finally I managed to fresh install V7 and then restore the database into it.
I tried fresh install V10 but I can’t restore the database to V10.

After restoring it on V7, try running a bench update .
Post the error log here if you face any after that.

I got no more error and can successfully run bench update --upgrade,
But my version still V7.

I am trying to upgrade from v7.2.31 to latest version but no luck.
tried to upgrade to v8.x.x first with guidelines from here Unable to install ERPnext v8 due to pip v19 but also no luck. it still stuck with v7.2.31

result from git remote -v shows below;
upstream (fetch)
upstream (push)

I dont know if the problem because of this matter.

If anyone could give some guidance to upgrade, that would be appreciate it.

I agree, you need to point to the standard upstream repos, like this case:

(env) frappe@erpnext:~/frappe-bench$ cd apps/frappe/
(env) frappe@erpnext:~/frappe-bench/apps/frappe$ git remote -v
upstream (fetch)
upstream (push)
(env) frappe@erpnext:~/frappe-bench/apps/frappe$ cd …/erpnext
(env) frappe@erpnext:~/frappe-bench/apps/erpnext$ git remote -v
upstream (fetch)
upstream (push)

Something like this should fix that -

For the frappe repos

frappe@ubuntu:~/frappe-bench/apps/frappe$ git remote remove upstream
frappe@ubuntu:~/frappe-bench/apps/frappe$ git remote add upstream

And for the erpnext repos

frappe@ubuntu:~/frappe-bench/apps/erpnext$ git remote remove upstream
frappe@ubuntu:~/frappe-bench/apps/erpnext$ git remote add upstream

Be sure to try this in a test environment and/or have backup before you run your update…

once, I point to the right repos, how can I upgrade step by step from v7 to v8 then v8 to v9, and so on?

To update version by version, you would need to specify to git the particular version tag to checkout from the repository. Posts like this give the basic idea How to install a specific version of ERPNext