Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

On Premise V9 Upgrade - Import Organization Fails with Exception: The constraint 'PK_topicmodelBase' is being referenced by table 'TopicModelExecutionHistoryBase', foreign key constraint 'topicmodel_topicmodelexecutionhistory'

  • 1.  On Premise V9 Upgrade - Import Organization Fails with Exception: The constraint 'PK_topicmodelBase' is being referenced by table 'TopicModelExecutionHistoryBase', foreign key constraint 'topicmodel_topicmodelexecutionhistory'

    Posted Oct 23, 2019 07:23 PM
    Importing an organization from a version 8.2.1.176 on-premises deployment into a version 9.0.8.9 on-premises deployment fails with the exception below, but only in multi server environment. That is, a backup of the same organization database from a few days prior was successfully imported into a single server version 9.0.8.9 on-premises deployment.

    Based on posts on Dynamics 365 Community, I noticed that there are orphaned fulltext indexes without a corresponding fulltext catalog record - on these tables DocumentIndex, BusinessDataLocalizedLabelBase, and MultiSelectAttributeOptionValuesBase.
    Also, the suggestion was made to upgrade the existing version 8 deployment before importing orgs into a version 9 environment. We would like to avoid if possible, especially since there's no guarantee of that working and it's relatively high risk.

    Any help would be greatly appreciated.

    Source deployment/organization: Multi-server deployment + SQL Loaded Balanced, no custom plugins or web resources; Version 1612 (8.2.1.176) (DB 8.2.1.176) on-premises
    Target deployment/organization: Multi-server deployment + SQL Loaded Balanced; Version 1612 (9.0.8.9) (DB 9.0.8.9) on-premises

    Relevant Log entries:
    08:42:23| Info| Executing: action Bin\Microsoft.Crm.Setup.DiffBuilder.dll:UpgradeSystemAndMetadataDiffIndexManagementDataWithDelete with id 343934bb-b5c9-4d63-ba3c-21fb63b0eae0 of type DllMethod to Diff indexes with delete for upgrade.
    08:42:23| Info| Diff indexes with delete for upgrade
    08:42:27| Info| Deleting standard index Name='PK_topicmodelBase'
    08:42:27| Info| Action Bin\Microsoft.Crm.Setup.DiffBuilder.dll:UpgradeSystemAndMetadataDiffIndexManagementDataWithDelete with id 343934bb-b5c9-4d63-ba3c-21fb63b0eae0 of type DllMethod to Diff indexes with delete for upgrade failed on attempt 2. Retrying in 30 seconds. Exception: Exception has been thrown by the target of an invocation.
    08:43:00| Info| Deleting standard index Name='PK_topicmodelBase'
    08:43:00| Info| Action Bin\Microsoft.Crm.Setup.DiffBuilder.dll:UpgradeSystemAndMetadataDiffIndexManagementDataWithDelete with id 343934bb-b5c9-4d63-ba3c-21fb63b0eae0 of type DllMethod to Diff indexes with delete for upgrade failed on attempt 3. Retrying in 30 seconds. Exception: Exception has been thrown by the target of an invocation.
    08:43:33| Info| Deleting standard index Name='PK_topicmodelBase'
    08:43:33| Error| Applying database updates to organization with name = MFAILUREDB Id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX failed with Exception:
    Microsoft.Crm.CrmException: Error in Action: Bin\Microsoft.Crm.Setup.DiffBuilder.dll:UpgradeSystemAndMetadataDiffIndexManagementDataWithDelete on attempt 3. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: The constraint 'PK_topicmodelBase' is being referenced by table 'TopicModelExecutionHistoryBase', foreign key constraint 'topicmodel_topicmodelexecutionhistory'.
    Could not drop constraint.

    ------------------------------
    CRM Dev
    Birmingham
    ------------------------------
    Academy - Online Interactive Learning from Experts


  • 2.  RE: On Premise V9 Upgrade - Import Organization Fails with Exception: The constraint 'PK_topicmodelBase' is being referenced by table 'TopicModelExecutionHistoryBase', foreign key constraint 'topicmodel_topicmodelexecutionhistory'

    Posted Feb 04, 2020 01:42 PM
    Hello, I am getting the same error, were you able to get this imported or did you have to upgrade?

    ------------------------------
    Stephen Wilkins
    Centra Windows
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 3.  RE: On Premise V9 Upgrade - Import Organization Fails with Exception: The constraint 'PK_topicmodelBase' is being referenced by table 'TopicModelExecutionHistoryBase', foreign key constraint 'topicmodel_topicmodelexecutionhistory'

    Posted Feb 04, 2020 05:56 PM
    Make sure the TARGET environment has the latest crm service updates. Also, if you are in a SQL load balanced environment, make sure you use the primary node name for the SQL Server - NOT the Listener Name - in the Import wizard, e.g.,  mycrmorgcn1\inst1 NOT mycrmorgag

    ------------------------------
    Gregory Hyche
    Protective Life Corporation
    Birmingham
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 4.  RE: On Premise V9 Upgrade - Import Organization Fails with Exception: The constraint 'PK_topicmodelBase' is being referenced by table 'TopicModelExecutionHistoryBase', foreign key constraint 'topicmodel_topicmodelexecutionhistory'

    Posted Feb 04, 2020 06:05 PM
    Thanks I will ensure of that, I have just updated our test network to 8.2.8 and will make sure the v9 is up to date as well.

    ------------------------------
    Stephen Wilkins
    Centra Windows
    LANGLEY BC
    ------------------------------

    Academy - Online Interactive Learning from Experts


If you've found this thread useful, dive deeper into User Group community content by role