Clean model store upgrade to CU 10
We had a request from one of our customers running AX 2012 R3 to upgrade to CU10. There were already a few Knowledge Base articles (more than 50) installed in their current system. So what we did is to hook in on MS Dynamics Lifecycle Services and select all KBs that form part of CU10. This resulted in over 4500 KB models in the model store. This became more troublesome since when compiling, we were even getting compilation errors. This is clearly a situation you don’t want to have at all.
How can we resolve this problem?
Download the slipstream installation of CU10 from LCS. When extracting this download, one will see the two models below.
Question now is: how can we get these two models in our customer environment without losing any data and replace the 50 KB articles already installed. The following is a small trick for cleaning up this mess. Import the above model with axutil, with the option /conflict:overwrite. This will result in moving the code from the existing 50 KB models to the new SYP model. So now the already installed 50 KB articles become empty shell models. All that remains to be done is to remove these empty shells. For this one can use the axutil list > lists.txt command. This command will give a text file with containing the installed models.
– Copy this file to excel
– Remove all lines that you don’t want to remove (the lines with Hotfix and SYP will stay)
– Next remove all information except the ID column and add the content of column A (axutil delete /model: ) before it followed by column C (/noPrompt) as shown in the screenshot below.
– Finally, copy and paste the content back to the list.txt file
All that remains to be done is to execute this in the cmd prompt again. This is quite a slow process, but in the end, model by model gets removed. When it is finished it is recommend to import the two models from CU10 one more time. From this point on one can start the code upgrade as normal. I personally tested this scenario and there was no data loss when synchronizing the database. Of course, there are no guarantees. Always test before using!