CRM 2011 + updating a Managed Solution without losing data.


 

In CRM many times we have the requirement to remove a plugin or may be a view from an entity or any other customization from an already installed managed solution. The managed solution can reside in your UAT environment or even you product environment. The traditional approach to such a change is make the changes in your unmanaged solution in development environment extract it as managed solution then in the production or UAT environment delete the already installed managed solution and import the new managed solution, with this you lose all your data and have to re- enter the entire data.

    My solution to this problem is simple and described in the following steps:

  1. Make your desired changes in the unmanaged solution in the development environment.
  2. Extract the unmanaged solution as managed solution.
  3. Extract the contents of the managed solution. In the extracted files open the solution.xml file and change the UniqueName of the solution. E.g. if your managed solution has name MySolution then rename it to some name e.g. MySolution_Plugin since I just made a change in plugin class I renamed it so.
    …….<SolutionManifest><UniqueName>MySolution_Plugin</UniqueName>…….
  4. Now import this solution into the production/UAT environment where you want to update the solution file.
  5. So now you will have two solution file in the organization. Delete the previous one and you are done. If you want to get back the same name of the previous solution file that is “MySolution” you can re-import the solution with name changed to “MySolution”.

Hope this post helps a lot of you developers out there. Do let me know if this does not work in any scenario for I have only tested I for plugins and it works. J

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s