Error while run bench migrate after restore database and files

Please help
Im facing this error while run bench migrate after restore database and file.
The restore progress was fine and no error.

bench --site erp.local migrate
Migrating erp.local
Updating DocTypes for frappe        : [========================================] 100%
Updating DocTypes for erpnext       : [========================================] 100%
Updating DocTypes for posawesome    : [========================================] 100%
Queued rebuilding of search index for erp.local

Traceback with variables (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
      mod_name = 'frappe.utils.bench_helper'
      alter_argv = True
      mod_spec = ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f74cbad0f10>, origin='/home/gembira/frappe-bench/apps/frappe/frappe/utils/bench_helper.py')
      code = <code object <module> at 0x7f74cabd3ec0, file "/home/gembira/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 1>
      main_globals = {'__name__': '__main__', '__doc__': None, '__package__': 'frappe.utils', '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7f74cbad0f10>, '__spec__': ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f74cbad0f10>, origin='/home/gembira/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'), '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, '__file__': '/home/gembira/frappe-bench/apps/frappe/frappe/utils/bench_helper.py', '__cached__': '/home/gembira/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc', 'importlib': <module 'importlib' from '/usr/lib/python3.10/importlib/__init__.py'>, 'json': <module 'json' from '/usr/lib/python3.10/json/__init__.py'>, 'os': <module 'os' from '/usr/lib/python3.10/os.py'>, 'traceback': <module 'traceback' from '/usr/lib/python3.10/traceback.py'>, 'warnings': <module 'warnings' from '/usr/lib/python3.10/warnings.py'>, 'click':...
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
      code = <code object <module> at 0x7f74cabd3ec0, file "/home/gembira/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 1>
      run_globals = {'__name__': '__main__', '__doc__': None, '__package__': 'frappe.utils', '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7f74cbad0f10>, '__spec__': ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f74cbad0f10>, origin='/home/gembira/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'), '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, '__file__': '/home/gembira/frappe-bench/apps/frappe/frappe/utils/bench_helper.py', '__cached__': '/home/gembira/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc', 'importlib': <module 'importlib' from '/usr/lib/python3.10/importlib/__init__.py'>, 'json': <module 'json' from '/usr/lib/python3.10/json/__init__.py'>, 'os': <module 'os' from '/usr/lib/python3.10/os.py'>, 'traceback': <module 'traceback' from '/usr/lib/python3.10/traceback.py'>, 'warnings': <module 'warnings' from '/usr/lib/python3.10/warnings.py'>, 'click':...
      init_globals = None
      mod_name = '__main__'
      mod_spec = ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f74cbad0f10>, origin='/home/gembira/frappe-bench/apps/frappe/frappe/utils/bench_helper.py')
      pkg_name = 'frappe.utils'
      script_name = None
      loader = <_frozen_importlib_external.SourceFileLoader object at 0x7f74cbad0f10>
      fname = '/home/gembira/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'
      cached = '/home/gembira/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc'
  File "/home/gembira/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module>
    main()
      ...skipped... 25 vars
  File "/home/gembira/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name="bench")
      commands = {'frappe': <Group frappe>, 'get-frappe-commands': <Command get-frappe-commands>, 'get-frappe-help': <Command get-frappe-help>}
  File "/home/gembira/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
      self = <Group None>
      args = ()
      kwargs = {'prog_name': 'bench'}
  File "/home/gembira/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
      self = <Group None>
      args = ['frappe', '--site', 'erp.local', 'migrate']
      prog_name = 'bench'
      complete_var = None
      standalone_mode = True
      extra = {}
      ctx = <click.core.Context object at 0x7f74cabea440>
  File "/home/gembira/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
      _process_result = <function MultiCommand.invoke.<locals>._process_result at 0x7f74cabf8670>
      args = ['migrate']
      cmd_name = 'frappe'
      cmd = <Group frappe>
      sub_ctx = <click.core.Context object at 0x7f74cabea620>
      ctx = <click.core.Context object at 0x7f74cabea440>
      self = <Group None>
  File "/home/gembira/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
      _process_result = <function MultiCommand.invoke.<locals>._process_result at 0x7f74caa57490>
      args = []
      cmd_name = 'migrate'
      cmd = <Command migrate>
      sub_ctx = <click.core.Context object at 0x7f74caa5aa70>
      ctx = <click.core.Context object at 0x7f74cabea620>
      self = <Group frappe>
  File "/home/gembira/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
      self = <Command migrate>
      ctx = <click.core.Context object at 0x7f74caa5aa70>
  File "/home/gembira/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      self = <click.core.Context object at 0x7f74caa5aa70>
      callback = <function migrate at 0x7f74ca9ffac0>
      ctx = <click.core.Context object at 0x7f74caa5aa70>
  File "/home/gembira/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      f = <function migrate at 0x7f74ca9ff880>
  File "/home/gembira/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
      ctx = <click.core.Context object at 0x7f74caa5aa70>
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      profile = False
      f = <function migrate at 0x7f74ca9ff7f0>
  File "/home/gembira/frappe-bench/apps/frappe/frappe/commands/site.py", line 556, in migrate
    SiteMigration(
      context = {'sites': ['erp.local'], 'force': False, 'verbose': False, 'profile': False}
      skip_failing = False
      skip_search_index = False
      activate_by_import = <module 'traceback_with_variables.activate_by_import' from '/home/gembira/frappe-bench/env/lib/python3.10/site-packages/traceback_with_variables/activate_by_import.py'>
      SiteMigration = <class 'frappe.migrate.SiteMigration'>
      site = 'erp.local'
  File "/home/gembira/frappe-bench/apps/frappe/frappe/migrate.py", line 176, in run
    self.post_schema_updates()
      self = <frappe.migrate.SiteMigration object at 0x7f74caa5ad70>
      site = 'erp.local'
  File "/home/gembira/frappe-bench/apps/frappe/frappe/migrate.py", line 41, in wrapper
    ret = method(*args, **kwargs)
      args = (<frappe.migrate.SiteMigration object at 0x7f74caa5ad70>,)
      kwargs = {}
      method = <function SiteMigration.post_schema_updates at 0x7f74a99ccca0>
  File "/home/gembira/frappe-bench/apps/frappe/frappe/migrate.py", line 133, in post_schema_updates
    sync_fixtures()
      self = <frappe.migrate.SiteMigration object at 0x7f74caa5ad70>
  File "/home/gembira/frappe-bench/apps/frappe/frappe/utils/fixtures.py", line 21, in sync_fixtures
    import_fixtures(app)
      app = 'posawesome'
      apps = ['frappe', 'erpnext', 'posawesome']
  File "/home/gembira/frappe-bench/apps/frappe/frappe/utils/fixtures.py", line 40, in import_fixtures
    import_doc(file_path)
      app = 'posawesome'
      fixtures_path = '/home/gembira/frappe-bench/apps/posawesome/posawesome/fixtures'
      fixture_files = ['property_setter.json', 'custom_field.json']
      fname = 'custom_field.json'
      file_path = '/home/gembira/frappe-bench/apps/posawesome/posawesome/fixtures/custom_field.json'
  File "/home/gembira/frappe-bench/apps/frappe/frappe/core/doctype/data_import/data_import.py", line 216, in import_doc
    import_file_by_path(
      pre_process = None
      files = ['/home/gembira/frappe-bench/apps/posawesome/posawesome/fixtures/custom_field.json']
      f = '/home/gembira/frappe-bench/apps/posawesome/posawesome/fixtures/custom_field.json'
      path = '/home/gembira/frappe-bench/apps/posawesome/posawesome/fixtures/custom_field.json'
  File "/home/gembira/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 145, in import_file_by_path
    import_doc(
      path = '/home/gembira/frappe-bench/apps/posawesome/posawesome/fixtures/custom_field.json'
      force = True
      data_import = True
      pre_process = None
      ignore_version = None
      reset_permissions = True
      docs = [{'allow_in_quick_entry': 0, 'allow_on_submit': 0, 'bold': 0, 'collapsible': 0, 'collapsible_depends_on': None, 'columns': 0, 'default': None, 'depends_on': None, 'description': None, 'docstatus': 0, 'doctype': 'Custom Field', 'dt': 'Item Barcode', 'fetch_from': None, 'fetch_if_empty': 0, 'fieldname': 'posa_uom', 'fieldtype': 'Link', 'hidden': 0, 'hide_border': 0, 'hide_days': 0, 'hide_seconds': 0, 'ignore_user_permissions': 0, 'ignore_xss_filter': 0, 'in_global_search': 0, 'in_list_view': 1, 'in_preview': 0, 'in_standard_filter': 0, 'insert_after': 'barcode_type', 'is_system_generated': 0, 'is_virtual': 0, 'label': 'UOM', 'length': 0, 'mandatory_depends_on': None, 'modified': '2020-10-07 02:03:39.297065', 'module': None, 'name': 'Item Barcode-posa_uom', 'no_copy': 0, 'non_negative': 0, 'options': 'UOM', 'permlevel': 0, 'precision': '', 'print_hide': 0, 'print_hide_if_no_value': 0, 'print_width': None, 'read_only': 0, 'read_only_depends_on': None, 'report_hide': 0, 'reqd': 0, 'search_i...
      calculated_hash = '631a2039477eac8e9842cf3e084cf74a'
      doc = {'allow_in_quick_entry': 1, 'allow_on_submit': 0, 'bold': 0, 'collapsible': 0, 'collapsible_depends_on': None, 'columns': 0, 'default': None, 'depends_on': None, 'description': None, 'docstatus': 0, 'doctype': 'Custom Field', 'dt': 'Customer', 'fetch_from': None, 'fetch_if_empty': 0, 'fieldname': 'posa_referral_code', 'fieldtype': 'Data', 'hidden': 0, 'hide_border': 0, 'hide_days': 0, 'hide_seconds': 0, 'ignore_user_permissions': 0, 'ignore_xss_filter': 0, 'in_global_search': 0, 'in_list_view': 0, 'in_preview': 0, 'in_standard_filter': 0, 'insert_after': 'posa_referral_section', 'is_system_generated': 0, 'is_virtual': 0, 'label': 'Referral Code', 'length': 0, 'mandatory_depends_on': None, 'modified': '2021-07-29 22:42:57.772021', 'module': None, 'name': 'Customer-posa_referral_code', 'no_copy': 1, 'non_negative': 0, 'options': None, 'permlevel': 0, 'precision': '', 'print_hide': 0, 'print_hide_if_no_value': 0, 'print_width': None, 'read_only': 0, 'read_only_depends_on': None, 'report_h...
      db_modified_timestamp = datetime.datetime(2021, 7, 29, 22, 42, 57, 772021)
      is_db_timestamp_latest = True
      new_modified_timestamp = '2021-07-29 23:11:05.723688'
  File "/home/gembira/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 242, in import_doc
    doc.insert()
      docdict = {'allow_in_quick_entry': 1, 'allow_on_submit': 0, 'bold': 0, 'collapsible': 0, 'collapsible_depends_on': None, 'columns': 0, 'default': None, 'depends_on': None, 'description': None, 'docstatus': 0, 'doctype': 'Custom Field', 'dt': 'Customer', 'fetch_from': None, 'fetch_if_empty': 0, 'fieldname': 'posa_referral_code', 'fieldtype': 'Data', 'hidden': 0, 'hide_border': 0, 'hide_days': 0, 'hide_seconds': 0, 'ignore_user_permissions': 0, 'ignore_xss_filter': 0, 'in_global_search': 0, 'in_list_view': 0, 'in_preview': 0, 'in_standard_filter': 0, 'insert_after': 'posa_referral_section', 'is_system_generated': 0, 'is_virtual': 0, 'label': 'Referral Code', 'length': 0, 'mandatory_depends_on': None, 'modified': '2021-07-29 22:42:57.772021', 'module': None, 'name': 'Customer-posa_referral_code', 'no_copy': 1, 'non_negative': 0, 'options': None, 'permlevel': 0, 'precision': '', 'print_hide': 0, 'print_hide_if_no_value': 0, 'print_width': None, 'read_only': 0, 'read_only_depends_on': None, 'report_h...
      data_import = True
      pre_process = None
      ignore_version = None
      reset_permissions = True
      path = '/home/gembira/frappe-bench/apps/posawesome/posawesome/fixtures/custom_field.json'
      controller = <class 'frappe.custom.doctype.custom_field.custom_field.CustomField'>
      doc = <CustomField: Customer-posa_referral_code>
  File "/home/gembira/frappe-bench/apps/frappe/frappe/model/document.py", line 261, in insert
    self.run_before_save_methods()
      self = <CustomField: Customer-posa_referral_code>
      ignore_permissions = None
      ignore_links = None
      ignore_if_duplicate = False
      ignore_mandatory = None
      set_name = None
      set_child_names = True
  File "/home/gembira/frappe-bench/apps/frappe/frappe/model/document.py", line 1053, in run_before_save_methods
    self.run_method("validate")
      self = <CustomField: Customer-posa_referral_code>
  File "/home/gembira/frappe-bench/apps/frappe/frappe/model/document.py", line 917, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
      self = <CustomField: Customer-posa_referral_code>
      args = ()
      kwargs = {}
      fn = <function Document.run_method.<locals>.fn at 0x7f74a8c3d120>
      method = 'validate'
  File "/home/gembira/frappe-bench/apps/frappe/frappe/model/document.py", line 1279, in composer
    return composed(self, method, *args, **kwargs)
      self = <CustomField: Customer-posa_referral_code>
      args = ()
      kwargs = {}
      hooks = [<function apply at 0x7f74a7af75b0>]
      method = 'validate'
      doc_events = {'*': {'after_insert': ['frappe.event_streaming.doctype.event_update_log.event_update_log.notify_consumers'], 'on_update': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.core.doctype.activity_log.feed.update_feed', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.core.doctype.file.utils.attach_files_to_document', 'frappe.event_streaming.doctype.event_update_log.event_update_log.notify_consumers', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply', 'frappe.automation.doctype.assignment_rule.assignment_rule.update_due_date', 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type'], 'after_rename': ['frappe.desk.notifications.clear_doctype_notifications'], 'on_cancel': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.event_streaming.doctype.event_update_log.event_update_log.notify_co...
      handler = 'erpnext.support.doctype.service_level_agreement.service_level_agreement.apply'
      composed = <function Document.hook.<locals>.compose.<locals>.runner at 0x7f74a626cd30>
      compose = <function Document.hook.<locals>.compose at 0x7f74a626d360>
      f = <function Document.run_method.<locals>.fn at 0x7f74a8c3d120>
  File "/home/gembira/frappe-bench/apps/frappe/frappe/model/document.py", line 1261, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
      self = <CustomField: Customer-posa_referral_code>
      method = 'validate'
      args = ()
      kwargs = {}
      add_to_return_value = <function Document.hook.<locals>.add_to_return_value at 0x7f74a626c1f0>
      fn = <function Document.run_method.<locals>.fn at 0x7f74a8c3d120>
      hooks = (<function apply at 0x7f74a7af75b0>,)
  File "/home/gembira/frappe-bench/apps/frappe/frappe/model/document.py", line 914, in fn
    return method_object(*args, **kwargs)
      self = <CustomField: Customer-posa_referral_code>
      args = ()
      kwargs = {}
      method_object = <bound method CustomField.validate of <CustomField: Customer-posa_referral_code>>
      method = 'validate'
  File "/home/gembira/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 68, in validate
    frappe.throw(
      self = <CustomField: Customer-posa_referral_code>
      check_fieldname_conflicts = <function check_fieldname_conflicts at 0x7f74a8b6ba30>
      CustomizeForm = <class 'frappe.custom.doctype.customize_form.customize_form.CustomizeForm'>
      meta = <Meta: Customer>
      fieldnames = ['basic_info', 'naming_series', 'customer_code', 'salutation', 'customer_name', 'customer_type', 'customer_group', 'custom_created_date', 'custom_start_over', 'custom_expired_date', 'custom_count_day', 'column_break0', 'territory', 'gender', 'lead_name', 'posa_discount', 'opportunity_name', 'account_manager', 'image', 'defaults_tab', 'default_price_list', 'default_bank_account', 'column_break_14', 'default_currency', 'internal_customer_section', 'is_internal_customer', 'represents_company', 'column_break_70', 'companies', 'more_info', 'market_segment', 'industry', 'customer_pos_id', 'website', 'language', 'column_break_45', 'customer_details', 'dashboard_tab', 'contact_and_address_tab', 'address_contacts', 'address_html', 'column_break1', 'contact_html', 'posa_birthday', 'posa_referral_section', 'posa_referral_code', 'posa_referral_company', 'primary_address_and_contact_detail', 'customer_primary_contact', 'mobile_no', 'email_id', 'column_break_26', 'customer_primary_address', 'primary...
  File "/home/gembira/frappe-bench/apps/frappe/frappe/__init__.py", line 534, in throw
    msgprint(
      msg = 'A field with the name <strong>posa_referral_code</strong> already exists in Customer'
      exc = <class 'frappe.exceptions.ValidationError'>
      title = None
      is_minimizable = False
      wide = False
      as_list = False
  File "/home/gembira/frappe-bench/apps/frappe/frappe/__init__.py", line 502, in msgprint
    _raise_exception()
      title = None
      as_table = False
      as_list = False
      indicator = 'red'
      alert = False
      primary_action = None
      is_minimizable = False
      wide = False
      sys = <module 'sys' (built-in)>
      out = {'message': 'A field with the name <strong>posa_referral_code</strong> already exists in Customer', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1}
      _raise_exception = <function msgprint.<locals>._raise_exception at 0x7f74a626c790>
      _strip_html_tags = <functools._lru_cache_wrapper object at 0x7f74a6534eb0>
      msg = 'A field with the name posa_referral_code already exists in Customer'
      raise_exception = <class 'frappe.exceptions.ValidationError'>
      strip_html_tags = <function strip_html_tags at 0x7f74cabb7370>
      ...skipped... 1 vars
  File "/home/gembira/frappe-bench/apps/frappe/frappe/__init__.py", line 451, in _raise_exception
    raise raise_exception(msg)
      msg = 'A field with the name posa_referral_code already exists in Customer'
      raise_exception = <class 'frappe.exceptions.ValidationError'>
      ...skipped... 1 vars
frappe.exceptions.ValidationError: A field with the name posa_referral_code already exists in Customer

solved by myself… :smiley: