An item with the same key has already been added Upgrade Error Umbraco 8 to Umbraco 9
Hi I need som help where I should starts looking
I'm trying to upgrade the Umbraco 8 to Umbraco 9.5.2 and I got this error when I'm trying to upgrade the DB
Can someone please advice me where to find this Item *An item with the same key has already been added. *
/Many Thanks Christina
System.ArgumentException: An item with the same key has already been added. Key: settings at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.ObjectModel.KeyedCollection2.AddKey(TKey key, TItem item) at System.Collections.ObjectModel.KeyedCollection2.InsertItem(Int32 index, TItem item) at Umbraco.Cms.Core.Models.PropertyGroupCollection.InsertItem(Int32 index, PropertyGroup item) at Umbraco.Cms.Core.Models.PropertyGroupCollection.Add(PropertyGroup item) at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeCommonRepository.MapGroupsAndProperties(IDictionary2 contentTypes) at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeCommonRepository.GetAllTypesInternal() at Umbraco.Extensions.AppCacheExtensions.<>cDisplayClass0_0`1.b0() at
After running this SQL query, how do I fix the issue?
This is what I got when running:
SELECT cct.[alias], [contentTypeId], cpt.[alias], count(cpt.[Alias]) FROM [cmsPropertyType] cpt JOIN [cmsContentType] cct on cpt.contentTypeId = cct.nodeid GROUP BY cct.[alias], [contentTypeId], cpt.[alias] HAVING COUNT(cpt.[alias]) > 1
An item with the same key has already been added Upgrade Error Umbraco 8 to Umbraco 9
Hi I need som help where I should starts looking I'm trying to upgrade the Umbraco 8 to Umbraco 9.5.2 and I got this error when I'm trying to upgrade the DB Can someone please advice me where to find this Item *An item with the same key has already been added. * /Many Thanks Christina
System.ArgumentException: An item with the same key has already been added. Key: settings at System.Collections.Generic.Dictionary
2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.ObjectModel.KeyedCollection
2.AddKey(TKey key, TItem item) at System.Collections.ObjectModel.KeyedCollection2.InsertItem(Int32 index, TItem item) at Umbraco.Cms.Core.Models.PropertyGroupCollection.InsertItem(Int32 index, PropertyGroup item) at Umbraco.Cms.Core.Models.PropertyGroupCollection.Add(PropertyGroup item) at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeCommonRepository.MapGroupsAndProperties(IDictionary
2 contentTypes) at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentTypeCommonRepository.GetAllTypesInternal() at Umbraco.Extensions.AppCacheExtensions.<>cDisplayClass0_0`1.b0() atHi Christina, which nersion of V8 are you moving from?
And did you have tabs and. /or groups organising your properties on your document types...
... The error message seems to indicate that a property group has already been added on a doc type with the same name as another...
... But that could be because of the reintroduction of tabs in V8...
So you might need to upgrade to latest V8... If not check for any groups or tabs on doc types with the same name...
Regards
Marc
Hi Marc Thanks a lot! It was tabs that caused the error
/Christina
If someone encountered the same problem, the SQL query to identify the culprit(s)
SELECT contenttypeNodeId, [text], COUNT() AS duplicate_count FROM [dbo].[cmsPropertyTypeGroup] GROUP BY contenttypeNodeId, [text] HAVING COUNT() > 1;
Maybe even better to replace [text] with alias
After running this SQL query, how do I fix the issue?
This is what I got when running:
SELECT cct.[alias], [contentTypeId], cpt.[alias], count(cpt.[Alias]) FROM [cmsPropertyType] cpt JOIN [cmsContentType] cct on cpt.contentTypeId = cct.nodeid GROUP BY cct.[alias], [contentTypeId], cpt.[alias] HAVING COUNT(cpt.[alias]) > 1
Is it says I have duplications?
If yes, how can I fix it ?
Thanks.
is working on a reply...