Try our conversational search powered by Generative AI!

[12.5 (Migration)] Duplicate Key Row Error During Migration of Published Catalog Content



I am upgrading a Commerce 8 site to v 12.5 and I am currently trying to make it through the migration steps but have run into an error with the 'Migrates published Catalog Content' step.

The error that is being displayed is -

Migrates published Catalog Content has failed with exception 'System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.CatalogContentProperty' with unique index 'IDX_CatalogContentProperty_ContentID'. The duplicate key value is (61037, 0, en, 1114).

The statement has been terminated.

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Mediachase.Data.Provider.SqlDataProvider.<>c__DisplayClass22_0.b__0() at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method) at Mediachase.Data.Provider.SqlDataProvider.WithRetry[TResult](Func`1 action) at Mediachase.Data.Provider.SqlDataProvider.ExecuteNonExec(DataCommand command) at Mediachase.MetaDataPlus.Common.DBHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, Int32 commandTimeout, DataParameter[] commandParameters) at EPiServer.Commerce.Internal.Migration.Steps.MigratePublishedContentStep.MigratePropertyData(DataTable propertyData, DataTable contentExData, String tableName, DataTable idsToDelete) at EPiServer.Commerce.Internal.Migration.Steps.MigratePublishedContentStep.MigrateCatalogContent(MetaClass metaClass, IList`1 languages) at EPiServer.Commerce.Internal.Migration.Steps.MigratePublishedContentStep.Execute(IProgressMessenger progressMessenger) ClientConnectionId:e627f05c-80c6-4feb-b65b-212ef3bb759a Error Number:2601,State:1,Class:14'.

Matching records: (alt: )

I have checked the data it specifies but there is only a single matching record, this would imply that it is trying to insert a copy of what is already in there...? I'm not really sure where to go from here since the migration jobs aren't my logic I don't know how to 'fix' them and since it seems that the data is required to run, I'm not sure deleting that or messing about with it too much is the way to go...

Has anybody been through similar? Is there some kind of DB operation I need to perform or enable prior to running, i.e. removing a key or some kind of restriction?

Any help would be greatly appreciated.



Edited, Aug 29, 2018 15:42

Could not see your picture - would suggest to use imgur instead.

Aug 30, 2018 8:30

Worked fine for me but have added another source. Imgur isn't letting me upload atm for some reason.

Aug 30, 2018 10:11

So it's one of your custom metafields. I can't really say anything for sure now, but you can contact developer support service. When we are able to look into you data(base) we will have more thing to say 

Aug 31, 2018 10:13

Ok, thanks QM.

Aug 31, 2018 10:15
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.