Deleting a model in all environments

At my company we use the known topology of environments. Devboxes, pre-test, customer test, UAT, Golden Config and Production. Lately I got the task of uninstalling an under-performing third party ISV module. This was a set of three models checked in from a devbox with source code. My thought were just to remove the models (using modelutil.exe) and check in the changes into TFS. Did not work on every other machine but the one doing the work, this because TFS only makes changes to models and does not delete them. 

The proper way of doing things are to empty out the models, clean them of source code. Build the single deploy-able package (SDP) and install it normally, as if it was a normal code upgrade. The next time you perform this task of code upgrade, we have to download the SDP and add something to it before it gets installed.

First set of tasks

  1. In Visual Studio, in the AOT search for model: "model name", add all elements to new projects by right clicking it.
  2. Delete all elements
  3. Add a single empty class, typically Class1*
  4. In the Model setup of all models using the model you are to remove, un-tick the reference of the model you are removing.
  5. In pending checkins make sure you have your descriptor file as well as your single class and a deletion of all the elements, then check in all the changes
*The reason for this one single class addition is that only model changes get considered by the build machine, if you remove all traces of it will still reside in sandbox environments.

Next time your build machine compiles and builds for code distribution it will insert the SDP without the code of the model(s) you've emptied. Meaning all functionality of your model has been removed but the models themselves remain, the models are to be removed in the next step. 

Second set of tasks

You are to perform a new delivery to your sandbox environments. Perform a build and a new SDP gets uploaded to your Asset Library. 
  1. Download the SDP zip file from your Asset Library (by clicking on the name) on your Devbox or local machine
  2. Create a new text document, for each separate line specify a model name of those your want to export. 
  3. Save the file with the name ModuleToRemove.txt.
  4. Extract the ZIP file from step one
  5. Place the text file in the folder AOSService\Scripts
  6. Zip up the file again so that it keeps it's initial folder structure.
  7. Upload the file to your asset library
  8. Install and the models will be uninstalled fully

Comments

Popular posts from this blog

Call a simple Logic app from X++

SysOperationFramework with use of Query

Retail Attributes on sales lines