In this article we will look at the practical approach to move an ISV solution from MS Dynamics AX2012 to D365 for Finance and Operations. Microsoft offers an elevated path to move ISV solution or code base from MS Dynamics AX2012 to D365 for finance and operations using Life Cycle Services (LCS). After performing these steps using code upgrade service of LCS, one can analyze the estimated task and effort that may require for such migration.
Before we begin, make sure that MS Dynamics AX2012 along with the ISV solution is already upgraded to R3 with the latest cumulative update (CU). Next we need to export AX model store that contains all ISV code modifications. Once model store is exported, wrap it to a Zip file. Next we need an LCS account and access to Visual Studio team services (VSTS). Summing up below are the Prerequisites
- Upgraded AX 2012 ModelStore to R3 and latest CU
- Access to Microsoft Dynamics Lifecycle Services (LCS)
- Access to Visual Studio team services (VSTS)
- Microsoft Dynamics 365 for Finance and Operations development environment (in our case we will be using VM deployed in local environment)
Using code upgrade tool in LCS
To begin login to LCS. Either create a new project or open existing project and go to hamburger icon -> code upgrade and Microsoft code upgrade service dashboard will open. Click on add on lower left bottom to add a new code upgrade job give it a name, description and select Microsoft Dynamics Ax 2012 in Release you are upgrading from dropdown and select a latest version (8.1 as of writing of this article) in release you are upgrading to dropdown
Click on add files to upload a ModelStore as zip file as mention in previous Step (you can use WinRaR or Winzip or any other tool to compress it). It will take some time depending upon the size of zip file.
Setup VSTS project
Since code upgrade service needs to have project that will contain all the converted objects either through extension or with over layering (metadata and project) so before moving forward we need to setup Visual Studio team Services (VSTS) account and project.( VSTS in now renamed as Azure DevOps)
Go to https://visualstudio.com and create a free VSTS account. Do remember to use credentials that are linked with your organization (same will be needed for LCS login).
Next, enter your VSTS site (use customer name), choose Team Foundation Version Control option and click Continue.
In our case, VSTS site https://contoso365.visualstudio.com will be created. It contains one default project called: MyFirstproject.
Now we will create a new VSTS project. Click on ‘New Project’, enter project information and click ‘Create’.
Make sure that to select “Team Foundation Version Control” as version control and work item process to “CMMI”
Now back to LCS and Go to hamburger icon -> projects settings
Go to visual Studio team services -> Setup Visual Studio Team Services
Next you will see the following screen, enter VSTS URL that we just created in previous steps and add personal access token. Following link will guide you how to create a personal access token.
Next select the VSTS project that we just created in previous step. Click continue and review and save the changes.
Now go back code upgrade service and visual studio project name will appear. Next click on analyze code. A large Popup window will appear mentioning that it will take time to complete the job click proceed. Now once the job is done you will see the following screen
It is important to note that code upgrade process uses over layering approach to upgrade the code. Over layering is a traditional approach which is common in earlier AX versions but for Dynamics 365 for finance and operations, it’s not the recommended way as it needs more time and effort to resolve conflicts and perform testing for future releases and upgrades. The alternate method is to use extension approach which allows existing objects to be customized without directly modifying the original object.
Analyzing code upgrade process results
The process provides following files.
- Upgraded metadata zip file: This is the upgraded source code file for Dynamics 365, contains xml files for all the AOT elements, can be used for manual code merge without using TFS.
- AX7 metadata version: This contains the Dynamics AX version number that the code was upgraded against.
- Migration Summary: The migration summary file enlists elements that are successfully upgraded (via extension or over layering) or that have conflicts that need to be resolved manually.
Now let’s head over to the development environment. We have already downloaded and configured D365FO VM (Version 8.1 Platform Update 20) on our local machine. On the VM, let’s open Visual Studio (Run as Administrator) to connect visual studio team services.
Next, open Team Explorer (View>Team Explorer) and click Connect.
On the next window, click on Servers button. Click Add on next screen. Enter VSTS URL on which we have created a VSTS project (in the first part of this series). Once you click OK, you will be asked to select the account linked with VSTS.
Next, select the project that we’ve created earlier. In our case its ‘D365 Code upgrade’ project.
Now that we have connected to TFS, let’s configure the workspace to sync metadata and projects.
Click Configure your workspace on Team Explorer
Map Trunk>Main>Metadata and Trunk>Main>Projects node to the following directories and click OK.
Make sure that metadata is locate to packagesLocalDirectory
Next, you will see the following message. When you click ‘Yes’, VSTS project files will be downloaded to your VM. This will take some time.
Once completed, if you browse through the projects that the process created, you will find these three types of projects.
- CodeMergeSolution: You will have to merge your code with the new code in this project.
- UnParsableSolution: There are some AX2012 elements that are not supported in D365 (like AIF), this solution contains those elements and code that needs to be rewritten.
- UpgradedSolution: Some of the code is automatically upgraded by Microsoft, contain all elements that are upgraded automatically.
If you now open the AOT, you will see some new models that are now added.
After code upgrade all code changes in Ax 2012 should be terminate except only necessity changes should allow. If any changes is made, it must be shift manually to the new solution.