1

I am creating 2GP unlocked packages, no issue. I have created a DevHub, completed all my pre requisites (Enabled Dev Hub, 2GP), attached namespace org to the devhub.

When I am trying to get the package version list sfdx force:package:version:list after authenticating my DevHub sfdx force:auth:web:login -d -a DevHubAlias I am getting all my package versions which is great.

Now, I am going to spin up another DevHub, (brand new Developer Org) and going to abandon the previous DevHub, my question is

How do I migrate package version list from the old devhub to the new devhub?

I have a feeling it has to be stored in one of the tooling api objects, but could not identify which one. https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_metadatapackageversion.htm

2 Answers 2

1

You cannot migrate a package directly from one org to another; you have to create a new one. Similarly, you cannot specify an ancestor package version or a package Id from a different Dev Hub org. In other words, by abandoning your old Dev Hub org, you are also going to have to abandon your package and all versions created so far. You will have to create a new package and a new version, and any subscribers using the old package will have to uninstall it to install the new one.

If you have your metadata versions in a git repository, you can always checkout to those various states, build duplicate versions in the new Dev Hub, and repeat as necessary, but they will still be logically disconnected packages that will necessitate a backup/uninstall/install/import cycle for all subscribers that wish to update.

1
  • Thank you, hoping that salesforce incorporates this movement of package version data from one hub to another. Commented Sep 30, 2021 at 17:34
0

As of 2023. Salesforce has added that feature only for 2GP: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_unlocked_package_transfer.htm

1
  • This is just for unlocked packages but OP asked about transferring a package with a namespace. Commented Sep 21, 2023 at 11:42

You must log in to answer this question.

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