1

TLDR; Essentially I want to uninstall the unmanaged package but keep all the contents.

Here is the interesting scenario.

ORG_B was created as a spinoff of ORG_A. This was done with an unmanaged package in ORG_A installed into ORG_B.

ORG_B has MANAGED_PACKAGE installed, and creating all sorts of issues. This managed package is no longer needed, and in fact the company that created it no longer exists. MANAGED_PACKAGE is referenced by UNMANAGED_PACKAGE, so it cannot be uninstalled.

UNMANAGED_PACKAGE is linked to just about the entire org customization, however was installed 8 years ago so there is no telling what changes have been made and there is no possibility of getting into ORG_A to modify it anyway.

1 Answer 1

1

You can't remove components from an installed package, and uninstalling the package will remove all the components. If you insist on getting rid of the package, the process you'll need to go through may range from a mild irritant to completely obnoxious. You may want to just deal with the package existing until you decide to move to to a new org or can dedicate the time you need to fix this.

The process to fix this would be as follows:

First, download the package. Unmanaged packages don't hide their content, do doing this is trivial. For my solution, I recommend Salesforce DX, because we'll be using it for this process.

Second, create an Unlocked Package with the contents you just downloaded. You'll use this to restore the miss configuration when you're done. Make sure you test this out installing the package in a spare org to make sure it works.

Third, back up any objects and fields that will be deleted. Give your users warning not to use those objects and fields until you're done, because that data is going bye-bye. You can use the "retain data" option while uninstalling, but you want your own copy too--just in case.

Fourth, uninstall the package. This step may be complicated if you have dependencies you need to untangle. I suggest adding those dependencies to the Unlocked Package, as you'll need to restore those later. Repeat the package version/deletion cycle until you successfully uninstall the package.

Fifth, install the Unlocked Package. This should put all the metadata back in place for you. Further, you'll be able to use this package to migrate to new orgs in the future, etc, or even just use it as your primary development life cycle going forward. This new package type even allows uninstalling without deletion and automatically merging into existing unmanaged metadata.

Sixth, reload any missing data that you had backed up. If you've gotten this far, it should be pretty trivial from this point.

3
  • This is what I was afraid of. My only hope - and I was going to test - was that if I create the unlocked pacakge I'd be able to install it in the org and "Steal" the package assignment. Do you know if that has any hope of working? Thanks for the detailed response.
    – wellmstein
    Sep 14, 2020 at 14:59
  • @wellmstein I'm hesitant to offer that as a solution, as I'm not sure if it'll work. You can test this in a Sandbox, or if it's not super-urgent, I could experiment today and get back to you?
    – sfdcfox
    Sep 14, 2020 at 15:07
  • It's not super urgent. If you get a change to try it that'd be great. Otherwise it's on my list to try at somepoint.
    – wellmstein
    Sep 17, 2020 at 14:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .