Bench update --upgrade error

Hi,

Please help, I am getting _mysql_exceptions.ProgrammingError: (1146, “Table ‘1bd3e0294d.tabPortal Menu Item’ doesn’t exist”) error when doing bench update --upgrade from erpnext 6.24.5/frappe 6.25.6 to version 7.2.27.

Detailed error message as follow:

Executing execute:frappe.delete_doc_if_exists(“Web Form”, “contact”) #2016-03-10 in site1.local (1bd3e0294d)
Traceback (most recent call last):
File “/usr/lib64/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib64/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/cahyadi/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/cahyadi/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/cahyadi/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 664, in call
return self.main(*args, **kwargs)
File “/home/cahyadi/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 644, in main
rv = self.invoke(ctx)
File “/home/cahyadi/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/cahyadi/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/cahyadi/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/cahyadi/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 464, in invoke
return callback(*args, **kwargs)
File “/home/cahyadi/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/cahyadi/frappe-bench/apps/frappe/frappe/commands/site.py”, line 209, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/cahyadi/frappe-bench/apps/frappe/frappe/migrate.py”, line 30, in migrate
frappe.modules.patch_handler.run_all()
File “/home/cahyadi/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/cahyadi/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/cahyadi/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 81, in execute_patch
exec patchmodule.split(“execute:”)[1] in globals()
File “”, line 1, in
File “/home/cahyadi/frappe-bench/apps/frappe/frappe/init.py”, line 636, in delete_doc_if_exists
delete_doc(doctype, name, force=force)
File “/home/cahyadi/frappe-bench/apps/frappe/frappe/init.py”, line 631, in delete_doc
ignore_permissions, flags)
File “/home/cahyadi/frappe-bench/apps/frappe/frappe/model/delete_doc.py”, line 97, in delete_doc
delete_from_table(doctype, name, ignore_doctypes, doc)
File “/home/cahyadi/frappe-bench/apps/frappe/frappe/model/delete_doc.py”, line 141, in delete_from_table
frappe.db.sql(“delete from tab%s where parenttype=%s and parent = %s” % (t, ‘%s’, ‘%s’), (doctype, name))
File “/home/cahyadi/frappe-bench/apps/frappe/frappe/database.py”, line 137, in sql
self._cursor.execute(query, values)
File “/home/cahyadi/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/cahyadi/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1146, “Table ‘1bd3e0294d.tabPortal Menu Item’ doesn’t exist”)

I have managed to complete the upgrade by remarking line

execute:frappe.delete_doc_if_exists(“Web Form”, “contact”) #2016-03-10

in patches.txt

Not sure if that was a wise way to do…