Updating v12 to v13 : Another DocType with name Data Import Legacy exists, select another name

Below mentioned error appears to run bench update command:

frappe@frappe:~/frappe-bench$ bench update --patch
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: pip install frappe-bench

remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From https://github.com/frappe/frappe

  • branch version-13 -> FETCH_HEAD
    Backing up sites…
    Backup Summary for erp.biradar.in at 2021-07-15 19:51:47.466931
    Config : ./erp.biradar.in/private/backups/20210715_195145-erp_biradar_in-site_config_backup.json 154.0B
    Database: ./erp.biradar.in/private/backups/20210715_195145-erp_biradar_in-database.sql.gz 2.1MiB
    Backup for Site erp.biradar.in has been successfully completed
    Backup Summary for gb.biradar.in at 2021-07-15 17:21:51.572270
    Config : ./gb.biradar.in/private/backups/20210715_172147-gb_biradar_in-site_config_backup.json 154.0B
    Database: ./gb.biradar.in/private/backups/20210715_172147-gb_biradar_in-database.sql.gz 24.9MiB
    Backup for Site gb.biradar.in has been successfully completed
    Patching sites…
    Migrating erp.biradar.in
    Updating DocTypes for frappe : [========================================] 100%
    Updating DocTypes for erpnext : [========================================] 100%
    Updating Dashboard for frappe
    Updating Dashboard for erpnext
    Updating customizations for Address
    Updating customizations for Contact
    Building search index for erp.biradar.in
    Retrieving Routes : [========================================] 100%
    Building Index : [========================================] 100%Migrating gb.biradar.in
    Executing frappe.patches.v13_0.replace_old_data_import # 2020-06-24 in gb.biradar.in (gb.biradar.in)
    Traceback (most recent call last):
    File “/usr/lib/python3.8/runpy.py”, line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
    File “/usr/lib/python3.8/runpy.py”, line 87, in _run_code
    exec(code, run_globals)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 104, in
    main()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 19, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 829, in call
    return self.main(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 782, in main
    rv = self.invoke(ctx)
    File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 610, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/decorators.py”, line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 27, in _func
    ret = f(frappe.dict(ctx.obj), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 306, in migrate
    migrate(
    File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 67, in migrate
    frappe.modules.patch_handler.run_all(skip_failing)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 41, in run_all
    run_patch(patch)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 30, in run_patch
    if not run_single(patchmodule = patch):
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 71, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 91, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/patches/v13_0/replace_old_data_import.py”, line 17, in execute
    frappe.rename_doc(“DocType”, “Data Import”, “Data Import Legacy”)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 935, in rename_doc
    return rename_doc(*args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/rename_doc.py”, line 60, in rename_doc
    new = validate_rename(doctype, new, meta, merge, force, ignore_permissions)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/rename_doc.py”, line 208, in validate_rename
    frappe.msgprint(
    (“Another {0} with name {1} exists, select another name”).format(doctype, new), raise_exception=1)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 411, in msgprint
    _raise_exception()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 367, in _raise_exception
    raise ValidationError(msg)
    frappe.exceptions.ValidationError: Another DocType with name Data Import Legacy exists, select another name