Backup & Restore v4 to v6

Hi,

is it possible to backup a V4 production setup and restore in a working v6 setup?

Best,
Dan

@daniel Yes, It is possible.
You can restore v4 db into v6 and then run bench migrate command to run patches.

Hi,

somehow it is not working :confused:

Executing frappe.patches.v5_0.style_settings_to_website_theme in naboo.erpnext.at (0f73a9f9c6)
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 <module>
    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.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands.py", line 205, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/migrate.py", line 27, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 25, in run_all
    if not run_single(patchmodule = patch):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 68, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/patches/v5_0/style_settings_to_website_theme.py", line 10, in execute
    migrate_style_settings()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/patches/v5_0/style_settings_to_website_theme.py", line 28, in migrate_style_settings
    website_theme.use_theme()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/website/doctype/website_theme/website_theme.py", line 55, in use_theme
    use_theme(self.name)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/website/doctype/website_theme/website_theme.py", line 62, in use_theme
    website_settings.save()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 244, in save
    self.run_before_save_methods()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 617, in run_before_save_methods
    self.run_method("validate")
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 579, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 735, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 718, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 573, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/website/doctype/website_settings/website_settings.py", line 17, in validate
    self.validate_home_page()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/website/doctype/website_settings/website_settings.py", line 22, in validate_home_page
    if self.home_page and not resolve_route(self.home_page):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/website/router.py", line 46, in resolve_route
    return get_generator_route(path)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/website/router.py", line 57, in get_generator_route
    generator_routes = get_generator_routes()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/website/router.py", line 84, in get_generator_routes
    {2}""".format(route_column_name, doctype, condition), as_dict=True):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/database.py", line 147, in sql
    self._cursor.execute(query)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1054, "Unknown column 'page_name' in 'field list'")

This patch is failing, you can skip it and run bench migrate.
To skip, add comment in patches.text file.
After ruining other patches, remove comment and run bench migrate again.
post your output here

@kolate_sambhaji

here is the new output:

Executing execute:frappe.db.sql("update tabItemi set apply_warehouse_wise_reorder_level=1, re_order_level=0, re_order_qty=0 where exists(select name fromtabItem Reorder where parent=i.name)") in naboo.erpnext.at (b1e10b2c64)

ile "/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 <module>
    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.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands.py", line 205, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/migrate.py", line 27, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 25, in run_all
    if not run_single(patchmodule = patch):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 66, in execute_patch
    exec patchmodule.split("execute:")[1] in globals()
  File "<string>", line 1, in <module>
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/database.py", line 147, in sql
    self._cursor.execute(query)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1054, "Unknown column 'apply_warehouse_wise_reorder_level' in 'field list'")

im stuck xD