locked
Deploy CRM 4.0 Database to CRM 2011 using Deployment Manager RRS feed

  • Question

  • Hi,

    I to migrate CRM 4.0 data to CRM 2011.

    For that i want to deploy the CRM 4.0 database on CRM 2011 using deloyment manager.

    While Deploying i get the following warnings

    1.The primary keys in the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM primary keys.
    2.The foreign key constraints in the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM foreign key constraints.
    3.The full-text indexes on the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM full-text indexes.
    4.The indexes on the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM indexes.
    5.The stored procedures in the database are not consistent with Microsoft Dynamics CRM stored procedures.

    Can anyone suggest me the solution


    Regards,

    Kishan.

    Monday, August 22, 2011 6:06 AM

Answers

  • There are some preparation steps that you should consider taking before attempting an upgrade to CRM 2011.  Those steps include removing any unsupported customization to the CRM 4 server, remove plugins, clean up your async table, ensure there are no records in a 'delete' state, etc.  Here is a reference for that prep work and the upgrade process.

    http://blog.sonomapartners.com/2011/04/upgrading-to-crm-2011-our-story.html

    http://www.crmsoftwareblog.com/2011/03/preparing-for-crm-2011-how-to-make-your-microsoft-dynamics-crm-2011-upgrade-faster/

    These three items point to issues with the CRM 4 database that need to be addressed

    3.The full-text indexes on the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM full-text indexes.
    4.The indexes on the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM indexes.
    5.The stored procedures in the database are not consistent with Microsoft Dynamics CRM stored procedures.

    As Jamie mentioned, I suspect some unsupported customization to CRM 4, data issues in the sql database or some other customization that needs to be addressed before attempting the upgrade.  You can tap dance around this and hope that you can get things working but the possibility is high that at some point in time you will experience unexpected and 'odd' issues


    Regards, Donna


    Saturday, September 3, 2011 7:30 PM

