Dynamics CRM 2013 - managing solutions

The core feature of managed solutions in Dynamics CRM 2013 is the ability to uninstall the solution smoothly to remove the functionality. This article is a personal view on my recent attempt to remove an ISV solution by uninstalling the managed solution.

Removing a managed solution

The world of CRM administrators has undoubtedly been made easier by the use of managed and unmanaged solutions.I recently had to remove a managed solution from a CRM instance and this blog reflects some of the experiences and learnings from that.

So, lets go back to starters. A managed solution is a set of CRM customisations that can be very tighly controlled and has the benefit that it may be uninstalled so taking away the customisations and the data stored in those. An un-managed solutions has no such tight controls - it can be re-configured by adminstrators and consultants on the target environment.

I have seen many articles debating whether internal customisations should be configured as managed or unmanaged and most experienced consultants recommend that internal solutions are deployed as unmanaged solutions. The benefit gained is that an administrator or consultant can make a change to the customisations directly on the target environment. Purists from the developer and solution architect professions of course would probably argue that this is not a good software deployment model or is good practice in change control. I leave that debate with them.

So, I had an environment into which I had installed a trial instance of the managed solution. The installation was smooth and went in without a hitch.

This solution created a lot of custom entities - I didn't count them but there was a lot.

Some of these custom entities had clear relationships with existing entities - such as the Lead, Case and Opportunity. The installation helpfully built out some of those relationships for me (more of that later).

I then built out more customisations to reflect the environment I was working in and started to tie up my unmanaged solution with the managed one - very easy to do of course.

However, I then realised that I needed to seperate out my customisations from the managed solution - easy, I'll build my own unmanaged solution and add all the existing entities I needed to that.

So, I did that, but suddenly hit the wall of dependencies. Where one entity has been linked to another, you have a dependency - and exporting and importing such a solution without one part of the link will fail the import.

My problem was that I wouldn't have the managed solution on the new target environment - sounds odd - but I didn't. Also, because of the nature of the solution, I couldn't export all the solution together as managed or unmanaged. Managed solutions cant be exported as unmanaged.

Think again - the answer was clear - uninstall the managed solution. Interestingly in CRM, this is done by deleting the managed solution - this removes the customisations and any associated data. Personally, I think this model is odd but hey. Here I hit an interesting problem. The managed solution actually consisted of several solutions. And, no, there was no clear starting point. So, taking a guess I tried to delete what I thought was the core solution - nope, dependencies stopped me again. It was clear that there
were 2 types of dependencies here - ones that I had introduced and ones that the solution had introduced. I had assumed that if the solution had introduced a relationship to existing entities then the uninstall would remove those - not for this solution!

CRM is pretty good at showing you the dependencies and you can click through to see the component and try (the operative word) to remove it. For example, you might have an entity ID on the form of a basic entity and that is stopping you from removing the solution. So, you can go through stage by stage but again you will hit dependencies - you can't remove a relationship without removing the ID field from the views and forms.

It is then also quite easy to forget to publish the customisation changes - if you do this then the unistall will still think those dependencies are there.

So, after about a day of removing links between entities I was able to start removing the managed solutions (there was about 4 in total) one by one. The last one locked SQL out and I really thought I had lost the system - but within 5 minutes the system was available again and the solution had gone.

Lessons learned:
Installing a managed solution might be easy - removing it might not be so easy
Record your customisations using the managed solution so you can get rid of those before uninstall
Your managed solution might not be able to remove all of its customisations - so expect to get down to the detail.
Removing the solution WILL have a big performance impact on the environment - don't do this in user time.

Thought to ISV developers. Pay attention to the uninstall experience - I know thats not what you expect but it matters. Uninstall should be clear, the order should be well understood and it should be comprehensive.

Happy solutionising!


Social Share

Leave a Reply