Error while migrating from Version 14 to Version 15

Hello,
I have ERPNext version 14 in which only MASTER Data is present like Items, Warehouses etc. No transactions have been done in this installation.
I installed a fresh new instance of Erpnext Version 15 on a new server and then followed the following step to migrate data:

  1. Backup V14 data using bench backup --with-files
  2. Copied the backup files to new V15 server
  3. Restored the backup using bench force restore.

The above process went smoothly. But when I try to open the V15 site I am getting following error:

Traceback (most recent call last):
File “apps/frappe/frappe/www/app.py”, line 29, in get_context
boot = frappe.sessions.get()
File “apps/frappe/frappe/sessions.py”, line 143, in get
bootinfo = get_bootinfo()
File “apps/frappe/frappe/boot.py”, line 52, in get_bootinfo
load_desktop_data(bootinfo)
File “apps/frappe/frappe/boot.py”, line 136, in load_desktop_data
bootinfo.allowed_workspaces = get_workspace_sidebar_items().get(“pages”)
File “apps/frappe/frappe/utils/typing_validations.py”, line 31, in wrapper
return func(*args, **kwargs)
File “apps/frappe/frappe/desk/desktop.py”, line 443, in get_workspace_sidebar_items
all_pages = frappe.get_all(
File “apps/frappe/frappe/init.py”, line 2006, in get_all
return get_list(doctype, *args, **kwargs)
File “apps/frappe/frappe/init.py”, line 1981, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
File “apps/frappe/frappe/model/db_query.py”, line 200, in execute
result = self.build_and_run()
File “apps/frappe/frappe/model/db_query.py”, line 240, in build_and_run
return frappe.db.sql(
File “apps/frappe/frappe/database/database.py”, line 217, in sql
self._cursor.execute(query, values)
File “env/lib/python3.10/site-packages/pymysql/cursors.py”, line 153, in execute
result = self._query(query)
File “env/lib/python3.10/site-packages/pymysql/cursors.py”, line 322, in _query
conn.query(q)
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 558, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 822, in _read_query_result
result.read()
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 1200, in read
first_packet = self.connection._read_packet()
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 772, in _read_packet
packet.raise_for_error()
File “env/lib/python3.10/site-packages/pymysql/protocol.py”, line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File “env/lib/python3.10/site-packages/pymysql/err.py”, line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, “Unknown column ‘indicator_color’ in ‘field list’”)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “apps/frappe/frappe/website/serve.py”, line 18, in get_response
response = renderer_instance.render()
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 84, in render
html = self.get_html()
File “apps/frappe/frappe/website/utils.py”, line 524, in cache_html_decorator
html = func(*args, **kwargs)
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 95, in get_html
self.update_context()
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 163, in update_context
data = self.run_pymodule_method(“get_context”)
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 225, in run_pymodule_method
return method(self.context)
File “apps/frappe/frappe/www/app.py”, line 31, in get_context
raise frappe.SessionBootFailed from e
frappe.exceptions.SessionBootFailed

Request to please guide resolving this issue

There is a mismatch of a field list with regards to some expected one.

Maybe you should try bench migrate?

Other ways might be to import the master data via another means, like exporting then importing, with some api tools (could be put to many different uses once you built some for your purposes), or maybe look into event streaming.

Thank you for the reply and suggestions.
I tried bench migrate. It throws following error

root@erpnext-156852-erp-0:/kshem# cd erpnext
root@erpnext-156852-erp-0:/kshem/erpnext# cd frappe-bench
root@erpnext-156852-erp-0:/kshem/erpnext/frappe-bench# bench --site default migrate
Migrating default
Queued rebuilding of search index for default

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 0x7f999de7b7f0>, origin=‘/kshem/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py’)
code = <code object at 0x7f999c81ed90, file “/kshem/erpnext/frappe-bench/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 0x7f999de7b7f0>, ‘spec’: ModuleSpec(name=‘frappe.utils.bench_helper’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f999de7b7f0>, origin=‘/kshem/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py’), ‘annotations’: {}, ‘builtins’: <module ‘builtins’ (built-in)>, ‘file’: ‘/kshem/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py’, ‘cached’: ‘/kshem/erpnext/frappe-bench/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…
File “/usr/lib/python3.10/runpy.py”, line 86, in _run_code
exec(code, run_globals)
code = <code object at 0x7f999c81ed90, file “/kshem/erpnext/frappe-bench/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 0x7f999de7b7f0>, ‘spec’: ModuleSpec(name=‘frappe.utils.bench_helper’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f999de7b7f0>, origin=’/kshem/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py’), ‘annotations’: {}, ‘builtins’: <module ‘builtins’ (built-in)>, ‘file’: ‘/kshem/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py’, ‘cached’: ‘/kshem/erpnext/frappe-bench/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… init_globals = None
mod_name = ‘main
mod_spec = ModuleSpec(name=‘frappe.utils.bench_helper’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f999de7b7f0>, origin=’/kshem/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py’)
pkg_name = ‘frappe.utils’
script_name = None
loader = <_frozen_importlib_external.SourceFileLoader object at 0x7f999de7b7f0>
fname = ‘/kshem/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py’
cached = ‘/kshem/erpnext/frappe-bench/apps/frappe/frappe/utils/pycache/bench_helper.cpython-310.pyc’
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 114, in
main()
…skipped… 27 vars
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main
click.Group(commands=commands)(prog_name=“bench”)
commands = {‘frappe’: , ‘get-frappe-commands’: , ‘get-frappe-help’: }
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1157, in call
return self.main(*args, **kwargs)
self =
args = ()
kwargs = {‘prog_name’: ‘bench’}
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1078, in main
rv = self.invoke(ctx)
self =
args = [‘frappe’, ‘–site’, ‘default’, ‘migrate’]
prog_name = ‘bench’
complete_var = None
standalone_mode = True
windows_expand_args = True
extra = {}
ctx = <click.core.Context object at 0x7f999c816230>
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
_process_result = <function MultiCommand.invoke.._process_result at 0x7f999c9f9fc0>
args = [‘migrate’]
cmd_name = ‘frappe’
cmd =
sub_ctx = <click.core.Context object at 0x7f999c401870>
ctx = <click.core.Context object at 0x7f999c816230>
self =
class = <class ‘click.core.MultiCommand’>
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
_process_result = <function MultiCommand.invoke.._process_result at 0x7f999c3f3a30>
args = []
cmd_name = ‘migrate’
cmd =
sub_ctx = <click.core.Context object at 0x7f999c401bd0>
ctx = <click.core.Context object at 0x7f999c401870>
self =
class = <class ‘click.core.MultiCommand’>
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
self =
ctx = <click.core.Context object at 0x7f999c401bd0>
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 783, in invoke
return __callback(*args, **kwargs)
_Context__self = <click.core.Context object at 0x7f999c401bd0>
_Context__callback = <function migrate at 0x7f999c3c8430>
args = ()
kwargs = {‘skip_failing’: False, ‘skip_search_index’: False}
ctx = <click.core.Context object at 0x7f999c401bd0>
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py”, line 33, in new_func
return f(get_current_context(), *args, **kwargs)
args = ()
kwargs = {‘skip_failing’: False, ‘skip_search_index’: False}
f = <function migrate at 0x7f999c3c81f0>
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/commands/init.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
ctx = <click.core.Context object at 0x7f999c401bd0>
args = ()
kwargs = {‘skip_failing’: False, ‘skip_search_index’: False}
profile = False
f = <function migrate at 0x7f999c3c8160>
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py”, line 596, in migrate
SiteMigration(
context = {‘sites’: [‘default’], ‘force’: False, ‘verbose’: False, ‘profile’: False}
skip_failing = False
skip_search_index = False
activate_by_import = <module ‘traceback_with_variables.activate_by_import’ from ‘/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/traceback_with_variables/activate_by_import.py’>
SiteMigration = <class ‘frappe.migrate.SiteMigration’>
site = ‘default’
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/migrate.py”, line 185, in run
self.run_schema_updates()
self = <frappe.migrate.SiteMigration object at 0x7f999c401cf0>
site = ‘default’
filelock = <function filelock at 0x7f999a46aa70>
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/migrate.py”, line 52, in wrapper
raise e
args = (<frappe.migrate.SiteMigration object at 0x7f999c401cf0>,)
kwargs = {}
method = <function SiteMigration.run_schema_updates at 0x7f999a46a680>
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/migrate.py”, line 44, in wrapper
ret = method(*args, **kwargs)
args = (<frappe.migrate.SiteMigration object at 0x7f999c401cf0>,)
kwargs = {}
method = <function SiteMigration.run_schema_updates at 0x7f999a46a680>
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/migrate.py”, line 116, in run_schema_updates
frappe.modules.patch_handler.run_all(
self = <frappe.migrate.SiteMigration object at 0x7f999c401cf0>
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 56, in run_all
executed = set(frappe.get_all(“Patch Log”, filters={“skipped”: 0}, fields=“patch”, pluck=“patch”))
patch_type = <PatchType.pre_model_sync: ‘pre_model_sync’>
skip_failing = False
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 2006, in get_all
return get_list(doctype, *args, **kwargs)
doctype = ‘Patch Log’
args = ()
kwargs = {‘filters’: {‘skipped’: 0}, ‘fields’: ‘patch’, ‘pluck’: ‘patch’, ‘ignore_permissions’: True, ‘limit_page_length’: 0}
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 1981, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
doctype = ‘Patch Log’
args = ()
kwargs = {‘filters’: {‘skipped’: 0}, ‘fields’: ‘patch’, ‘pluck’: ‘patch’, ‘ignore_permissions’: True, ‘limit_page_length’: 0}
frappe = <module ‘frappe’ from ‘/kshem/erpnext/frappe-bench/apps/frappe/frappe/init.py’>
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 200, in execute
result = self.build_and_run()
self = <frappe.model.db_query.DatabaseQuery object at 0x7f99995b2470>
fields = ‘patch’
filters = {‘skipped’: 0}
or_filters = None
docstatus = None
group_by = None
order_by = ‘KEEP_DEFAULT_ORDERING’
limit_start = False
limit_page_length = 0
as_list = False
with_childnames = False
debug = False
ignore_permissions = True
user = None
with_comment_count = False
join = ‘left join’
distinct = False
start = None
page_length = None
limit = None
ignore_ifnull = False
save_user_settings = False
save_user_settings_fields = False
update = None
add_total_row = None
user_settings = None
reference_doctype = None
run = True
strict = True
ignore_ddl = False
parent_doctype = None
pluck = ‘patch’
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 240, in build_and_run
return frappe.db.sql(
self = <frappe.model.db_query.DatabaseQuery object at 0x7f99995b2470>
args = {‘tables’: ‘tabPatch Log’, ‘conditions’: ‘where tabPatch Log.skipped = 0.0’, ‘fields’: ‘patch’, ‘order_by’: ’ order by tabPatch Log.modified DESC’, ‘group_by’: ‘’, ‘limit’: ‘’}
query = ‘select patch\n\t\t\tfrom tabPatch Log\n\t\t\twhere tabPatch Log.skipped = 0.0\n\t\t\t\n\t\t\t order by tabPatch Log.modified DESC\n\t\t\t’
File “/kshem/erpnext/frappe-bench/apps/frappe/frappe/database/database.py”, line 217, in sql
self._cursor.execute(query, values)
self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7f999c4ff6d0>
query = ‘select patch\n\t\t\tfrom tabPatch Log\n\t\t\twhere tabPatch Log.skipped = 0.0\n\t\t\t\n\t\t\t order by tabPatch Log.modified DESC’
values = None
as_dict = True
as_list = 0
debug = False
ignore_ddl = False
auto_commit = 0
update = None
explain = False
run = True
pluck = False
trace_id = None
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py”, line 153, in execute
result = self._query(query)
self = <pymysql.cursors.Cursor object at 0x7f99995b1ea0>
query = ‘select patch\n\t\t\tfrom tabPatch Log\n\t\t\twhere tabPatch Log.skipped = 0.0\n\t\t\t\n\t\t\t order by tabPatch Log.modified DESC’
args = None
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py”, line 322, in _query
conn.query(q)
self = <pymysql.cursors.Cursor object at 0x7f99995b1ea0>
q = ‘select patch\n\t\t\tfrom tabPatch Log\n\t\t\twhere tabPatch Log.skipped = 0.0\n\t\t\t\n\t\t\t order by tabPatch Log.modified DESC’
conn = <pymysql.connections.Connection object at 0x7f99995b1de0>
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 558, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
self = <pymysql.connections.Connection object at 0x7f99995b1de0>
sql = b’select patch\n\t\t\tfrom tabPatch Log\n\t\t\twhere tabPatch Log.skipped = 0.0\n\t\t\t\n\t\t\t order by tabPatch Log.modified DESC’
unbuffered = False
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 822, in _read_query_result
result.read()
self = <pymysql.connections.Connection object at 0x7f99995b1de0>
unbuffered = False
result = <pymysql.connections.MySQLResult object at 0x7f9999770f70>
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 1200, in read
first_packet = self.connection._read_packet()
self = <pymysql.connections.MySQLResult object at 0x7f9999770f70>
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 772, in _read_packet
packet.raise_for_error()
self = <pymysql.connections.Connection object at 0x7f99995b1de0>
packet_type = <class ‘pymysql.protocol.MysqlPacket’>
buff = bytearray(b"\xff\x1e\x04#42S22Unknown column 'tabPatch Log.skipped' in 'where clause'“)
packet_header = b’@\x00\x00\x01’
btrl = 64
btrh = 0
packet_number = 1
bytes_to_read = 64
recv_data = b”\xff\x1e\x04#42S22Unknown column ‘tabPatch Log.skipped’ in ‘where clause’"
packet = <pymysql.protocol.MysqlPacket object at 0x7f999964f370>
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/protocol.py”, line 221, in raise_for_error
err.raise_mysql_exception(self._data)
self = <pymysql.protocol.MysqlPacket object at 0x7f999964f370>
errno = 1054
File “/kshem/erpnext/frappe-bench/env/lib/python3.10/site-packages/pymysql/err.py”, line 143, in raise_mysql_exception
raise errorclass(errno, errval)
data = b"\xff\x1e\x04#42S22Unknown column ‘tabPatch Log.skipped’ in ‘where clause’"
errno = 1054
errval = “Unknown column ‘tabPatch Log.skipped’ in ‘where clause’”
errorclass = <class ‘pymysql.err.OperationalError’>
pymysql.err.OperationalError: (1054, “Unknown column ‘tabPatch Log.skipped’ in ‘where clause’”)
root@erpnext-156852-erp-0:/kshem/erpnext/frappe-bench#

With no customization done in V14 instance, not sure why these Database related error are coming.

Any help or guidance on where we are going wrong?

any update for this error

You might want to refer to this post on how to migrate from v14 to v15. As far as I know, doing a simple backup & restore method won’t work, there are additional steps needed as the database schema of v14 and v15 will be different even though you have not done any modifications.