Enable Migration of Deprecated Metadata in Unlocked Packages

As you start creating more unlocked packages, you might need to refactor your package and move metadata from one unlocked package to another unlocked package. You can now deprecate metadata in an unlocked package, move that metadata to a new package, and then install the new package in your production org. Upon successful installation of the new package, the deprecated metadata becomes associated with the new package. This feature simplifies that process.

Where: This change applies to Lightning Experience, Salesforce Classic, and all versions of the Salesforce app in Group, Professional, Enterprise, Performance, Unlimited, and Developer editions.

Why: Previously, you had to use the UI to manually remove the installed metadata from the original package because deprecate-upon-upgrade metadata was still associated with the package. You couldn’t install a new package containing that metadata without the manual step.

How: For example, to move production metadata from package A to package B:
  1. Identify the metadata to be moved from package A to package B.
  2. Remove the metadata from package A, create a version, and release the package.
  3. Add the metadata to package B, create a version, and release the package.
  4. In your production org, upgrade package A.
  5. In your production org, install package B.
Your metadata is now a part of package B in your production org.