Things to consider while uninstalling managed packages

Yet times uninstalling managed packages may lead to multiple issues if it doesn’t go unplanned. So we have to follow the series of steps to minimize the impact after it is removed.

Actions to do in the Test environment :

  1. Create a sandbox org to perform the uninstallation in the test environment.
  2. Get all the references (The simplest way is to try to uninstall & check the references)
  3. Replace the custom field references in 
    • Apex
    • Visualforce
    • Validation rules
    • Workflow rules
    • Flow
    • Process Builder
    • Approval Process
    • Email Templates (both HTML & Text)
    • Workflow Field updates
    • Page Layout
    • Reports
    • Report Types

NOTE: We may need to create replacement fields for fields that need to be deleted.

Once the above steps are performed you should be able to uninstall the package.

Actions to do in the Production environment :

  1. Backup the data of all the reference fields as well as managed package objects.
  2. Deploy the replacement fields and update the data.
  3. Deploy all the components from the sandbox where the references are removed or changed.
  4. Uninstall the package.

Common errors:

Component is in use by another component in your organization

Most of the time you should be able to find the related component using the “Where is it Used” button available on the component. In case if you are unable to find the references, check all the inactive workflow rules. 99% of the time the missing references will be in the workflow rules.

This extension depends on the package you are trying to uninstall

This happens if there are dependent managed packages that have reference to the component which we are trying to uninstall.

Please check the date of installation if there is a dependency and remove them in the reverse order.

References:

Best practices when you uninstall an app or package

Leave a Reply

Your email address will not be published. Required fields are marked *