Can I stay on v10 and update to the latest v10 release? (Other thread was closed without a solution)

Hi,

I’m currently running an older version of ERPNext at v10.1.72, is there a way for me to update my sites to only v10.1.81 and not go up to v11?

Found how to switch branches here: [Release] Instructions for updating to/staying on v10/v11

But the commands don’t update to the latest v10.1.81.

Still looking for ways.

Appreciate any help.

Thanks!

I don’t understand why the other thread was closed when I specifically said “still looking for ways” loool

go to frappe/erpnext folder and run bench switch-to-branch v10.x.x

Check scenario three in the instructions.

I did scenario three previously. But the About page on the app still shows the old version.

Below are the outputs:

:~/frappe-bench$ bench switch-to-branch v10.x.x frappe erpnext
Switching for frappe
INFO:bench.utils:git config --unset-all remote.upstream.fetch
INFO:bench.utils:git config --add remote.upstream.fetch ‘+refs/heads/:refs/remotes/upstream/
INFO:bench.utils:git fetch upstream
INFO:bench.utils:git checkout v10.x.x
Already on ‘v10.x.x’
Your branch is up-to-date with ‘upstream/v10.x.x’.
INFO:bench.utils:git merge upstream/v10.x.x
Already up-to-date.
Branch v10.x.x does not exist in Upstream for erpnext
Successfully switched branches for:
frappe
Switched to v10.x.x
Please run bench update --patch to be safe from any differences in database schema
:~/frappe-bench$ bench update --patch
Backing up sites…
Patching sites…
Migrating xxx.xxx.xxx
Updating DocTypes for frappe : [========================================]
Updating DocTypes for erpnext : [========================================]
INFO:bench.utils:sudo supervisorctl restart frappe-bench-workers: frappe-bench-web:
frappe-bench-workers:frappe-bench-frappe-schedule: stopped
frappe-bench-workers:frappe-bench-frappe-long-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-default-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-short-worker-0: stopped
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: started
frappe-bench-workers:frappe-bench-frappe-default-worker-0: started
frappe-bench-workers:frappe-bench-frappe-long-worker-0: started
frappe-bench-workers:frappe-bench-frappe-short-worker-0: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started


Bench: Deployment tool for Frappe and ERPNext (https://erpnext.org).
Open source depends on your contributions, so please contribute bug reports, patches, fixes or cash and be a part of the community
()

Then after checking the app’s about, i still see the old version.

Installed Apps
ERPNext: v10.1.72 (master)
Frappe Framework: v10.1.71-5 (f4c4a27) (v10.x.x)

So it doesn’t update the app i.e. to v10.1.81

True, further updates can probably be done using bench update (without the --patch flag)

It fails when running bench update as it looks like its trying to migrate the site to v11

Executing erpnext.patches.v11_0.rename_production_order_to_work_order in xxx.xxx.xxx (7b381e32a8063dd1)
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, 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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 222, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 30, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v11_0/rename_production_order_to_work_order.py”, line 11, in execute
frappe.reload_doc(‘manufacturing’, ‘doctype’, ‘work_order’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 695, in reload_doc
return frappe.modules.reload_doc(module, dt, dn, force=force, reset_permissions=reset_permissions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 155, in reload_doc
return import_files(module, dt, dn, force=force, reset_permissions=reset_permissions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 19, in import_files
reset_permissions=reset_permissions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 24, in import_file
ret = import_file_by_path(path, force, pre_process=pre_process, reset_permissions=reset_permissions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 58, in import_file_by_path
ignore_version=ignore_version, reset_permissions=reset_permissions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 132, in import_doc
doc.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 248, in insert
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 889, in run_post_save_methods
self.run_method(“on_update”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 757, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1026, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1009, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 751, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 238, in on_update
self.run_module_method(“on_doctype_update”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 302, in run_module_method
module = load_doctype_module(self.name, self.module)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 187, in load_doctype_module
raise ImportError(‘Module import failed for {0} ({1})’.format(doctype, module_name + ’ Error: ’ + str(e)))
ImportError: Module import failed for Work Order (erpnext.manufacturing.doctype.work_order.work_order Error: cannot import name get_permitted_documents)

Hi @dedma

Your erpnext branch didn’t switch successfully. You need to ensure your erpnext repo is set to fetch all branches. The fix for this is in the thread you referenced above. You may need to read through it

Cheers!

1 Like

Thanks for pointing that out @wale

So the issue was the upstream of the erpnext app didn’t include to search all.

Steps:

  1. Edit /apps/erpnext/.git/config
  2. Under [remote “upstream”], change the line fetch to the following:
    fetch = +refs/heads/*:refs/remotes/upstream/*
  3. Run bench switch-to-branch v10.x.x frappe erpnext
  4. Run bench update --patch
  5. Done

Thanks for the help. :sunglasses:

3 Likes