Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Getting issue while Upgrading Organization on-premise from v8.2.4 to Dynamics 365 v9.0 with InstallDatabaseUpdatesAction failed

Posted on by Microsoft Employee

While Importing Organization on-premise from v8.2.4 to Dynamics 365 v9.0 we are getting below error 

11:55:39| Info| Executing: action SetDefaultForExternalPartyOrgSettings.sql with id 5eaada5c-45ef-4162-8d81-6053653f69c4 of type SqlScript to Update ExternalPartyEnabled organization settings to default XML string...
11:55:39| Info| Executing: action Microsoft.Crm.SE.DatabaseActions.dll:DisableCacheSharing with id 00000000-0000-0000-0000-0000000000ff of type DllMethod to Disable shared caching.
11:55:39| Info| Disable shared caching
11:55:39|Verbose| DatabaseAction execution time; Microsoft.Crm.SE.DatabaseActions.dll:DisableCacheSharing; 00:00:00.0210022
11:55:39| Info| Executing: action Bin\Microsoft.Crm.Setup.DiffBuilder.dll:Pass2 with id 656d7036-6ca0-4280-828f-3e7e9b08834b of type DllMethod to Metadata xml upgrade: pass 2.
11:55:39| Info| Executing: action Bin\Microsoft.Crm.Setup.DiffBuilder.dll:RegenerateAllViews with id c013f4df-104a-4f51-8eb5-524b2ff7fea5 of type DllMethod to Upgrading the views in the MSCRM database.
11:55:39| Info| Executing: action Bin\Microsoft.Crm.Setup.DiffBuilder.dll:FlushCaches with id b0f23885-3053-4a98-af66-2a9eb6c26f68 of type DllMethod to Reset metadata cache.
11:55:39| Info| Executing: action PreProcessSdkMessageProcessingStepsForArcSlaPlugins.sql with id 436968d0-8edc-4fde-9c30-8e9c40bf0eb4 of type SqlScript to Updates ARC,SLA related plugin records created by customers with values for SolutionId and customizationLevel attributes as system solutionId and 0 respectively.
11:55:39| Info| Executing: action Bin\Microsoft.Crm.SE.DatabaseActions.dll:Execute with id 24685d9f-0fa2-4543-a56a-cd47538dc133 of type DllMethod to Delete old SDK messages from system..
11:55:39| Info| Executing: action PostProcessSdkMessageProcessingStepsForArcSlaPlugins.sql with id bbd5fd4d-cea7-46f8-b1cb-e0487b183c3a of type SqlScript to Updates ARC,SLA related plugin records created by customers with default values for SolutionId and customizationLevel attributes.
11:55:39| Info| Executing: action Bin\Microsoft.Crm.SE.DatabaseActions.dll:Execute with id c0860c9d-3d58-46a9-9bf9-03ccaeccdb7d of type DllMethod to Delete old Ribbon components from system..
11:55:39| 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.
11:55:39| Info| Diff indexes with delete for upgrade
11:55:49| Info| Deleting standard index Name='cndx_PrimaryKey_Lead'
11:55:49| 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.
11:56:28| Info| Deleting standard index Name='cndx_PrimaryKey_Lead'
11:56:28| 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.
11:57:11| Info| Deleting standard index Name='cndx_PrimaryKey_Lead'
11:57:11| Error| Applying database updates to organization with name = SAIBD365 Id=b1ade3b7-e065-e111-be6d-000c29b368c6 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 'cndx_PrimaryKey_Lead' is being referenced by table 'IncidentBase', foreign key constraint 'vrp_lead_incident_Lead'.
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.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
at Microsoft.Crm.CrmDbConnection.<>c__DisplayClass106_0.<InternalExecuteNonQuery>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)
at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.ExecuteDropIndexOrConstraintInSqlIfExists(DropIndexData dropData, IDbCommand command, ISqlExecutionContext sqlContext)
at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.DropIndexOrConstraintInSqlIfExistsInternal(DropIndexData dropData, ISqlExecutionContext sqlContext)
at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.DropIndexesFromSQLByIndexIds(List`1 indexIds, ISqlExecutionContext sqlContext)
at Microsoft.Crm.Metadata.SqlStandardIndexHandler.DeleteIndexes(IIndexDiffManager indexDiffManager, ISqlExecutionContext sqlContext)
at Microsoft.Crm.Metadata.SqlStandardIndexHandler.ProcessIndexDiffManagerData(IIndexDiffManager indexDiffManager, IIndexMetadataProvider metadataProvider, ISqlExecutionContext sqlContext, Boolean processDeletes)
at Microsoft.Crm.Setup.IndexAndConstraintUpgradeService.UpgradeIndexManagementData(String metadataXmlPath, Boolean processDeletes, Boolean systemIndexesOnly, Boolean useMetadataDiffs)
at Microsoft.Crm.Setup.IndexAndConstraintUpgradeService.UpgradeSystemAndMetadataDiffIndexManagementDataWithDelete(String metadataXmlPath, String targetVersion)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at Microsoft.Crm.Setup.Database.DllMethodAction.Execute(Guid organizationId, Nullable`1 operationType)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass85_1.<ExecuteReleases>b__0()
at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass85_1.<ExecuteReleases>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.installInternal(Boolean isInstall, Int32 languageCode)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass92_0.<Install>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass94_0.<InstallUpdate>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Setup.Common.Update.DBUpdateDatabaseInstaller.ApplyDBUpdates(Guid orgId, Nullable`1 operationType, Int32 langCode, String releaseFilePath)
at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.ApplyDBUpdatesInternal(Guid orgId, String orgUniqueName, String releaseFilePath, OrganizationOperationType operationType, Boolean isXrm, Int32 langCode)
11:57:11| Info| CrmAction execution time; InstallDatabaseUpdatesAction; 00:01:32.9450758
11:57:11| Error| Installer Complete: OrganizationDBUpdateInstaller - Error encountered
11:57:11| Error| Exception occurred during Microsoft.Crm.Tools.Admin.OrganizationDBUpdateInstaller: Error.ActionFailed Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction
InnerException:
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 'cndx_PrimaryKey_Lead' is being referenced by table 'IncidentBase', foreign key constraint 'vrp_lead_incident_Lead'.
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.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
at Microsoft.Crm.CrmDbConnection.<>c__DisplayClass106_0.<InternalExecuteNonQuery>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)
at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.ExecuteDropIndexOrConstraintInSqlIfExists(DropIndexData dropData, IDbCommand command, ISqlExecutionContext sqlContext)
at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.DropIndexOrConstraintInSqlIfExistsInternal(DropIndexData dropData, ISqlExecutionContext sqlContext)
at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.DropIndexesFromSQLByIndexIds(List`1 indexIds, ISqlExecutionContext sqlContext)
at Microsoft.Crm.Metadata.SqlStandardIndexHandler.DeleteIndexes(IIndexDiffManager indexDiffManager, ISqlExecutionContext sqlContext)
at Microsoft.Crm.Metadata.SqlStandardIndexHandler.ProcessIndexDiffManagerData(IIndexDiffManager indexDiffManager, IIndexMetadataProvider metadataProvider, ISqlExecutionContext sqlContext, Boolean processDeletes)
at Microsoft.Crm.Setup.IndexAndConstraintUpgradeService.UpgradeIndexManagementData(String metadataXmlPath, Boolean processDeletes, Boolean systemIndexesOnly, Boolean useMetadataDiffs)
at Microsoft.Crm.Setup.IndexAndConstraintUpgradeService.UpgradeSystemAndMetadataDiffIndexManagementDataWithDelete(String metadataXmlPath, String targetVersion)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at Microsoft.Crm.Setup.Database.DllMethodAction.Execute(Guid organizationId, Nullable`1 operationType)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass85_1.<ExecuteReleases>b__0()
at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass85_1.<ExecuteReleases>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.installInternal(Boolean isInstall, Int32 languageCode)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass92_0.<Install>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.<>c__DisplayClass94_0.<InstallUpdate>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Setup.Common.Update.DBUpdateDatabaseInstaller.ApplyDBUpdates(Guid orgId, Nullable`1 operationType, Int32 langCode, String releaseFilePath)
at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.ApplyDBUpdatesInternal(Guid orgId, String orgUniqueName, String releaseFilePath, OrganizationOperationType operationType, Boolean isXrm, Int32 langCode)
at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.ApplyDBUpdates(Guid orgId, String orgUniqueName, OrganizationOperationType operationType, Boolean isXrm, Int32 langCode)
at Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction.Do(IDictionary parameters)
at Microsoft.Crm.Setup.Shared.CrmAction.ExecuteActionHelper(CrmAction action, IDictionary parameters, Boolean undo)

*This post is locked for comments

  • Suggested answer
    Flydancer Profile Picture
    Flydancer 1,332 on at
    RE: Getting issue while Upgrading Organization on-premise from v8.2.4 to Dynamics 365 v9.0 with InstallDatabaseUpdatesAction failed

    Try Updating your instance to 8.2.8.15 first, then to v9

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Getting issue while Upgrading Organization on-premise from v8.2.4 to Dynamics 365 v9.0 with InstallDatabaseUpdatesAction failed

    Hi Maarten,

    Thanks for replying...

    Actually I am importing organization from v8.2.4 to Dynamics 365 v9.0 using deployment manager that time I am getting error whose log file I pasted above. I know I have to remove foreign keys manually from IncidentBase table but do I need to remove Primary key also from LeadBase table?

    Kindly let me know.

  • Maarten_W Profile Picture
    Maarten_W 10 on at
    RE: Getting issue while Upgrading Organization on-premise from v8.2.4 to Dynamics 365 v9.0 with InstallDatabaseUpdatesAction failed

    Hi Sahbbu,

    Are you using the SQL Full-text search option?

    Also, have a look at the index "index Name='cndx_PrimaryKey_Lead". It may help to remove that manually in the DB and run the setup again.

    kr

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans