Overview
Importing all structure elements to empty vault might fail with PRIMARY KEY constraint 'PK_ITEMTX' error. Following kind of error is seen in M-Files Admin:
The package may have been partly imported before the process was stopped.
Import of the object "196-3 ({7FD3F76E-569C-436B-B998-58BD586F8741})" from a content package failed.
The statement has been terminated. (ERROR: 3621, SQLSTATE: 01000)
Violation of PRIMARY KEY constraint 'PK_ITEMT165'. Cannot insert duplicate key in object 'dbo.ITEMT165'. The duplicate key value is (1). (ERROR: 2627, SQLSTATE: 23000)
Solution
This is related to known issue, ADI-283. When it is fixed, it can be found from our release notes.
There is workaround available, needed steps to get structure import to work:
1. Source vault: export first only the value lists + select 'Export contents of the selected value lists'.
2. Import package created in step 1 to target vault.
3. Source vault: create new replication package and now export all the structure elements.
4. Import package created in step 3 to target vault.