All replies

  • I have restored the database again and imported organization using deployment manager

    I get the warning

    Fragmented indexes were detected in the Microsoft Dynamics CRM database

    I continued the import process and the operation failed with exception

    InnerException:
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.AsyncOperationBase' and the index name 'ndx_Cover_AsyncOperation'. The duplicate key value is (3, 11705, <NULL>, <NULL>).
    The statement has been terminated.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateIndexOrConstraintInSqlInternal(IndexData indexData, Boolean isForPrimaryTable, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateOrRecreateIndexOrConstraintInternal(IndexData fullDataOfIndexToRegenerate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RestoreNonClusteredIndexes(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RecreateIndexesInternal(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Setup.IndexAndConstraintUpgradeService.RestoreIndexesAndConstraints()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       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()
       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.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
    InnerException:
    System.Data.SqlClient.SqlException (0x80131904): The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.AsyncOperationBase' and the index name 'ndx_Cover_AsyncOperation'. The duplicate key value is (3, 11705, <NULL>, <NULL>).
    The statement has been terminated.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateIndexOrConstraintInSqlInternal(IndexData indexData, Boolean isForPrimaryTable, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateOrRecreateIndexOrConstraintInternal(IndexData fullDataOfIndexToRegenerate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RestoreNonClusteredIndexes(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RecreateIndexesInternal(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Setup.IndexAndConstraintUpgradeService.RestoreIndexesAndConstraints()

    13:22:24|   Info| Setting organization state.  New state = Failed
    13:22:24|  Error| Upgrade Organization with Id=1036c33b-2093-e011-bc22-0003ffee7699 failed with Exception:
    System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.AsyncOperationBase' and the index name 'ndx_Cover_AsyncOperation'. The duplicate key value is (3, 11705, <NULL>, <NULL>).
    The statement has been terminated.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateIndexOrConstraintInSqlInternal(IndexData indexData, Boolean isForPrimaryTable, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateOrRecreateIndexOrConstraintInternal(IndexData fullDataOfIndexToRegenerate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RestoreNonClusteredIndexes(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RecreateIndexesInternal(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Setup.IndexAndConstraintUpgradeService.RestoreIndexesAndConstraints()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       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()
       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.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.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.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
    13:22:25|  Error| An error occurred when trying import and upgrade organization database b2bsrv-66-hv.ChoiceSolutions_MSCRM:
    Microsoft.Crm.CrmException: Upgrade Organization with Id=1036c33b-2093-e011-bc22-0003ffee7699 failed with Exception:
    System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.AsyncOperationBase' and the index name 'ndx_Cover_AsyncOperation'. The duplicate key value is (3, 11705, <NULL>, <NULL>).
    The statement has been terminated.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateIndexOrConstraintInSqlInternal(IndexData indexData, Boolean isForPrimaryTable, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateOrRecreateIndexOrConstraintInternal(IndexData fullDataOfIndexToRegenerate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RestoreNonClusteredIndexes(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RecreateIndexesInternal(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Setup.IndexAndConstraintUpgradeService.RestoreIndexesAndConstraints()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       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()
       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.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.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.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo) ---> System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.AsyncOperationBase' and the index name 'ndx_Cover_AsyncOperation'. The duplicate key value is (3, 11705, <NULL>, <NULL>).
    The statement has been terminated.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateIndexOrConstraintInSqlInternal(IndexData indexData, Boolean isForPrimaryTable, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateOrRecreateIndexOrConstraintInternal(IndexData fullDataOfIndexToRegenerate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RestoreNonClusteredIndexes(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RecreateIndexesInternal(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Setup.IndexAndConstraintUpgradeService.RestoreIndexesAndConstraints()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       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()
       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.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.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.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
    13:22:26|  Error| Import Organization (Name=ChoiceSolutions, Id=1036c33b-2093-e011-bc22-0003ffee7699) failed with Exception:
    Microsoft.Crm.CrmException: Upgrade Organization with Id=1036c33b-2093-e011-bc22-0003ffee7699 failed with Exception:
    System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.AsyncOperationBase' and the index name 'ndx_Cover_AsyncOperation'. The duplicate key value is (3, 11705, <NULL>, <NULL>).
    The statement has been terminated.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateIndexOrConstraintInSqlInternal(IndexData indexData, Boolean isForPrimaryTable, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateOrRecreateIndexOrConstraintInternal(IndexData fullDataOfIndexToRegenerate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RestoreNonClusteredIndexes(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RecreateIndexesInternal(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Setup.IndexAndConstraintUpgradeService.RestoreIndexesAndConstraints()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       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()
       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.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.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.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo) ---> System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.AsyncOperationBase' and the index name 'ndx_Cover_AsyncOperation'. The duplicate key value is (3, 11705, <NULL>, <NULL>).
    The statement has been terminated.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateIndexOrConstraintInSqlInternal(IndexData indexData, Boolean isForPrimaryTable, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.CreateOrRecreateIndexOrConstraintInternal(IndexData fullDataOfIndexToRegenerate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RestoreNonClusteredIndexes(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Metadata.IndexAndConstraintManagementService.RecreateIndexesInternal(Dictionary`2 indexesToRecreate, IIndexMetadataProvider metadata, ISqlExecutionContext sqlContext)
       at Microsoft.Crm.Setup.IndexAndConstraintUpgradeService.RestoreIndexesAndConstraints()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       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()
       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.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.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.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Execute(Object obj)
    13:22:28|   Info| GetDBUpdateRevisionThresholdForServer(): Threshold = 583.

    Monday, August 22, 2011 8:49 AM
  • Did you modify your CRM 4.0 organization database manually?  It appears that the upgrade process is looking for a specific schema that it cannot find.  If so,  this is one of the biggest dangers of unsupported customizations like modifying the database schema manually.  

    Again, if there were manual changes, You can talk to Microsoft Support and see if they are willing to provide best effort support for the implementation at 877-276-2464.

    Unfortunately, the answer you might get is that you are going to have to create a fresh org and use a tool like to migrate your data.



    Jamie Miley
    Check out my about.me profile!
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Monday, August 22, 2011 10:58 AM
    Moderator
  • I have not touched the database manually.

    what i have done is just took backup from crm 4.0 server and restrored on crm 2011 server and tried to import the organization on crm 2011 server using deployment manager.

    Monday, August 22, 2011 11:25 AM
  • Hi KishanRaj,

    Please follow these steps for Upgrading CRM 4.0 to CRM 2011

     

    1.       http://support.microsoft.com/kb/968520(delete asynchronous records from DataBase)

     

    2.       Complete the CRM installation

     

    3.       Install the update rollup 12 on the CRM server : http://www.microsoft.com/downloads/details.aspx?FamilyID=a80147f8-130e-492d-93d3-e16e6b2e2fa1&displaylang=en

     

    4.       Please add the following registry keys on the CRM sever:

     

    a. HKEY_Local_Machine\Software\Microsoft\MSCRM key

     

    b. Right click on the blank space ,New à DWORD value

     

    c. Enter the key named OptimizeOrgImport.

     

    d. Modify the value of the key to “1”

     

     5.       Add the following registry keys to increase the timeout values as specified in the KB article http://support.microsoft.com/kb/918609 [Method 1]

     

    Ran the query below against the CRM 4.0 Org DB

     

    select ObjectTypeCode, Name, BaseTableName, ExtensionTableName from EntityView where IsCustomizable = 1 and ( Name is null or BaseTableName is null or ExtensionTableName is null)

     

    It returned the results

    =============

    ObjectTypeCode: 4700

    Name: AsyncOperation

    BaseTableName: AsyncOperationBase

    ExtensionTableName: NULL

     

    Resolution

    1 . select ObjectTypeCode, Name, BaseTableName, ExtensionTableName, iscustomisable from EntityView where IsCustomizable = 1 and ( Name is null or BaseTableName is null or ExtensionTableName is null)

     

    2 . This pointed to the row that has Objecttypecode = 4700 and IsCustomizable = 1.

     

    3. Ran the query below

     

    Update Entityview

    Set IsCustomizable = 0

    Where Objecttypecode = 4700 and IsCustomizable = 1

     

    Then run the query below and check for the customizable from entity view.

     

    select ObjectTypeCode, Name, BaseTableName, ExtensionTableName, iscustomizable from Entityview

    1.       where Objecttypecode = 4700

     

    Start upgrading CRM.

     

     

    Regards,


    Khaja Mohiddin|||||http://www.dynamicsexchange.com/
    Monday, August 22, 2011 1:18 PM
  • Hmm, I'll have to follow this one.  I am pretty curious now.
    Jamie Miley
    Check out my about.me profile!
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Monday, August 22, 2011 2:10 PM
    Moderator
  • Hi Khaja,

    I ran the below query given by you

    select ObjectTypeCode, Name, BaseTableName, ExtensionTableName from EntityView where IsCustomizable = 1 and ( Name is null or BaseTableName is null or ExtensionTableName is null)

    but the query did not return any result as said by you because in the entity view for the objecttypecode=4700(i.e  Name=AsyncOperation and BaseTableName=AsyncOperationBase) the value in IsCustomizable field is 0.

    As you have given the update query to update IsCustomizable field for updating IsCustomizable=0, i have not done this as the value for IsCustomizale is already 0 in my database.

    So the query given by you is not returning any result.

    What should be done to resolve this.

    Regards,

    Kishan.

    Tuesday, August 23, 2011 4:16 AM
  • Hi Kishan,

     

    Did you delete the asynchronous records from CRM database?

     

    Regards,


    Khaja Mohiddin|||||http://www.dynamicsexchange.com/
    Tuesday, August 23, 2011 10:39 AM
  • There are some preparation steps that you should consider taking before attempting an upgrade to CRM 2011.  Those steps include removing any unsupported customization to the CRM 4 server, remove plugins, clean up your async table, ensure there are no records in a 'delete' state, etc.  Here is a reference for that prep work and the upgrade process.

    http://blog.sonomapartners.com/2011/04/upgrading-to-crm-2011-our-story.html

    http://www.crmsoftwareblog.com/2011/03/preparing-for-crm-2011-how-to-make-your-microsoft-dynamics-crm-2011-upgrade-faster/

    These three items point to issues with the CRM 4 database that need to be addressed

    3.The full-text indexes on the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM full-text indexes.
    4.The indexes on the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM indexes.
    5.The stored procedures in the database are not consistent with Microsoft Dynamics CRM stored procedures.

    As Jamie mentioned, I suspect some unsupported customization to CRM 4, data issues in the sql database or some other customization that needs to be addressed before attempting the upgrade.  You can tap dance around this and hope that you can get things working but the possibility is high that at some point in time you will experience unexpected and 'odd' issues


    Regards, Donna


    Saturday, September 3, 2011 7:30 PM