locked
CRM 4.0 Organization upgrade to CRM 2011 Issues RRS feed

  • Question

  • Hi everyone,

    Am trying to import CRM 4.0 organization from new CRM 2011 clean install.

    Below is the error

    Exception occured during Microsoft.Crm.Tools.Admin.OrganizationUpgrader: failure of action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction.
    InnerException:
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Crm.CrmException: Deletion Service failed to cleanup remaining soft deleted records.
       at Microsoft.Crm.DataUpgrade.RemoveDscReferencesDriver.RunV4DeletionService()
       --- 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:
    Microsoft.Crm.CrmException: Deletion Service failed to cleanup remaining soft deleted records.
       at Microsoft.Crm.DataUpgrade.RemoveDscReferencesDriver.RunV4DeletionService()

    10:43:03|   Info| Setting organization state.  New state = Failed

     

    Please I need your help


    DD
    Saturday, June 4, 2011 12:37 PM

Answers

  • Run the deletion service. In CRM 4.0, if you deleted records, the records were not immediately deleted—they were flagged for deletion, then the CRM deletion service came along, usually within 24 hours, and deleted the records.
     
    One problem that can happen, especially if large numbers of records were bulk deleted, is that records can get stuck in the “soft delete” state.
     
    In 2011, there is no more soft deletion of records—they are deleted immediately from the database when the records are deleted in CRM. When you upgrade, the upgrade process will hard delete any leftover “soft deleted” records. If you have many deleted records in your system, this step can take a while.
     
    Before you upgrade, you may want to search your main entity tables to identify if you have a large number of soft deleted records still sitting in your database. For example, the following query will identify any deleted records that still exist in the account tables:
     
    select * from accountbase where deletionstatecode = 2

    You can use this free deletion service utlity (http://blogs.infinite-x.net/2009/08/26/free-utility-run-crm-deletion-service) to delete records.

    After deletion soft records try again upgrading to CRM 2011.

    I hope his has answered your question.

     


    Thank You,
    Jehanzeb Javeed,
    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

     



    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Jehanzeb.Javeed Saturday, June 4, 2011 12:48 PM
    • Marked as answer by Jim Glass Jr Thursday, July 14, 2011 4:53 PM
    Saturday, June 4, 2011 12:48 PM

All replies

  • Run the deletion service. In CRM 4.0, if you deleted records, the records were not immediately deleted—they were flagged for deletion, then the CRM deletion service came along, usually within 24 hours, and deleted the records.
     
    One problem that can happen, especially if large numbers of records were bulk deleted, is that records can get stuck in the “soft delete” state.
     
    In 2011, there is no more soft deletion of records—they are deleted immediately from the database when the records are deleted in CRM. When you upgrade, the upgrade process will hard delete any leftover “soft deleted” records. If you have many deleted records in your system, this step can take a while.
     
    Before you upgrade, you may want to search your main entity tables to identify if you have a large number of soft deleted records still sitting in your database. For example, the following query will identify any deleted records that still exist in the account tables:
     
    select * from accountbase where deletionstatecode = 2

    You can use this free deletion service utlity (http://blogs.infinite-x.net/2009/08/26/free-utility-run-crm-deletion-service) to delete records.

    After deletion soft records try again upgrading to CRM 2011.

    I hope his has answered your question.

     


    Thank You,
    Jehanzeb Javeed,
    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

     



    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Jehanzeb.Javeed Saturday, June 4, 2011 12:48 PM
    • Marked as answer by Jim Glass Jr Thursday, July 14, 2011 4:53 PM
    Saturday, June 4, 2011 12:48 PM
  • Hi Javeed,

    I m also facing similar kind of errors at the time of importing crm 4.0 db to crm 2011.

    Details of errors:

    1. The indexes on the Microsoft Dynamics CRM database are not consistent with Microsoft Dynamics CRM indexes.
    2. The stored procedures in the database are not consistent with Microsoft Dynamics CRM stored procedures.
    3. Database triggers were detected in the Microsoft Dynamics CRM database.
    4. Fragmented indexes were detected in the Microsoft Dynamics CRM database.

    So i have to run below query for all the tables (system or custom both)

    select * from accountbase where deletionstatecode = 2

    If i find any record with deletionstatecode=2 then i have to delete that records from table.

    Please correct me if i am wrong.

     

    • Edited by P_Mundra Friday, July 22, 2011 5:53 PM
    Thursday, July 14, 2011 12:04 PM
  • I have installed CRM 2011 and SQL Server 2008 R2 onto a new server

    I have restored the CRM 4 SQL backup onto the new server and I have tried to import the organisation using the CRM 2011 Deployment Manager.

    I have investigated why the import fails and find that it is due to the import facility not being able to delete the "soft deleted" records in the CRM 4 database

    I have found the utility that is suppsed to address this problem (http://blogs.infinite-x.net/2009/08/26/free-utility-run-crm-deletion-service)

    I ran that utility but still find that I have 152 records in the "Account" and 152 records in the "accountbase" tables where the deletionstatecode = 2

    How can I resolve this problem?

    TIA

    Joe


    Joe
    Wednesday, July 20, 2011 8:54 AM
  • Hi Joe,

    Same problem i am faced earliar, so i manually updated deletionstatecode=0 to all remaining records.

    You can do manually update by writting sql update query for 152 records.

    update accountbase
    set deletionstatecode=0
    where deletionstatecode=2.

    and then again you can run setup you will not get deletionservice error.

    Hope this will help you.

     

    Thursday, July 21, 2011 10:40 AM
  • Hi Raj,

    Thanks for this input. 

    What was the impact of you setting the deletestatecode back to 0

    Did the records that should have been deleted reappear and how did you ultimately get rid of them?

    Joe


    Joe
    Monday, July 25, 2011 9:17 AM
  • Hi Joe,

    deletestatecode back to 0 means active records.

    We are doing this because CRM 2011 does have funda of deleted records means deletionstatecode=2.

     

    So before upgrade we have to convert all records to active one otherwise it won't able to upgrade.

     


     

    Wednesday, August 3, 2011 6:20 PM