Upgrading V11- V12 Milestone tracker doctype not found

Hello,
I have created a new server on Azure VM.
I have created a working instance of erpnext V12
I have overwritten the database with a backup of our current database on V11
I have overcome many issues so far with bad data issues which I have repaired and re- uploaded but I am now stuck with this one.
I have looked at various patches but cant find one with this doctype.
Any help would be appreciated.
Chris

frappe.exceptions.DoesNotExistError: DocType Milestone Tracker not found

frappe@VM3:~/frappe-bench$ bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 9 (delta 6), reused 8 (delta 6), pack-reused 0
Unpacking objects: 100% (9/9), done.
From GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps
503bad0…9dceb61 master → origin/master
Updating 503bad0…9dceb61
Fast-forward
playbooks/install.py | 2 ±
playbooks/roles/common/tasks/debian_family.yml | 2 ±
2 files changed, 2 insertions(+), 2 deletions(-)
remote: Enumerating objects: 632, done.
remote: Counting objects: 100% (632/632), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 934 (delta 625), reused 627 (delta 625), pack-reused 302
Receiving objects: 100% (934/934), 200.74 KiB | 747.00 KiB/s, done.
Resolving deltas: 100% (737/737), completed with 223 local objects.
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • [new branch] clarkejj-patch-1 → upstream/clarkejj-patch-1
    1de4dd9cb…4b84ebd5a develop → upstream/develop
    c3a8454fb…80cfa7b4a v10.x.x → upstream/v10.x.x
    aa0e0f647…ae9b5f5b9 version-11 → upstream/version-11
    9f453c3f5…2baac79f2 version-11-hotfix → upstream/version-11-hotfix
  • [new tag] v11.1.53 → v11.1.53
    INFO:bench.utils:./env/bin/pip install Pillow
    Requirement already satisfied: Pillow in ./env/lib/python3.6/site-packages (6.1. 0)
    WARNING: You are using pip version 19.2.2, however version 19.2.3 is available.
    You should consider upgrading via the ‘pip install --upgrade pip’ command.
    Backing up sites…
    INFO:bench.app:pulling frappe
    INFO:bench.utils:git pull upstream version-12
    From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
  • branch version-12 → FETCH_HEAD
    Already up to date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    INFO:bench.app:pulling erpnext
    INFO:bench.utils:git pull upstream version-12
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch version-12 → FETCH_HEAD
    Already up to date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    Updating Python libraries…
    INFO:bench.utils:./env/bin/pip install --upgrade pip
    Collecting pip
    Downloading https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce 46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl (1.4MB)
    |████████████████████████████████| 1.4MB 16.0MB/s
    Installing collected packages: pip
    Found existing installation: pip 19.2.2
    Uninstalling pip-19.2.2:
    Successfully uninstalled pip-19.2.2
    Successfully installed pip-19.2.3
    INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/.bench/requirements.tx t
    INFO:bench.app:installing frappe
    INFO:bench.utils:./env/bin/pip install -q -e ./apps/frappe
    INFO:bench.app:installing erpnext
    INFO:bench.utils:./env/bin/pip install -q -e ./apps/erpnext
    Updating node packages…
    INFO:bench.utils:yarn install
    yarn install v1.17.3
    [1/4] Resolving packages…
    success Already up-to-date.
    Done in 0.77s.
    INFO:bench.utils:yarn install
    yarn install v1.17.3
    [1/4] Resolving packages…
    success Already up-to-date.
    Done in 0.27s.
    Patching sites…
    Migrating site1.local
    Traceback (most recent call last):
    File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
    main”, mod_spec)
    File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
    exec(code, run_globals)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 97, in
    main()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 18, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py” , line 764, in call
    return self.main(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py” , line 717, in main
    rv = self.invoke(ctx)
    File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py” , line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py” , line 1137, in invoke
    return process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py” , line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py” , line 555, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/decorato rs.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 25, in func
    ret = f(frappe.dict(ctx.obj), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 233 , in migrate
    migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip
    failing)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 45, in mi grate
    frappe.get_attr(fn)()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/patches/v11_0/sync_user_per mission_doctype_before_migrate.py”, line 6, in execute
    frappe.reload_doc(‘core’, ‘doctype’, ‘user_permission’)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 799, in reload_doc
    return frappe.modules.reload_doc(module, dt, dn, force=force, reset_permissi ons=reset_permissions)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 174 , in reload_doc
    return import_files(module, dt, dn, force=force, reset_permissions=reset_per missions)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, li ne 27, in import_files
    reset_permissions=reset_permissions)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, li ne 32, in import_file
    ret = import_file_by_path(path, force, pre_process=pre_process, reset_permis sions=reset_permissions)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, li ne 66, 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”, li ne 141, in import_doc
    doc.insert()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 25 8, in insert
    self.run_post_save_methods()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 91 7, in run_post_save_methods
    self.run_method(“on_update”)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 78 6, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 10 55, in composer
    return composed(self, method, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 10 40, in runner
    add_to_return_value(self, f(self, method, *args, **kwargs))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/automation/doctype/mileston e_tracker/milestone_tracker.py”, line 34, in evaluate_milestone
    dict(document_type = doc.doctype, disabled=0)):
    File “/home/frappe/frappe-bench/apps/frappe/frappe/cache_manager.py”, line 107 , in get_doctype_map
    items = frappe.get_all(doctype, filters=filters, order_by = order_by)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1291, in get_all
    return get_list(doctype, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1264, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **k wargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 95 , in execute
    result = self.build_and_run()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 10 9, in build_and_run
    args = self.prepare_args()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 13 6, in prepare_args
    self.build_conditions()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 32 3, in build_conditions
    self.build_filter_conditions(self.filters, self.conditions)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 34 4, in build_filter_conditions
    conditions.append(self.prepare_filter_condition(f))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 35 1, in prepare_filter_condition
    f = get_filter(self.doctype, f)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 898, i n get_filter
    meta = frappe.get_meta(f.doctype)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 759, in get_meta
    return frappe.model.meta.get_meta(doctype, cached=cached)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 37, in get_meta
    meta = Meta(doctype)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 84, in init
    super(Meta, self).init(“DocType”, doctype)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 10 4, in init
    self.load_from_db()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 89, in load_from_db
    super(Meta, self).load_from_db()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 14 7, in load_from_db
    frappe.throw(
    (“{0} {1} not found”).format(
    (self.doctype), self.name), frap pe.DoesNotExistError)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 360, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 346, in msgprint
    _raise_exception()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 315, in _raise_exception
    raise raise_exception(msg)
    frappe.exceptions.DoesNotExistError: DocType Milestone Tracker not found
    frappe@VM3:~/frappe-bench$

In tabDoc Type add record for Milestone Tracker OR &
if the Milestone Tracker.json file exist in your code, try via bench force reload doctype.

Any update on this topic? I’ve been trying to restore a backup from v10 to v12 and I’m getting this error.

I have just found this link and this has got me one stage further. Thanks to @clarkej

1 Like

Thanks… It’s working…