Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Apr 19, 2018 @ 13:18
    Ismail Mayat
    0

    Hello,

    I am trying to upgrade umbraco from 7.5.10 to 7.10.3 however when running the installer i get the following error:

    The database failed to upgrade. ERROR: The database configuration failed with the following message: Violation of PRIMARY KEY constraint 'PKcmsMedia'. Cannot insert duplicate key in object 'dbo.cmsMedia'. The duplicate key value is (7bc53727-90b9-4244-a18f-07c661f3b220). The statement has been terminated. Please check log file for additional information (can be found in '/AppData/Logs/UmbracoTraceLog.txt')

    Anyone seen this before?

    Regards

    Ismail

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Apr 19, 2018 @ 15:56
    Ismail Mayat
    0

    I have manged to get up to 7.7.13 i cannot get up to next release 7.8.0 still keep getting this same error.

    Anyone any ideas?

    Regards

    Ismail

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Apr 19, 2018 @ 17:02
    Ismail Mayat
    0

    Right fixed. So I found the sql that the migration runs which was giving me error. I updated it and passed in the guid that was causing primary key error so my sql looks like

    declare @alias varchar(30) = 'umbracoFile' declare @nodeObjectType uniqueidentifier = N'B796F64C-1F99-4FFB-B886-4BF4BC011A9C'

    SELECT cmsPropertyData.dataNvarchar, cmsPropertyData.dataNtext, umbracoNode.id, cmsContentVersion.VersionId FROM cmsPropertyData INNER JOIN cmsPropertyType ON cmsPropertyType.id = cmsPropertyData.propertytypeid INNER JOIN umbracoNode ON umbracoNode.id = cmsPropertyData.contentNodeId INNER JOIN cmsContentVersion ON cmsContentVersion.ContentId = umbracoNode.id WHERE cmsPropertyType.Alias = (@alias) AND umbracoNode.id IN (SELECT umbracoNode.id FROM umbracoNode INNER JOIN cmsContent ON cmsContent.nodeId = umbracoNode.id INNER JOIN cmsContentType ON cmsContentType.nodeId = cmsContent.contentType INNER JOIN cmsPropertyType ON cmsPropertyType.contentTypeId = cmsContentType.nodeId WHERE cmsPropertyType.Alias = (@alias) AND umbracoNode.nodeObjectType = (@nodeObjectType)) AND (cmsPropertyData.dataNvarchar IS NOT NULL OR cmsPropertyData.dataNtext IS NOT NULL) AND cmsContentVersion.VersionId='6ff5d8cb-02ee-4cbf-8d1f-0d979eeb1e5e'

    That gave me some duplicates. They should be unqiue. Anyhow did some digging in cmsPropertyData table and removed older duplicates and then re ran upgrader and it worked.

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft