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
- In Visual Studio, in the AOT search for model: "model name", add all elements to new projects by right clicking it.
- Delete all elements
- Add a single empty class, typically Class1*
- In the Model setup of all models using the model you are to remove, un-tick the reference of the model you are removing.
- 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.
- Download the SDP zip file from your Asset Library (by clicking on the name) on your Devbox or local machine
- Create a new text document, for each separate line specify a model name of those your want to export.
- Save the file with the name ModuleToRemove.txt.
- Extract the ZIP file from step one
- Place the text file in the folder AOSService\Scripts
- Zip up the file again so that it keeps it's initial folder structure.
- Upload the file to your asset library
- Install and the models will be uninstalled fully
Comments
Post a Comment