Can't restore new site with data of old site

I’m trying create new bench and site and restore data from old bench. But this error is showing while doing so.

 File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 302, in on_update
    raise e
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 299, in on_update
    frappe.db.updatedb(self.name, Meta(self))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 309, in updatedb
    db_table.sync()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/schema.py", line 41, in sync
    self.alter()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/schema.py", line 100, in alter
    fieldname, self.table_name))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 444, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 423, in msgprint
    _raise_exception()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 378, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.ValidationError: reference_doctype field cannot be set as unique in tabForm Tour, as there are non-unique existing values

can you list the procedure and commands you followed? And at what point the error is showing?

i just downloaded backup of old site and then tried restore database and also migrate database in new site.

Hi @Ramit_Panangat,

Please check my reply in the post:

Thank You!

actually we already tried that…still not working

maybe it helps you.

Another process like:

You should remove the unique checkbox on reference_doctype by going to:

bench --site {yoursite} console

In the ipython console:

ps = frappe.get_doc("Property Setter", {"field_name": "reference_doctype", "property": "unique"})
ps.delete()
frappe.db.commit()

Thank You!

use this and then restore,
bench --site sitename reinstall