Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM Organization Importing from 8.2.5.4 to 9.0.3.7 failing

(1) ShareShare
ReportReport
Posted on by 12

CRM Organization Importing getting fail with Below error.Please help to resolve issue..

ystem.Exception: Error.ActionFailed Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction ---> Microsoft.Crm.CrmException: Error in Action: Bin\Microsoft.Crm.Setup.DiffBuilder.dll:Pass2 on attempt 3. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Crm.CrmException: Failed to process metadata description - Name: PrivilegeObjectTypeCode, ID: dda1ef28-e43d-4c8b-8934-19cdade41542 ---> System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.Crm.Metadata.MetadataContainer.AddPrivilegeObjectTypeCode(IPrivilegeObjectTypeCodeDescription privilegeOtc)
at Microsoft.Crm.Metadata.MetadataContainer.AddDescription(IMetadataDescription description, String name)
--- End of inner exception stack trace ---
at Microsoft.Crm.Metadata.MetadataContainer.AddDescription(IMetadataDescription description, String name)
at Microsoft.Crm.Metadata.NonSharableMetadataCacheLoader.LoadDescriptions(IMetadataContainer metadataContainer, Dictionary`2 descriptionsCollection)
at Microsoft.Crm.Metadata.NonSharableMetadataCacheLoader.LoadContainerData(IMetadataContainer metadataContainer, Dictionary`2 descriptionsCollection, List`1 privilegesCollection, List`1 deletedDataCollection)
at Microsoft.Crm.Metadata.NonSharableMetadataCacheLoader.LoadContainerData(LoadMasks masks, ISqlDataAccess crmSqlDataAccesser, IMetadataContainer metadataContainer, List`1 fillProperties, CounterList counter)
at Microsoft.Crm.Metadata.NonSharableMetadataCacheLoader.BuildMetadataContainerFromDatabaseInternal(LoadMasks masks, ISqlDataAccess crmSqlDataAccesser, CounterList counter, Boolean isInStagedContext, BuildTableFillPropertiesTemplate buildTableFillProperties)
at Microsoft.Crm.Metadata.NonSharableMetadataCacheLoader.BuildMetadataContainerFromDatabase(LoadMasks masks, ISqlDataAccess crmSqlDataAccesser, CounterList counter, Boolean isInStagedContext)
at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.<>c__DisplayClass38_0.<LoadMetadataContainerFromDatabase>b__0(ISqlDataAccess crmSqlDataAccesser)
at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadMetadataContainerFromDatabaseInternal(LoadMasks masks, CrmDbConnection connection, CrmTransaction transaction, CounterList counter, BuildMetadataContainerFromDatabaseTemplate buildMetadataContainerFromDatabase, Nullable`1 optionalVersionNumberToFilterResults)
at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadMetadataContainerFromDatabase(LoadMasks masks, CrmDbConnection connection, CrmTransaction transaction, CounterList counter, Nullable`1 optionalVersionNumberToFilterResults, Boolean isInStagedContext)
at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadCacheFromDatabaseInternal(LoadMasks masks, CrmDbConnection connection, CrmTransaction transaction, CounterList counter, Boolean isInStagedContext)
at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadCacheFromDatabase(LoadMasks masks, CrmDbConnection connection, CrmTransaction transaction, CounterList counter, Boolean isInStagedContext)
at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadCacheFromDatabase(LoadMasks masks, CounterList counter)
at Microsoft.Crm.Metadata.DynamicMetadataCacheFactory.LoadMetadataCache(LoadMethod method, CacheType type, LoadMasks masks, IOrganizationContext context)
at Microsoft.Crm.Setup.MetadataCacheLoadHelper.LoadCacheFromDatabase(CacheType existingMetadataCacheType, LoadMasks masks, String connectionString, Guid organizationId)
at Microsoft.Crm.Setup.DiffBuilder.Pass2Internal(String metadataLocation, String languageCode, Boolean recalculateDependencies, String targetVersion)
at Microsoft.Crm.Setup.DiffBuilder.Pass2(String metadataLocation, String languageCode, 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)
--- End of inner exception stack trace ---
at Microsoft.Crm.Setup.Shared.CrmAction.ExecuteActionHelper(CrmAction action, IDictionary parameters, Boolean undo)
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.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.Shared.Installer.<>c__DisplayClass83_0.<DoAction>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.Shared.Installer.<>c__DisplayClass67_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.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
at Microsoft.Crm.Tools.Admin.OrganizationDBUpdateInstaller.Execute()
at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Import(Guid organizationId, String organizationUniqueName, String organizationFriendlyName, String sqlServerName, String databaseName, Uri reportServerUrl, ICollection`1 users, MultipleTenancy multipleTenancy, Boolean patchOnImport, OrgDbUpdateMode orgDbUpdateMode)

