Broken Database - unusable

After nearly 20 hours straight on this issue, I finally need to give in and consult the experts.
I have an enormous issue at the moment, that was triggered by the version 7 update, though quite how I have no idea.
I have been using ERPNext on my own server (ubuntu 14.04) for nearly a year now, and overall I’m very impressed and we are doing more every day. I hadn’t run an update for around 6 months, so I took the opportunity yesterday. However it didn’t go well.

Something happened during the update, that appeared innocuous, regarding an unknown _Student type or similar. But ever since the problems on my native server have been getting larger and larger and every step I try to take towards a solutions appears to put my installation in a more difficult place to get out of. In fact I can no longer produce the first error at all. I cannot even get an installation of ERPNext with my database backup running; I’ve tried my machine, your images and 3 different flavors of virtual machine.

Every time I restore my database, the subsequent bench migrate causes a crash - the latest one is below. On my server I cannot even run either the python on the shell script installation completely. Below you can see that the transition from the current version to the latest is never completing successfully. I have tried nearly every way that I can think of and failed. I have tried to lock the version of the frappe and erpnext apps while I update but this gives me an error with file and doesn’t allow me to do the update.

My most likely candidate is the length of time between updates, but the update system has been good in the past, I wonder if something go out of whack.

In essence I now have a well developed database with all of my company financials, stock and manufacturing data, in a state of urgent disrepair. I’m desperate to find a solution as I’ve exhausted everything that I can think of.

Please, help! Any ideas are very much appreciated.
Tony Ward

tony@ubuntu:~/frappe-bench$ bench migrate
Migrating site1.local
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘doctype’, force=True) #2016-07-11 in site1.local (1bd3e0294d)
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘docfield’, force=True) #2016-02-26 in site1.local (1bd3e0294d)
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘translation’) #2016-03-03 in site1.local (1bd3e0294d)
Executing frappe.patches.v7_0.update_auth in site1.local (1bd3e0294d)
Executing frappe.patches.v7_0.rename_bulk_email_to_email_queue in site1.local (1bd3e0294d)
Executing frappe.patches.v6_19.comment_feed_communication in site1.local (1bd3e0294d)
Traceback (most recent call last):
File “/usr/lib/python2.7/”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/”, line 72, in _run_code
exec code in run_globals
File “/home/tony/frappe-bench/apps/frappe/frappe/utils/”, line 79, in
File “/home/tony/frappe-bench/apps/frappe/frappe/utils/”, line 16, in main
File “/home/tony/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 716, in call
return self.main(*args, **kwargs)
File “/home/tony/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 696, in main
rv = self.invoke(ctx)
File “/home/tony/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/tony/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/tony/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/tony/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/tony/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/tony/frappe-bench/apps/frappe/frappe/commands/”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/tony/frappe-bench/apps/frappe/frappe/commands/”, line 196, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/tony/frappe-bench/apps/frappe/frappe/”, line 27, in migrate
File “/home/tony/frappe-bench/apps/frappe/frappe/modules/”, line 25, in run_all
if not run_single(patchmodule = patch):
File “/home/tony/frappe-bench/apps/frappe/frappe/modules/”, line 52, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/tony/frappe-bench/apps/frappe/frappe/modules/”, line 68, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/tony/frappe-bench/apps/frappe/frappe/patches/v6_19/”, line 21, in execute
File “/home/tony/frappe-bench/apps/frappe/frappe/patches/v6_19/”, line 232, in update_timeline_doc_for
File “/home/tony/frappe-bench/apps/frappe/frappe/patches/v6_19/”, line 257, in update_for_dynamically_linked_docs
if not is_valid_timeline_doctype(reference_doctype, timeline_doctype):
File “/home/tony/frappe-bench/apps/frappe/frappe/patches/v6_19/”, line 292, in is_valid_timeline_doctype
File “/home/tony/frappe-bench/apps/frappe/frappe/”, line 622, in reload_doctype
reload_doc(scrub(db.get_value(“DocType”, doctype, “module”)), “doctype”, scrub(doctype), force=force)
File “/home/tony/frappe-bench/apps/frappe/frappe/”, line 634, in reload_doc
return frappe.modules.reload_doc(module, dt, dn, force=force)
File “/home/tony/frappe-bench/apps/frappe/frappe/modules/”, line 37, in reload_doc
return import_files(module, dt, dn, force=force)
File “/home/tony/frappe-bench/apps/frappe/frappe/modules/”, line 17, in import_files
return import_file(module, dt, dn, force=force, pre_process=pre_process)
File “/home/tony/frappe-bench/apps/frappe/frappe/modules/”, line 21, in import_file
path = get_file_path(module, dt, dn)
File “/home/tony/frappe-bench/apps/frappe/frappe/modules/”, line 28, in get_file_path
path = os.path.join(get_module_path(module),
File “/home/tony/frappe-bench/apps/frappe/frappe/modules/”, line 29, in get_module_path
return frappe.get_module_path(module)
File “/home/tony/frappe-bench/apps/frappe/frappe/”, line 659, in get_module_path
return get_pymodule_path(local.module_app[module] + “.” + module, *joins)
KeyError: u’accounts’

@tony1 did you have a link field for ‘Blogger’ in any doctype related to ‘Accounts’ module?

Did you try running the update again?

Thanks Anand. I dont believe I had anything like that in the accounts module, though I cannot be sure as I am not the only one working on it.
I had tried updating a lot of times. Then I tried removing the installation many different ways.
Now I cannot even install bench/frappe/erpnext on my original server. That is not an issue as I’m happy to move over to another hosted server if I can get this database running.