Tuesday, February 24, 2015
In my previous blog post, I gave a short overview of RapidStart Upgrade Tools and how these tools can help simplify the upgrade journey for Dynamics NAV Partners. In this blog post, I’ll dive deeper into the merge using RapidStart Tools topic. Let’s get started…
How Does Auto-Merge with RapidStart Tools Work?
Everything related to auto-merge in RapidStart Tools is done through PowerShell. To explain in simple terms what PowerShell is, we often use this funny metaphor that Powershell is the same command line just fed with anabolic steroids. :) Let’s take a simple example to help you better understand how it works.
First, you have to export objects that need to be merged to a text file. You do this for all three Dynamics NAV versions: current custom solution version (MODIFIED), standard Dynamics NAV version of current solution (ORIGINAL) and target Dynamics NAV standard version (TARGET). When you have those three files you can open Microsoft Dynamics NAV 2015 Development Shell. Microsoft has provided sample scripts that you might consider using when starting to work with Powershell. There are number of cmdlets available to run, but I will review 2 of them that are used for merge.
1. Compare-NAVApplicationObject: Use this cmdlet to check how the object was modified or to merge a redesigned object.
By executing this function you have to provide MODIFIED and ORIGINAL text files. Output of this cmdlet is “DELTA” file, which is actually the list of all differences between ORIGINAL and MODIFIED version.
Cmdlet example: “Compare-NAVApplicationObject –OriginalPath ‘C:\AutoMerge\original.txt’ –ModifiedPath ‘C:\AutoMerge\modified.txt’ –DeltaPath ‘C:\AutoMerge\delta.txt’ “. Example of DELTA file:
Now you need to log after executing cmdlet:
2. Merge-NAVApplicationobject: Use this cmdlet for objects merge. By executing this cmdlet you have to provide ORIGINAL, MODIFIED and TARGET text files. Output of this cmdlet is RESULT object text file. If the merge had conflicts, Powershell will also generate a CONFLICT file that shows you all not merged places (similar structure as DELTA file), parts that were merged successfully will not be displayed in file. In this case you can only adjust object manually by re-implementing all CONFLICTS. Cmdlet Example: “Merge-NAVApplicationObject -OriginalPath ‘C:\AutoMerge\original.txt’ –ModifiedPath ‘C:\AutoMerge\modified.txt’ –TargetPath ‘C:\AutoMerge\target.txt’ –ResultPath ‘C:\AutoMerge\Result.txt’ “
After executing cmdlet you will get full log of what has been done to the files:
Now you can import the RESULT text file to Dynamics NAV and compile it.
Using Powershell you can write one script to automate all steps written above: Export Objects; Merge; Import Objects; Compile Objects. You can also execute shell cmdlets by writing Dynamics NAV code. Just remember to use cmdlet “Import-Module 'C:\Program Files\Microsoft Dynamics NAV\71\Service\NavAdminTool.ps1' –force “ – otherwise NAV Development Shell cmdlets will not be recognized.
Recommended Use of RapidStart Auto-Merge
Auto-merge is very useful for uploading roll-ups, hotfixes or new add-ons for customer Dynamics NAV solutions. It has also enormous value when upgrading from Dynamics NAV 2013 or later versions to Dynamics NAV 2015 as it merges most of the objects, 50% to 80% based on my experience, in these versions automatically.
With the Compare Tool you can also analyze customer solutions to find out how much it is modified to help with the decision of which components needs to be upgraded to new version and which should be cleaned up.
The Compare Tool also makes it possible to have a three-way code analysis to determine the impact a new set of objects will have to your existing solution. The analysis is done in less than 15-minutes, pretty awesome compared to the effort needed previously, unless you were an upgrade center or had invested in sophisticated tools.
In addition, the Compare Tool has value when merging redesigned objects. However, I personally prefer using external compare tools because with the Microsoft Compare Tool you can only see log of all changes, while with external compare tools you can see detailed changes – full objects in text are displayed.
Other Available Upgrade Solutions
While RapidStart Upgrade Tools, released by Microsoft, has made some parts of an upgrade simpler, it doesn’t solve all challenges related to upgrades, including:
- Merging Complex Objects
- Merging Classic Client Objects (e.g. forms, reports, dataports)
- Compilation of Merged Objects
- Reports with Layout Merge
- Compilation of Custom Objects
- Custom Forms to Pages Transformations
- Standard Forms to Pages Merges
- Dataports to Xmlports Transformations
- Data Migration Prior to Dynamics NAV 2009 to Dynamics NAV 2013 or Later Versions
Sophisticated Upgrade Tools developed by the 1ClickFactory Upgrade Service Center can help solve most of above mentioned upgrade challenges related with transforming reports from Classic to RTC client, transforming classic Dataports to XMLports and others.