*This post is locked for comments

  • Sven Vervynckt Profile Picture
    115 on at
    RE: CRM Organization Importing from 8.2.5.4 to 9.0.3.7 failing

    Executing the SQL solved the issue for our environment as well! Thanks for posting!

  • Sujith K S Profile Picture
    12 on at
    RE: CRM Organization Importing from 8.2.5.4 to 9.0.3.7 failing

    Dear All,

    Issue has been resolved 

    As advised bu MS we had to run Some Sql Quires to solve the issue.

    Thanks for Support from All

    Select * From [dbo].[PrivilegeObjectTypeCodes]

    Delete FROM [dbo].[PrivilegeObjectTypeCodes] where PrivilegeObjectTypeCode = 'dda1ef28-e43d-4c8b-8934-19cdade41542'

    ALTER TABLE dbo.ReportBase DROP CONSTRAINT [cndx_PrimaryKey_Report]


    IF OBJECT_ID('tempdb..#DropForeignKeysStatement') IS NOT NULL DROP TABLE #DropForeignKeysStatement

    SELECT DropStatement = 'ALTER TABLE [dbo].[' + st.name + '] DROP CONSTRAINT [' + sfk.name + ']'
    INTO #DropForeignKeysStatement
    FROM sys.foreign_keys sfk
    INNER JOIN sys.tables st ON sfk.parent_object_id = st.object_id
    AND sfk.schema_id = st.schema_id
    WHERE sfk.schema_id = schema_id('dbo')

    SELECT DropStatement FROM #DropForeignKeysStatement

    DECLARE dropStatementCursor CURSOR FOR
    (SELECT DropStatement FROM #DropForeignKeysStatement);

    OPEN dropStatementCursor;

    DECLARE @currentStatement NVARCHAR(max);

    FETCH NEXT FROM dropStatementCursor INTO @currentStatement;

    WHILE @@FETCH_STATUS = 0
    BEGIN
    EXEC sp_executesql @currentStatement;

    FETCH NEXT FROM dropStatementCursor INTO @currentStatement;
    END

    CLOSE dropStatementCursor;
    DEALLOCATE dropStatementCursor;

    IF OBJECT_ID('tempdb..#DropForeignKeysStatement') IS NOT NULL DROP TABLE #DropForeignKeysStatement

  • Kevin Grech Profile Picture
    380 on at
    RE: CRM Organization Importing from 8.2.5.4 to 9.0.3.7 failing

    We managed to import from 8.2.2.112. Make sure to refresh the database from the backup (The V9 deployment manager is not cleaning up after a failure) and also that all servers has enough resources (RAM especially).

  • Sujith K S Profile Picture
    12 on at
    RE: CRM Organization Importing from 8.2.5.4 to 9.0.3.7 failing

    Yes I have tried all combinations . Like 8.2.2.0112  to 9.0.3.7  ,8.2.3 to 9.0.3.7 ,8.2.4 to 9.0.3.7 8.2.5 to 9.0.3.7

  • Suggested answer
    pavanmanideep Profile Picture
    1,331 on at
    RE: CRM Organization Importing from 8.2.5.4 to 9.0.3.7 failing

    Have you tried installing the cumulative updates from below link..which is mentioned in the above blog post.. for fixing similar issue

    support.microsoft.com/.../microsoft-dynamics-365-onpremise-cumulative-updates

  • Sujith K S Profile Picture
    12 on at
    RE: CRM Organization Importing from 8.2.5.4 to 9.0.3.7 failing

    Hi,

    I already followed this thread and tried everything possible  Still not yet solved..

  • Suggested answer
    pavanmanideep Profile Picture
    1,331 on at
    RE: CRM Organization Importing from 8.2.5.4 to 9.0.3.7 failing

    Hi Sujith,

    Refer to the below blog post which will provide you more information related to this error and fix for the same...

    https://community.dynamics.com/crm/f/117/p/300597/915309

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans