In the first part of this series, we covered the steps to extract model store file from AX 2012 environment and LCS project creation, configuration and link it with VSTS project. Below is the link of the first part. In this part, we will be moving the AX2012 code to Dynamics 365 environment.
Before starting, it is important to note that this code upgrade process uses overlayering approach to upgrade the code. Overlayering is a traditional approach which is common in earlier AX versions but for Dynamics 365, its not the best 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 touching the original object. For this blog series, we will create extension for overlayered code and elements.
1. Using code upgrade tool in LCS
This process converts an export of AX 2012 model store to the correct format for Finance and Operations. During this, it also directly resolves some types of conflict issues but for other issues that it can’t resolves by itself, it log those in Microsoft Visual Studio Team Services (VSTS) tasks. Some reports are also generated after the process completes that provides the user list of conflicts and migration summary.
Now let’s start this process. In your LCS project, select the Code upgrade tile.
In the bottom left corner of the screen, click Add, and then enter a name and description. Select source and target version, and then click Create.
Next, click on ‘Add files’. You will be prompted to upload a zipped version of your Dynamics AX 2012 R3 model store file. Once the uploading is finished, Click Analyze code in the bottom right corner. The code upgrade process will start. This typically takes 60-90 minutes depending on the size of you model store file. When complete, return to the Code upgrade tile in LCS to view the results.
2. 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 overlayering) or that have conflicts that need to be resolved manually.
- Tasklist: The task list report contains element wise list of conflicts that need to be resolved. It also provides the approximate number of estimate hours required to resolve each conflict.
3. Development environment
Now let’s head over to the development environment. We have already downloaded and configured D365FO VM (Version 7.3 Platform Update 12) on our local machine. On the VM, let’s open Visual Studio (Run as Administrator) to begin the development.
First, we need to add the account that is linked to VSTS. Open account settings (File > Account Settings) and click add an account. Enter the credentials on the next screen and click Finish.
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.
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. In the next blog, we will learn how we can resolve the conflicts and create extensions of the code and elements that are overlayered.