Search code examples
dynamics-crmdynamics-365

Dynamics 365 (on-premises) v8.2 upgrade to v9 fails


I am trying to upgrade Dynamics 365 version 8.2.3 to version 9.0, but have some problems with it.
I've tried two scenarios on my test server:

  1. Created backup of my real CRM database (XXXXXX_MSCRM)
    Restored it on the test server.
    Installed version 9.0 on the test server. Installed the latest update for it.
    Did Import Organization on restored database (XXXXXX_MSCRM) via Deployment Manager. It failed.
    As a result, importing failed with this exception:

    System.Exception: Error.ActionFailed Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction ---> 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 'PK_topicmodelBase' is being referenced by table 'TopicModelExecutionHistoryBase', foreign key constraint 'topicmodel_topicmodelexecutionhistory'.

  2. Created backup of my real CRM database (XXXXXX_MSCRM)
    Restored it on the test server.
    Installed version 8.2 on the test server.
    Did Import Organization on restored database (XXXXXX_MSCRM) via Deployment Manager. It succeeded.
    Installed the latest update for version 8.2. It succeeded.
    Installed/Upgraded Dynamics 365 to version 9.0. It failed.
    During the installation it also tried to upgrade Organization version to 9.0 and failed. So, server version 9.0 is installed, but my organization is in Failed state.
    Explored the log file and got this exception:

    System.Exception: Action Microsoft.Crm.Tools.Admin.InstallCrmSystemConvertedSolutionsAction failed. ---> Microsoft.Crm.PackageDeployment.PackageDeployerException: Package msdynce_MarketingSales failed to install on attempt 1. System.AggregateException: One or more errors occurred. ---> Microsoft.Crm.MultiTenantPackageDeployment.PackageDeployerImportException: PackageDeployerWrapper: Import Failed status encountered. Details: Failed to load solution Marketing Sales Patch, version: 9.0.4.3602

    and also a bunch of this kind of inner exceptions:

    Error : The AttributeLookupValue (Id=81cde1dc-2241-db11-898a-0007e9e17ebd) entity or component has attempted to transition from an invalid state: ComponentStateName: Solution; ComponentOperation: Delete; ComponentSolutionType: Active; SolutionOperationContext: MoveSystemComponentToFirstPartySolution; IsProtected: False; FinalComponentState: Publish.

Did anyone faced with such a problems during the upgrade process?


Solution

  • Ok, I have successfully upgraded Dynamics 365 and my organization to version 9 with the second scenario.
    Here is my solution:
    First of all, my Dynamics 365 version and real organization's version (let's call it "RealOrg") was of version 8.2.3.8.

    1. Install the latest update for Dynamics 365 8.2 (Update 2.15). No problem with it, everything should work fine. So we got 8.2.15.2 version.

    2. Now we need to run setup of version 9. At the start of the installation we must choose some organization which will be upgraded to the new version <-- so here is the problem part. Whatever organization I choose, after upgrading it to v9 it will be always in Failed status, so I will lose it. What I did is created new organization via Deployment Manager, lets call it "FakeOrg" then I chose this organization to upgrade it to version 9. After that, we are able to manually upgrade "RealOrg" at any time after v9 installation.

    3. Upgrade should perform successfully, despite the fact that it can show exception message (this exception probably refers to organization upgrade). So now we got "FakeOrg" of version 9.0.2.3034 with Failed status (we don't need it anymore) and "RealOrg" of version 8.2.15.2 with Disabled status, but we can see that Update option is available for "RealOrg".

    4. It is important do not update "RealOrg" to new version at this step, because it will try to update organization to 9.0.2.3034 version which is pretty buggy and it will fail. We need to install first update for Dynamics 365 9.0 (Update 0.3). It performs with no problem. So now we have version 9.0.3.7.

    5. We finally can manually upgrade our "RealOrg" from version 8.2.15.2 to version 9.0.3.7. It took around 2-3 hours for me, but worked fine with no problem.

    6. After all, another problem I faced was this exception when I tried to access Dynamics 365 website:
    Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies
    The reason of this exception is absence of report viewer .dll-s in website bin folder. Solutions is to copy 7 .dll files from version 9 installation extracted files (you should extract files before running the setup of v9)

    Copy these files:
    Microsoft.ReportViewer.Common.dll
    Microsoft.ReportViewer.DataVisualization.dll
    Microsoft.ReportViewer.Design.dll
    Microsoft.ReportViewer.ProcessingObjectModel.dll
    Microsoft.ReportViewer.WebDesign.dll
    Microsoft.ReportViewer.WebForms.dll
    Microsoft.ReportViewer.WinForms.dll


    Into this folder
    C:\Program Files\Microsoft Dynamics CRM\CRMWeb\bin