Updating old ERP NEXT to version 7

these are following steps since bench update failed

Steps to upgrade

  1. cd bench-repo
  2. git fetch
  3. git pull

upgrade nodejs

  1. sudo npm cache clean -f
  2. sudo npm install -g n
  3. sudo n stable

final step
bench update --upgrade

Executing erpnext.patches.v7_0.convert_timelog_to_timesheet 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/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/erpnext/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/erpnext/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py”, line 209, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/migrate.py”, line 30, in migrate
frappe.modules.patch_handler.run_all()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/erpnext/frappe-bench/apps/erpnext/erpnext/patches/v7_0/convert_timelog_to_timesheet.py”, line 32, in execute
time_sheet.save(ignore_permissions=True)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 233, in save
return self.save(*args, **kwargs)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 252, in save
self.insert()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 222, in insert
self.run_post_save_methods()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 774, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 654, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 882, in composer
return composed(self, method, *args, **kwargs)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 865, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 648, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/erpnext/frappe-bench/apps/erpnext/erpnext/projects/doctype/timesheet/timesheet.py”, line 102, in on_submit
self.update_task_and_project()
File “/home/erpnext/frappe-bench/apps/erpnext/erpnext/projects/doctype/timesheet/timesheet.py”, line 157, in update_task_and_project
task = frappe.get_doc(“Task”, data.task)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 589, in get_doc
return frappe.model.document.get_doc(arg1, arg2)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 47, in get_doc
return controller(arg1, arg2)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 80, in init
self.load_from_db()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 111, in load_from_db
frappe.throw(
(“{0} {1} not found”).format(
(self.doctype), self.name), frappe.DoesNotExistError)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 300, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 293, in msgprint
_raise_exception()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 266, in _raise_exception
raise raise_exception, encode(msg)
frappe.exceptions.DoesNotExistError: Task TASK00019 not found

Hi @paul-100

The link of task #TASK00019 is present in the one of the record of the Time Log, but the TASK00019 is not exist in the system. So set the null value for the task in the time log which is not exist in the system using sql query.

Thanks, Rohit