none
'attribute_attributeid' is not a constraint. Could not drop constraint + Upgrading from CRM 2013 SP1 to 2015 RRS feed

  • Question

  • Hi Folks,

     I am upgrading CRM 2013 SP1 to 2015 version by using the Deployment Process.

    I have upgraded one <organization1>_MCRM successfully but the other <Organization2>_MSCRM failed.

    Error is below:

    14:53:19|   Info| Setting organization state.  New state = Failed
    14:53:20|  Error| Upgrade Organization with Id=dc876034-.....-......-b257227bcc87 failed with Exception:
    System.Exception: Error.ActionFailed Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction ---> System.Data.SqlClient.SqlException: 'attribute_attributeid' is not a constraint.
    Could not drop constraint. See previous errors.
       at System.Data.SqlClient.SqlConnection.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.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
       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 Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSqlCommands(String sql, IDbCommand cmd)
       at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout, Boolean disablePool)
       at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Shared.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Shared.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Shared.Installer.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationUpgrader.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
       at Microsoft.Crm.Tools.Admin.UpgradeOrganizationInstaller.Upgrade(IUpgradeOrganizationInfo upgradeInfo)
    14:53:20|   Info| Found the older table DBUpdateInstallInfo_V5, updating new table and deleting
    14:53:20|   Info| GetDBUpdateRevisionThresholdForServer(): Threshold = 7.0.0000.3543.

    Please help.

    Thanks,

    Thursday, December 19, 2019 8:06 PM

All replies

  • 1. Make a backup of the file MetadataDiffs.xml from “C:\Program Files\Microsoft Dynamics CRM\Setup\Serviceability\Latest\Actions_Org\Install”

    2. Open the file MetadataDiffs.xml from “C:\Program Files\Microsoft Dynamics CRM\Setup\Serviceability\Latest\Actions_Org\Install”

    3. Remove the entry about the index “cndx_BusinessDataLocalizedLabel” or “BusinessDataLocalizedLabel”. This is found at the very end of the file:

        <index Name="BusinessDataLocalizedLabel_FullText">

          <EntityId>4ba1569e-3c9c-4d9f-99ea-b61fb08d7f97</EntityId>
          <IsClustered>0</IsClustered>
          <IsUnique>0</IsUnique>
          <IndexType>9</IndexType>
          <IsPrimaryKey>0</IsPrimaryKey>
          <attributes>
            <attribute AttributeId="9117818e-67dc-4b97-84db-a02caabab2e6" IsSystemManaged="1" order="0" />
          </attributes>
        </index>

    4.Close Deployment Manager

    5. Start Deployment Manager

    6. Start the organization update from Deployment manager.

    7. Run the following query on the organization DB to manually recreate the index.

    IF EXISTS (SELECT * FROM sys.indexes WHERE name = 'cndx_BusinessDataLocalizedLabel' AND OBJECT_NAME(object_id) = 'BusinessDataLocalizedLabelBase') DROP INDEX [cndx_BusinessDataLocalizedLabel] ON [BusinessDataLocalizedLabelBase];

    IF NOT EXISTS (SELECT * FROM sys.indexes WHERE NAME = 'cndx_BusinessDataLocalizedLabel' AND OBJECT_NAME(object_id) = 'BusinessDataLocalizedLabelBase')

    BEGIN TRY

     CREATE UNIQUE CLUSTERED INDEX [cndx_BusinessDataLocalizedLabel] ON [BusinessDataLocalizedLabelBase]([ObjectId] ASC, [ObjectIdTypeCode] ASC, [ObjectColumnNumber] ASC, [LanguageId] ASC) WITH (FILLFACTOR = 80, MAXDOP = 4, SORT_IN_TEMPDB = ON, ONLINE = ON)

    END TRY

    BEGIN CATCH

     CREATE UNIQUE CLUSTERED INDEX [cndx_BusinessDataLocalizedLabel] ON [BusinessDataLocalizedLabelBase]([ObjectId] ASC, [ObjectIdTypeCode] ASC, [ObjectColumnNumber] ASC, [LanguageId] ASC) WITH (FILLFACTOR = 80, MAXDOP = 4, SORT_IN_TEMPDB = ON)

    END CATCH

    8. Restore the file MetadataDiffs.xml to its original state using the backup taken at step 1.

    And with this the CRM 2015 version will be 7.0.0.3543.

    Original source:

    http://www.vogelgesang-consulting.de/content/update-01-microsoft-dynamics-crm-2015


    Thanks, - Israel Pradeep, - Software Engineer & PMP & B.I - Entrepreneur. - I am glad I could help!!! - If this post answers your question, please click “Mark as Answer” on the post and “Mark as Helpful”. For More Information, please feel free to visit our website- http://xrmxtensibles.wordpress.com/

    Friday, December 20, 2019 7:42 PM