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/", line 302, in on_update
    raise e
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/", line 299, in on_update
    frappe.db.updatedb(, Meta(self))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/", line 309, in updatedb
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/", line 41, in sync
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/", line 100, in alter
    fieldname, self.table_name))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", 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/", line 423, in msgprint
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", 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"})

Thank You!

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