Cannot restore db from v7 to v9

hi, i was using v7 and unfortunately, my server crashed. now i am trying to restore the database to v9 but its giving me such a hard time. is there anyone who can help me in this. its very important data and our all operation stop due this . if possible can you send me v7 ova file. i have only database backup my server is complete crashed.

I think with the number of database changes from 7 to 9 that it would be very very du to use a dB created in v7 in vers 9.

So as you say try to find an older version of the VM or you may be able to use an older version ie version 7 of ERPNext from github. This question if pulling specific github versions has cropped up a few times so you may want to search the forum for a possible answer

Good luck

Explain what instructions and steps you have followed, what problems you have had etc. Have you traceback to troubleshoot? The more you tell us the more folks can help you.

A v9 instance can restore and migrate a v7 database.

@clarkej, I have the same issue trying to restore v7 data into v9.

Here are what I have done:

1st bench migrate:
Migrating box.ledgergeek.com
Executing execute:frappe.utils.global_search.setup_global_search_table() in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.update_global_search_table in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_1.rename_scheduler_log_to_error_log in box.ledgergeek.com (20bbcc944caa1842)
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 217, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/frappe/frappe/patches/v7_1/rename_scheduler_log_to_error_log.py”, line 5, in execute
frappe.rename_doc(‘DocType’, ‘Scheduler Log’, ‘Error Log’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 696, in rename_doc
return rename_doc(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/rename_doc.py”, line 79, in rename_doc
new_doc.add_comment(‘Edit’, _(“renamed from {0} to {1}”).format(frappe.bold(old), frappe.bold(new)))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1051, in add_comment
out.insert(ignore_permissions=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 219, in insert
self._validate()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 436, in _validate
self._validate_mandatory()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 655, in _validate_mandatory
name=self.name))
frappe.exceptions.MandatoryError: [Version, _VER000038]: doclist_json

2nd bench migrate:
Migrating box.ledgergeek.com
Executing frappe.patches.v7_1.rename_scheduler_log_to_error_log in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_2.remove_in_filter in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.drop_in_dialog #2017-09-22 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘doctype’, force=True) #2017-09-22 in box.ledgergeek.com (20bbcc944caa1842)
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 217, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 81, in execute_patch
exec(patchmodule.split(“execute:”)[1],globals())
File “”, line 1, in
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 691, in reload_doc
return frappe.modules.reload_doc(module, dt, dn, force=force, reset_permissions=reset_permissions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 146, in reload_doc
return import_files(module, dt, dn, force=force, reset_permissions=reset_permissions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 19, in import_files
reset_permissions=reset_permissions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 24, in import_file
ret = import_file_by_path(path, force, pre_process=pre_process, reset_permissions=reset_permissions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 58, in import_file_by_path
ignore_version=ignore_version, reset_permissions=reset_permissions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 131, in import_doc
doc.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 245, in insert
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 827, in run_post_save_methods
self.run_method(“on_update”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 702, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 964, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 947, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 696, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 206, in on_update
make_module_and_roles(self)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 767, in make_module_and_roles
if doc.restrict_to_domain and not frappe.db.exists(‘Domain’, doc.restrict_to_domain):
AttributeError: ‘DocType’ object has no attribute ‘restrict_to_domain’

3rd bench migrate:
Migrating box.ledgergeek.com
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘doctype’, force=True) #2017-09-22 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘docfield’, force=True) #2017-03-03 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘docperm’) #2017-03-03 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘module_def’) #2017-09-22 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.drop_is_custom_from_docperm in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.update_records_in_global_search #11-05-2017 in box.ledgergeek.com (20bbcc944caa1842)
Updating Global Search : [========================================]Success
Executing frappe.patches.v8_0.update_published_in_global_search in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘custom_docperm’) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘deleted_document’) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘domain_settings’) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘version’) #2017-04-01 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.rename_page_role_to_has_role #2017-03-16 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_2.setup_custom_perms #2017-01-19 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.set_user_permission_for_page_and_report #2017-03-20 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘role’) #2017-05-23 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘user’) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.clear_cache() in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_1.sync_language_doctype in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_1.rename_chinese_language_codes in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_0.create_private_file_folder in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_1.setup_integration_services #2016-10-27 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.core.doctype.language.language.update_language_names() # 2017-04-12 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.db.set_value(“Print Settings”, “Print Settings”, “add_draft_heading”, 1) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_0.cleanup_list_settings in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.db.set_default(‘language’, ‘’) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_1.refactor_integration_broker in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_1.set_backup_limit in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_2.set_doctype_engine in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_2.merge_knowledge_base in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_0.update_report_builder_json in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_2.set_in_standard_filter_property #1 in box.ledgergeek.com (20bbcc944caa1842)
/home/frappe/frappe-bench/apps/erpnext/erpnext/schools/doctype/assessment/assessment.json missing
/home/frappe/frappe-bench/apps/erpnext/erpnext/buying/doctype/quality_inspection/quality_inspection.json missing
/home/frappe/frappe-bench/apps/erpnext/erpnext/utilities/doctype/address_template/address_template.json missing
/home/frappe/frappe-bench/apps/erpnext/erpnext/schools/doctype/discussion/discussion.json missing
/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_gateway/payment_gateway.json missing
/home/frappe/frappe-bench/apps/erpnext/erpnext/schools/doctype/student_batch/student_batch.json missing
/home/frappe/frappe-bench/apps/erpnext/erpnext/schools/doctype/announcement/announcement.json missing
/home/frappe/frappe-bench/apps/erpnext/erpnext/schools/doctype/topic/topic.json missing
/home/frappe/frappe-bench/apps/erpnext/erpnext/utilities/doctype/address/address.json missing
/home/frappe/frappe-bench/apps/erpnext/erpnext/utilities/doctype/contact/contact.json missing
Success
Executing frappe.patches.v8_0.drop_unwanted_indexes in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.db.sql(“update tabCommunication set communication_date = creation where time(communication_date) = 0”) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_2.fix_email_queue_recipient in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_2.update_feedback_request # 2017-02-27 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.rename_doc(‘Country’, ‘Macedonia, Republic of’, ‘Macedonia’, ignore_if_exists=True) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.rename_doc(‘Country’, ‘Iran, Islamic Republic of’, ‘Iran’, ignore_if_exists=True) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.rename_doc(‘Country’, ‘Tanzania, United Republic of’, ‘Tanzania’, ignore_if_exists=True) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.rename_doc(‘Country’, ‘Syrian Arab Republic’, ‘Syria’, ignore_if_exists=True) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.rename_listsettings_to_usersettings in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_2.update_communications in box.ledgergeek.com (20bbcc944caa1842)
/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/contact/contact.json missing
Success
Executing frappe.patches.v8_0.deprecate_integration_broker in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.setup_email_inbox #2017-03-29 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.newsletter_childtable_migrate in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.db.sql(“delete from tabDesktop Icon where module_name=‘Communication’”) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.db.sql(“update tabDesktop Icon set type=‘list’ where _doctype=‘Communication’”) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.fix_non_english_desktop_icons # 2017-04-12 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.set_doctype_values_in_custom_role in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.install_new_build_system_requirements in box.ledgergeek.com (20bbcc944caa1842)
Please update your NodeJS version
npm WARN deprecated babel-preset-es2015@6.24.1: :raised_hands: Thanks for using Babel: we recommend using babelreset-env now: please read babel-preset-es2015 -> babel-preset-env · Babel to update!
npm WARN deprecated babel-preset-babili@0.1.4: babili has been renamed to babel-minify. Please update to babel-preset-minify
npm WARN deprecated babel-preset-es2017@6.24.1: :raised_hands: Thanks for using Babel: we recommend using babelreset-env now: please read babel-preset-es2015 -> babel-preset-env · Babel to update!
npm WARN deprecated babel-preset-es2016@6.24.1: :raised_hands: Thanks for using Babel: we recommend using babelreset-env now: please read babel-preset-es2015 -> babel-preset-env · Babel to update!
frappe@ /home/frappe/frappe-bench
├── babel-core@6.26.0
├─┬ babel-preset-babili@0.1.4
│ ├─┬ babel-plugin-minify-builtins@0.1.3
│ │ └── babel-helper-evaluate-path@0.1.0
│ ├── babel-plugin-minify-constant-folding@0.1.3
│ ├─┬ babel-plugin-minify-dead-code-elimination@0.1.7
│ │ ├── babel-helper-mark-eval-scopes@0.1.1
│ │ └── babel-helper-remove-or-void@0.1.1
│ ├─┬ babel-plugin-minify-flip-comparisons@0.1.2
│ │ └── babel-helper-is-void-0@0.1.1
│ ├─┬ babel-plugin-minify-guarded-expressions@0.1.2
│ │ └── babel-helper-flip-expressions@0.1.2
│ ├── babel-plugin-minify-infinity@0.1.2
│ ├── babel-plugin-minify-mangle-names@0.1.3
│ ├── babel-plugin-minify-numeric-literals@0.1.1
│ ├── babel-plugin-minify-replace@0.1.2
│ ├─┬ babel-plugin-minify-simplify@0.1.2
│ │ └── babel-helper-to-multiple-sequence-expressions@0.1.1
│ ├── babel-plugin-minify-type-constructors@0.1.2
│ ├── babel-plugin-transform-inline-consecutive-adds@0.1.2
│ ├── babel-plugin-transform-regexp-constructors@0.1.1
│ └── babel-plugin-transform-remove-undefined@0.1.2
├── babel-preset-es2015@6.24.1
├── babel-preset-es2016@6.24.1
├── babel-preset-es2017@6.24.1
├── chokidar@1.7.0
└── less@2.7.3

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
npm WARN frappe@ No description
Success
Executing frappe.patches.v8_0.set_currency_field_precision # 2017-05-09 in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.rename_print_to_printing in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v7_1.disabled_print_settings_for_custom_print_format in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.update_desktop_icons in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_0.update_gender_and_salutation in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.db.sql(‘update tabReport set module=“Desk” where name=“ToDo”’) in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_1.enable_allow_error_traceback_in_system_settings in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_1.update_format_options_in_auto_email_report in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_1.delete_custom_docperm_if_doctype_not_exists in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_5.delete_email_group_member_with_invalid_emails in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_x.update_user_permission in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_5.patch_event_colors in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_10.delete_static_web_page_from_global_search in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing frappe.patches.v8_x.add_bgn_xaf_xof_currencies in box.ledgergeek.com (20bbcc944caa1842)
Updating country info : [========================================]
Success
Executing frappe.patches.v9_1.add_sms_sender_name_as_parameters in box.ledgergeek.com (20bbcc944caa1842)
Success
Executing execute:frappe.get_single(‘Domain Settings’).save() in box.ledgergeek.com (20bbcc944caa1842)
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 217, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 81, in execute_patch
exec(patchmodule.split(“execute:”)[1],globals())
File “”, line 1, in
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self.save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 288, in save
self.validate_higher_perm_levels()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 494, in validate_higher_perm_levels
high_permlevel_fields = frappe.get_meta(df.options).meta.get_high_permlevel_fields()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 651, in get_meta
return frappe.model.meta.get_meta(doctype, cached=cached)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 33, in get_meta
lambda: Meta(doctype))
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 173, in hget
value = generator()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 33, in
lambda: Meta(doctype))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 72, in init
super(Meta, self).init(“DocType”, doctype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 103, in init
self.load_from_db()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 77, in load_from_db
super(Meta, self).load_from_db()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 140, in load_from_db
frappe.throw(
(“{0} {1} not found”).format(
(self.doctype), self.name), frappe.DoesNotExistError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 319, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 309, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
raise raise_exception(encode(msg))
frappe.exceptions.DoesNotExistError: DocType Has Domain not found

Bench console:
roblin@localhost:/home/frappe/frappe-bench$ sudo bench console
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
Type “copyright”, “credits” or “license” for more information.

IPython 5.5.0 – An enhanced Interactive Python.
? → Introduction and overview of IPython’s features.
%quickref → Quick reference.
help → Python’s own help system.
object? → Details about ‘object’, use ‘object??’ for extra details.

In [1]: frappe.reload_doc(“core”, “doctype”, “has_domain”)

It stuck there.

Thanks in advance.

Hi roblin

Ah yes that syntax error bit @sheno and me a few days ago -

copy and paste and our different keyboard single and double quote keys cause that error - try another key, one should work…just be consistent

i am geeting same errors and stuck at same point

Blockquote
frappe@erpnext:~/frappe-bench$ bench migrate
Migrating erpnext.vm
Executing execute:frappe.get_single(‘Domain Settings’).save() in erpnext.vm (d56cb677eaab3383)
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 217, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 81, in execute_patch
exec(patchmodule.split(“execute:”)[1],globals())
File “”, line 1, in
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self.save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 288, in save
self.validate_higher_perm_levels()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 494, in validate_higher_perm_levels
high_permlevel_fields = frappe.get_meta(df.options).meta.get_high_permlevel_fields()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 651, in get_meta
return frappe.model.meta.get_meta(doctype, cached=cached)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 33, in get_meta
lambda: Meta(doctype))
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 173, in hget
value = generator()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 33, in
lambda: Meta(doctype))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 72, in init
super(Meta, self).init(“DocType”, doctype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 103, in init
self.load_from_db()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 77, in load_from_db
super(Meta, self).load_from_db()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 140, in load_from_db
frappe.throw((“{0} {1} not found”).format((self.doctype), self.name), frappe.DoesNotExistError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 319, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 309, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
raise raise_exception(encode(msg))
frappe.exceptions.DoesNotExistError: DocType Has Domain not found

Blockquote

I tried several syntax, with our without sudo but they are always false:

roblin@localhost:/home/frappe/frappe-bench$ bench console
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
Type “copyright”, “credits” or “license” for more information.

IPython 5.5.0 – An enhanced Interactive Python.
? → Introduction and overview of IPython’s features.
%quickref → Quick reference.
help → Python’s own help system.
object? → Details about ‘object’, use ‘object??’ for extra details.

In [1]: frappe.reload_doc(“core”,“doctype”,“has_domain”)
Out[1]: False

In [2]: exit

roblin@localhost:/home/frappe/frappe-bench$ sudo bench console
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
Type “copyright”, “credits” or “license” for more information.

IPython 5.5.0 – An enhanced Interactive Python.
? → Introduction and overview of IPython’s features.
%quickref → Quick reference.
help → Python’s own help system.
object? → Details about ‘object’, use ‘object??’ for extra details.

In [1]: frappe.reload_doc(“core”,“doctype”,“has_domain”)
Out[1]: False

In [2]: exit

roblin@localhost:/home/frappe/frappe-bench$ bench console
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
Type “copyright”, “credits” or “license” for more information.

IPython 5.5.0 – An enhanced Interactive Python.
? → Introduction and overview of IPython’s features.
%quickref → Quick reference.
help → Python’s own help system.
object? → Details about ‘object’, use ‘object??’ for extra details.

In [1]: frappe.reload_doc(‘core’,‘doctype’,‘has_domain’)
Out[1]: False

I have also added force=true, but reply was still false.

I can’t explain the response you get -

In my case here’s what I get - the table exists in my instance:

frappe@erpnext:~/frappe-bench$ bench console
Python 2.7.6 (default, Jun 22 2015, 18:00:18)
Type “copyright”, “credits” or “license” for more information.

IPython 5.1.0 – An enhanced Interactive Python.
? → Introduction and overview of IPython’s features.
%quickref → Quick reference.
help → Python’s own help system.
object? → Details about ‘object’, use ‘object??’ for extra details.

In [1]: frappe.reload_doc(“core”, “doctype”, “has_domain”)
Out[1]: False

In [2]: frappe.reload_doc(“core”, “doctype”, “has_domain”, force=“true”)
Out[2]: True

frappe@erpnext:~/frappe-bench$ bench mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 179623
Server version: 10.0.27-MariaDB-1~trusty mariadb.org binary distribution

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [d56cb677eaab3383]> desc tabHas Domain;
±------------±-------------±-----±----±--------±------+
| Field | Type | Null | Key | Default | Extra |
±------------±-------------±-----±----±--------±------+
| name | varchar(140) | NO | PRI | NULL | |
| creation | datetime(6) | YES | | NULL | |
| modified | datetime(6) | YES | | NULL | |
| modified_by | varchar(140) | YES | | NULL | |
| owner | varchar(140) | YES | | NULL | |
| docstatus | int(1) | NO | | 0 | |
| parent | varchar(140) | YES | MUL | NULL | |
| parentfield | varchar(140) | YES | | NULL | |
| parenttype | varchar(140) | YES | | NULL | |
| idx | int(8) | NO | | 0 | |
| domain | varchar(140) | YES | | NULL | |
±------------±-------------±-----±----±--------±------+
11 rows in set (0.00 sec)

for the sql use the back-tick character like so:

desc `tabHas Domain`

maybe try ‘bench update’ again?

edit: fix missing back-tick quotes…

any one? help me out on this …
please our all work is stop

i tried many time bench update but its not working

hi roblin did u able to fix?

Sorry not yet

You know how to avoid that situation yes?

One ‘trick’ I have seen noted that may get you unstuck here is to switch to the develop branch then back to master, like so:

bench switch-to-develop
bench update --patch

then return back:

bench switch-to-master
bench update

But since patches to migrate the data work in the forward direction (and not in reverse!), to switch back to master from develop can mean the code and database schema may not in all cases map to eachother.

I wonder how safe is this in practice and what problems can arise…

With ERPNext’s ‘rolling release’ stream of updates, master versus develop branch differences are no more than some nominal days and extent out of sync so that any such data mismatches are brief.

My guess is that any database integrity problems are routinely detected and ‘minor’ so that say these can be fixed with a patch when a data-related exception arises?

Perhaps there are ERPNext rules here to do with pending required patch releases, when to merge develop into master?

Certainly caveat emptor: Users are themselves responsible for their own due diligence validity with how they use their data!

Comments are welcome from those in the know or who have any observations to advise or share here.

Thanks