Search code examples
umbracoumbraco7

Umbraco upgrading from 7.4.3 to 7.6.1 Cannot insert duplicate key


Am trying to upgrade Umbraco from 7.4.3 to 7.6.1 and receiving the following error from the installer:

The database failed to upgrade. ERROR: The database configuration failed with the following message: Cannot insert duplicate key row in object 'dbo.umbracoNode' with unique index 'IX_umbracoNodeUniqueID'.

When I look in the umbracoNode table I can't find a row with the uniqueID shown in the error message.

Any else had this problem and found a way to fix it?

Many thanks

Edit: So tried disabling the IX_umbracoNodeUniqueID constraint and instead got the following error:

The database failed to upgrade. ERROR: The database configuration failed with the following message: There are no primary or candidate keys in the referenced table 'umbracoNode' that match the referencing column list in the foreign key 'FK_umbracoRedirectUrl'. Could not create constraint.

Any further ideas?

UPDATE:

I did eventually get this to work. I created fresh install of 7.6.5 (Umbraco had moved on since I started this post) and then imported the "umbracoRedirectUrl" table into my original database from the clean install. That coupled with disabling the IX_umbracoNodeUniqueID index in the "UmbracoNode" table allowed the installation to complete. Once the install completed I tried to turn the index back on, which provided me with a more useful error message so I was able to track the node with duplicate uniqueIDs and manually delete. They appeared to related to a previous bug. Once I had removed them I was able to reactivate the IX_umbracoNodeUniqueID index.

Hope this is helpful to someone else.


Solution

  • Drop the index 'IX_umbracoNodeUniqueID'. I had the same issue and comparing my db to other Umbraco 7 dbs, this doesn't appear to be mandatory.

    After I did this I got a separate error regarding a default scheme being missing, this was due to my DB user being set up wrong. If you do get this though, just change the default scheme of your user to 'dbo'.