I was having issues with my ERPNext v13 that I have been using for a few years now, so I decided to upgrade to v14.
What a mistake
I am completely out of business now and I have been trying everything under the sun to get back up and running. I wouldn’t even care if the upgrade could be rolled back to where I started a few days ago. At least I still had access to my data and I could still make sales orders and invoices.
I have gotten as far as the switching branch and upgrading using the command:
elvisglazier@iekoserver:~/myfrappe/apps/erpnext$ bench switch-to-branch version-14 frappe erpnext --upgrade
to which I get:
INFO: Fetching upstream unshallow for frappe
$ git remote set-branches upstream ‘*’
$ git fetch --all --unshallow --quiet
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
- branch version-14 → FETCH_HEAD
Switching for frappe
$ git checkout -f version-14
Already on ‘version-14’
Your branch is up to date with ‘upstream/version-14’.
INFO: Fetching upstream unshallow for erpnext
$ git remote set-branches upstream ‘*’
$ git fetch --all --unshallow --quiet
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP) - branch version-14 → FETCH_HEAD
Switching for erpnext
$ git checkout -f version-14
Already on ‘version-14’
Your branch is up to date with ‘upstream/version-14’.
SUCCESS: Successfully switched branches for: frappe, erpnext
Please runbench update --patch
to be safe from any differences in database schema
elvisglazier@iekoserver:~/myfrappe/apps/erpnext$ bench update --reset
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript - branch version-14 → FETCH_HEAD
Backing up sites…
b"mysqldump: Error 1194: Table ‘tabError Log’ is marked as crashed and should be repaired when dumping tabletabError Log
at row: 19167\n"
Backup failed for Site ieko. Database or site_config.json may be corrupted
When I do ‘git status’ I get:
On branch version-14
Your branch is up to date with ‘upstream/version-14’.
nothing to commit, working tree clean
So I try to migrate and:
elvisglazier@iekoserver:~/myfrappe/apps/erpnext$ bench --site ieko migrate
Migrating ieko
Executing frappe.patches.v13_0.rename_custom_client_script in ieko (_232abceab1ccffdc)
Queued rebuilding of search index for ieko
Traceback with variables (most recent call last):
File “/usr/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
mod_name = ‘frappe.utils.bench_helper’
alter_argv = True
mod_spec = ModuleSpec(name=‘frappe.utils.bench_helper’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x7831be3ced40>, origin=‘/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/bench_helper.py’)
code = <code object at 0x7831bd0d8b30, file “/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/bench_helper.py”, line 1>
main_globals = {‘name’: ‘main’, ‘doc’: None, ‘package’: ‘frappe.utils’, ‘loader’: <_frozen_importlib_external.SourceFileLoader object at 0x7831be3ced40>, ‘spec’: ModuleSpec(name=‘frappe.utils.bench_helper’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x7831be3ced40>, origin=‘/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/bench_helper.py’), ‘annotations’: {}, ‘builtins’: <module ‘builtins’ (built-in)>, ‘file’: ‘/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/bench_helper.py’, ‘cached’: ‘/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/pycache/bench_helper.cpython-310.pyc’, ‘importlib’: <module ‘importlib’ from ‘/usr/lib/python3.10/importlib/init.py’>, ‘json’: <module ‘json’ from ‘/usr/lib/python3.10/json/init.py’>, ‘os’: <module ‘os’ from ‘/usr/lib/python3.10/os.py’>, ‘traceback’: <module ‘traceback’ from ‘/usr/lib/python3.10/traceback.py’>, ‘warnings’: <module ‘warnings’ from ‘/usr/lib/python3.10/warnings.py’>, ‘clic…
File “/usr/lib/python3.10/runpy.py”, line 86, in _run_code
exec(code, run_globals)
code = <code object at 0x7831bd0d8b30, file “/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/bench_helper.py”, line 1>
run_globals = {‘name’: ‘main’, ‘doc’: None, ‘package’: ‘frappe.utils’, ‘loader’: <_frozen_importlib_external.SourceFileLoader object at 0x7831be3ced40>, ‘spec’: ModuleSpec(name=‘frappe.utils.bench_helper’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x7831be3ced40>, origin=’/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/bench_helper.py’), ‘annotations’: {}, ‘builtins’: <module ‘builtins’ (built-in)>, ‘file’: ‘/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/bench_helper.py’, ‘cached’: ‘/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/pycache/bench_helper.cpython-310.pyc’, ‘importlib’: <module ‘importlib’ from ‘/usr/lib/python3.10/importlib/init.py’>, ‘json’: <module ‘json’ from ‘/usr/lib/python3.10/json/init.py’>, ‘os’: <module ‘os’ from ‘/usr/lib/python3.10/os.py’>, ‘traceback’: <module ‘traceback’ from ‘/usr/lib/python3.10/traceback.py’>, ‘warnings’: <module ‘warnings’ from ‘/usr/lib/python3.10/warnings.py’>, ‘clic…
init_globals = None
mod_name = ‘main’
mod_spec = ModuleSpec(name=‘frappe.utils.bench_helper’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x7831be3ced40>, origin=’/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/bench_helper.py’)
pkg_name = ‘frappe.utils’
script_name = None
loader = <_frozen_importlib_external.SourceFileLoader object at 0x7831be3ced40>
fname = ‘/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/bench_helper.py’
cached = ‘/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/pycache/bench_helper.cpython-310.pyc’
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/bench_helper.py”, line 109, in
main()
…skipped… 25 vars
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=“bench”)
commands = {‘frappe’: , ‘get-frappe-commands’: , ‘get-frappe-help’: }
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
self =
args = ()
kwargs = {‘prog_name’: ‘bench’}
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
self =
args = [‘frappe’, ‘–site’, ‘ieko’, ‘migrate’]
prog_name = ‘bench’
complete_var = None
standalone_mode = True
extra = {}
ctx = <click.core.Context object at 0x7831bd0ec790>
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
_process_result = <function MultiCommand.invoke.._process_result at 0x7831bd0f32e0>
args = [‘migrate’]
cmd_name = ‘frappe’
cmd =
sub_ctx = <click.core.Context object at 0x7831bd0ec940>
ctx = <click.core.Context object at 0x7831bd0ec790>
self =
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
_process_result = <function MultiCommand.invoke.._process_result at 0x7831bcf36b90>
args =
cmd_name = ‘migrate’
cmd =
sub_ctx = <click.core.Context object at 0x7831bcf41390>
ctx = <click.core.Context object at 0x7831bd0ec940>
self =
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
self =
ctx = <click.core.Context object at 0x7831bcf41390>
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
args = ()
kwargs = {‘skip_failing’: False, ‘skip_search_index’: False}
self = <click.core.Context object at 0x7831bcf41390>
callback = <function migrate at 0x7831bced6ef0>
ctx = <click.core.Context object at 0x7831bcf41390>
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/click/decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
args = ()
kwargs = {‘skip_failing’: False, ‘skip_search_index’: False}
f = <function migrate at 0x7831bced6cb0>
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/commands/init.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
ctx = <click.core.Context object at 0x7831bcf41390>
args = ()
kwargs = {‘skip_failing’: False, ‘skip_search_index’: False}
profile = False
f = <function migrate at 0x7831bced6c20>
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/commands/site.py”, line 671, in migrate
SiteMigration(
context = {‘sites’: [‘ieko’], ‘force’: False, ‘verbose’: False, ‘profile’: False}
skip_failing = False
skip_search_index = False
activate_by_import = <module ‘traceback_with_variables.activate_by_import’ from ‘/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/traceback_with_variables/activate_by_import.py’>
SiteMigration = <class ‘frappe.migrate.SiteMigration’>
site = ‘ieko’
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/migrate.py”, line 182, in run
self.run_schema_updates()
self = <frappe.migrate.SiteMigration object at 0x7831bcf41690>
site = ‘ieko’
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/migrate.py”, line 52, in wrapper
raise e
args = (<frappe.migrate.SiteMigration object at 0x7831bcf41690>,)
kwargs = {}
method = <function SiteMigration.run_schema_updates at 0x7831bae1ee60>
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/migrate.py”, line 44, in wrapper
ret = method(*args, **kwargs)
args = (<frappe.migrate.SiteMigration object at 0x7831bcf41690>,)
kwargs = {}
method = <function SiteMigration.run_schema_updates at 0x7831bae1ee60>
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/migrate.py”, line 117, in run_schema_updates
frappe.modules.patch_handler.run_all(
self = <frappe.migrate.SiteMigration object at 0x7831bcf41690>
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/modules/patch_handler.py”, line 76, in run_all
run_patch(patch)
patch_type = <PatchType.pre_model_sync: ‘pre_model_sync’>
executed = {‘erpnext.patches.v11_0.update_account_type_in_party_type’, ‘erpnext.patches.v10_0.update_assessment_plan’, ‘frappe.patches.v5_2.change_checks_to_not_null’, ‘erpnext.patches.v11_0.merge_land_unit_with_location’, ‘erpnext.patches.v4_2.seprate_manufacture_and_repack’, ‘erpnext.patches.v6_10.fix_delivery_status_of_drop_ship_item #2015-12-08’, ‘execute:frappe.delete_doc(“DocType”, “Purchase Request Item”)’, ‘frappe.patches.v8_0.update_gender_and_salutation’, ‘frappe.patches.v9_1.add_sms_sender_name_as_parameters’, ‘erpnext.patches.v8_0.rename_is_sample_item_to_allow_zero_valuation_rate’, ‘erpnext.patches.v5_4.fix_missing_item_images’, ‘execute:frappe.delete_doc(“DocType”, “Backup Manager”)’, ‘erpnext.patches.v8_6.rename_bom_update_tool’, ‘erpnext.patches.v9_2.rename_net_weight_in_item_master’, ‘erpnext.patches.v9_2.repost_reserved_qty_for_production’, ‘erpnext.patches.v8_9.rename_company_sales_target_field’, ‘frappe.patches.v10_0.enhance_security’, ‘execute:frappe.delete_doc(“Page”, “trial…
run_patch = <function run_all..run_patch at 0x7831badef0a0>
patches = [‘frappe.patches.v12_0.remove_deprecated_fields_from_doctype #3’, ‘execute:frappe.utils.global_search.setup_global_search_table()’, “execute:frappe.reload_doc(‘core’, ‘doctype’, ‘doctype_action’, force=True) #2019-09-23”, “execute:frappe.reload_doc(‘core’, ‘doctype’, ‘doctype_link’, force=True) #2020-10-17”, “execute:frappe.reload_doc(‘core’, ‘doctype’, ‘doctype_state’, force=True) #2021-12-15”, “execute:frappe.reload_doc(‘core’, ‘doctype’, ‘doctype’, force=True) #2017-09-22”, “execute:frappe.reload_doc(‘core’, ‘doctype’, ‘docfield’, force=True) #2018-02-20”, ‘frappe.patches.v11_0.drop_column_apply_user_permissions’, “execute:frappe.reload_doc(‘core’, ‘doctype’, ‘custom_docperm’)”, “execute:frappe.reload_doc(‘core’, ‘doctype’, ‘docperm’) #2018-05-29”, “execute:frappe.reload_doc(‘core’, ‘doctype’, ‘comment’)”, “execute:frappe.reload_doc(‘core’, ‘doctype’, ‘document_naming_rule’, force=True)”, “execute:frappe.reload_doc(‘core’, ‘doctype’, ‘module_def’) #2020-08-28”, “execute:frappe.reloa…
patch = ‘frappe.patches.v13_0.rename_custom_client_script’
skip_failing = False
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/modules/patch_handler.py”, line 62, in run_patch
if not run_single(patchmodule=patch):
patch = ‘frappe.patches.v13_0.rename_custom_client_script’
skip_failing = False
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/modules/patch_handler.py”, line 150, in run_single
return execute_patch(patchmodule, method, methodargs)
patchmodule = ‘frappe.patches.v13_0.rename_custom_client_script’
method = None
methodargs = None
force = False
conf =
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/modules/patch_handler.py”, line 186, in execute_patch
_patch()
patchmodule = ‘frappe.patches.v13_0.rename_custom_client_script’
method = None
methodargs = None
has_patch_file = True
patch = ‘frappe.patches.v13_0.rename_custom_client_script.execute’
docstring = ‘’
_patch = <function execute at 0x7831ba388280>
start_time = 1727746910.6376376
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/patches/v13_0/rename_custom_client_script.py”, line 10, in execute
rename_doc(“DocType”, “Custom Script”, “Client Script”)
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/model/rename_doc.py”, line 175, in rename_doc
rename_dynamic_links(doctype, old, new)
doctype = ‘DocType’
old = ‘Custom Script’
new = ‘Client Script’
force = False
merge = False
ignore_permissions = False
ignore_if_exists = False
show_alert = True
rebuild_search = True
doc = None
validate = True
old_usage_style = ‘Client Script’
new_usage_style = None
meta = <Meta: DocType>
old_doc = <DocType: Custom Script>
out = {}
link_fields = [{‘parent’: ‘Party Type’, ‘fieldname’: ‘party_type’, ‘issingle’: 0}, {‘parent’: ‘Opening Invoice Creation Tool Item’, ‘fieldname’: ‘party_type’, ‘issingle’: 0}, {‘parent’: ‘Sales Invoice Advance’, ‘fieldname’: ‘reference_type’, ‘issingle’: 0}, {‘parent’: ‘Payment Gateway’, ‘fieldname’: ‘gateway_settings’, ‘issingle’: 0}, {‘parent’: ‘Document Naming Rule’, ‘fieldname’: ‘document_type’, ‘issingle’: 0}, {‘parent’: ‘Milestone Tracker’, ‘fieldname’: ‘document_type’, ‘issingle’: 0}, {‘parent’: ‘Event Producer Document Type’, ‘fieldname’: ‘ref_doctype’, ‘issingle’: 0}, {‘parent’: ‘Bank Guarantee’, ‘fieldname’: ‘reference_doctype’, ‘issingle’: 0}, {‘parent’: ‘Data Migration Mapping’, ‘fieldname’: ‘local_doctype’, ‘issingle’: 0}, {‘parent’: ‘Payment Reconciliation’, ‘fieldname’: ‘party_type’, ‘issingle’: 1}, {‘parent’: ‘Desktop Icon’, ‘fieldname’: ‘_doctype’, ‘issingle’: 0}, {‘parent’: ‘Notification’, ‘fieldname’: ‘document_type’, ‘issingle’: 0}, {‘parent’: ‘Tag Link’, ‘fieldname’: 'document_ty…
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/model/rename_doc.py”, line 637, in rename_dynamic_links
for df in get_dynamic_link_map().get(doctype, ):
doctype = ‘DocType’
old = ‘Custom Script’
new = ‘Client Script’
Singles = Table(‘tabSingles’)
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/model/dynamic_links.py”, line 38, in get_dynamic_link_map
for df in get_dynamic_links():
for_delete = False
dynamic_link_map = {}
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/model/dynamic_links.py”, line 62, in get_dynamic_links
df += frappe.db.sql(query, as_dict=True)
df =
query = “select tabDocField
.parent,\n\t\ttabDocType
.read_only, tabDocType
.in_create,\n\t\ttabDocField
.fieldname, tabDocField
.options\n\tfrom tabDocField
, tabDocType
\n\twhere tabDocField
.fieldtype=‘Dynamic Link’ and\n\ttabDocType
.name
=tabDocField
.parent and tabDocType
.is_virtual = 0\n\torder by tabDocType
.read_only, tabDocType
.in_create”
File “/home/elvisglazier/myfrappe/apps/frappe/frappe/database/database.py”, line 244, in sql
self._cursor.execute(query, values)
self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7831bae14d30>
query = “select tabDocField
.parent,\n\t\ttabDocType
.read_only, tabDocType
.in_create,\n\t\ttabDocField
.fieldname, tabDocField
.options\n\tfrom tabDocField
, tabDocType
\n\twhere tabDocField
.fieldtype=‘Dynamic Link’ and\n\ttabDocType
.name
=tabDocField
.parent and tabDocType
.is_virtual = 0\n\torder by tabDocType
.read_only, tabDocType
.in_create”
values = None
as_dict = True
as_list = 0
formatted = 0
debug = False
ignore_ddl = 0
as_utf8 = 0
auto_commit = 0
update = None
explain = False
run = True
pluck = False
as_iterator = False
trace_id = None
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/pymysql/cursors.py”, line 153, in execute
result = self._query(query)
self = <pymysql.cursors.Cursor object at 0x7831bad05210>
query = “select tabDocField
.parent,\n\t\ttabDocType
.read_only, tabDocType
.in_create,\n\t\ttabDocField
.fieldname, tabDocField
.options\n\tfrom tabDocField
, tabDocType
\n\twhere tabDocField
.fieldtype=‘Dynamic Link’ and\n\ttabDocType
.name
=tabDocField
.parent and tabDocType
.is_virtual = 0\n\torder by tabDocType
.read_only, tabDocType
.in_create”
args = None
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/pymysql/cursors.py”, line 322, in _query
conn.query(q)
self = <pymysql.cursors.Cursor object at 0x7831bad05210>
q = “select tabDocField
.parent,\n\t\ttabDocType
.read_only, tabDocType
.in_create,\n\t\ttabDocField
.fieldname, tabDocField
.options\n\tfrom tabDocField
, tabDocType
\n\twhere tabDocField
.fieldtype=‘Dynamic Link’ and\n\ttabDocType
.name
=tabDocField
.parent and tabDocType
.is_virtual = 0\n\torder by tabDocType
.read_only, tabDocType
.in_create”
conn = <pymysql.connections.Connection object at 0x7831bae14cd0>
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/pymysql/connections.py”, line 563, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
self = <pymysql.connections.Connection object at 0x7831bae14cd0>
sql = b"select tabDocField
.parent,\n\t\ttabDocType
.read_only, tabDocType
.in_create,\n\t\ttabDocField
.fieldname, tabDocField
.options\n\tfrom tabDocField
, tabDocType
\n\twhere tabDocField
.fieldtype=‘Dynamic Link’ and\n\ttabDocType
.name
=tabDocField
.parent and tabDocType
.is_virtual = 0\n\torder by tabDocType
.read_only, tabDocType
.in_create”
unbuffered = False
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/pymysql/connections.py”, line 825, in _read_query_result
result.read()
self = <pymysql.connections.Connection object at 0x7831bae14cd0>
unbuffered = False
result = <pymysql.connections.MySQLResult object at 0x7831ba326470>
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/pymysql/connections.py”, line 1199, in read
first_packet = self.connection._read_packet()
self = <pymysql.connections.MySQLResult object at 0x7831ba326470>
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/pymysql/connections.py”, line 775, in _read_packet
packet.raise_for_error()
self = <pymysql.connections.Connection object at 0x7831bae14cd0>
packet_type = <class ‘pymysql.protocol.MysqlPacket’>
buff = bytearray(b”\xff\x1e\x04#42S22Unknown column 'tabDocType.is_virtual' in 'where clause'")
packet_header = b’A\x00\x00\x01’
btrl = 65
btrh = 0
packet_number = 1
bytes_to_read = 65
recv_data = b"\xff\x1e\x04#42S22Unknown column ‘tabDocType.is_virtual’ in ‘where clause’"
packet = <pymysql.protocol.MysqlPacket object at 0x7831b9c756f0>
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/pymysql/protocol.py”, line 219, in raise_for_error
err.raise_mysql_exception(self._data)
self = <pymysql.protocol.MysqlPacket object at 0x7831b9c756f0>
errno = 1054
File “/home/elvisglazier/myfrappe/env/lib/python3.10/site-packages/pymysql/err.py”, line 150, in raise_mysql_exception
raise errorclass(errno, errval)
data = b"\xff\x1e\x04#42S22Unknown column ‘tabDocType.is_virtual’ in ‘where clause’"
errno = 1054
errval = “Unknown column ‘tabDocType.is_virtual’ in ‘where clause’”
errorclass = <class ‘pymysql.err.OperationalError’>
pymysql.err.OperationalError: (1054, “Unknown column ‘tabDocType.is_virtual’ in ‘where clause’”)
Can someone please help me either return to the original v13 or help me get past this?