1

Suppose, there is a 1gp Managed Packaging Org, namespace prefix: abcxyz. Several beta-release versions exist. Now, I want to move to the 2gp Managed packaging. So, I linked the devHub org and going to start to create 2gp Managed packages with the same namespace prefix: abcxyz by using CLI.

My inquiries:

  1. There will be no dependencies between the already released 1gp Managed Package components and 2gp Managed Package components, right?
  2. Will there be any dependencies between 2gp itself? For example, in 1gp, we can't remove components once they are added to the released version previously. I wonder if there are restrictions like that in 2gp.
  3. Is it possible to install a 2gp over a 1gp or vice-versa? For example, we can upgrade 1gp by 1gp release, but what will happen if we intend to upgrade a pre-installed 1gp package by a 2gp package(obviously same namespace) or vice-versa.
  4. I don't have a clear idea about the branch structured versioning system in the 2gp package, could you please enlighten me?
  5. Lastly, there's no defined way to convert from 1gp to 2gp, right? Since we can just create a 2gp from DevHub and add any components(I don't know about the restrictions) and move on.
  6. Is it possible to upgrade 2gp Managed Package?

Please, share if there are any important dependencies between the already released 1gp Managed Package and the newly created 2gp Managed Package. As always, thank you for your time.

1
  • 2
    1GP to 2GP migration will be supported in a future platform release. For you, if you have not formally released the package as 1GP you can safely abandon it, though your 1GP packaging org would have to be the owner of the 2GP namespace. For the rest of your questions, these are (I believe) all covered in the documentation. Your question does not show any research attempts.
    – Phil W
    Oct 5, 2021 at 6:47

1 Answer 1

3

There will be no dependencies between the already released 1gp Managed Package components and 2gp Managed Package components, right?

Correct.

Will there be any dependencies between 2gp itself? For example, in 1gp, we can't remove components once they are added to the released version previously. I wonder if there are restrictions like that in 2gp.

You can't necessarily delete components, but you can create a new "branch" from an earlier version, thus creating an alternative version that no longer has that component. This is like the 1GP model, except you don't have to get Partner Support involved; you can fix these problems yourself.

Is it possible to install a 2gp over a 1gp or vice-versa? For example, we can upgrade 1gp by 1gp release, but what will happen if we intend to upgrade a pre-installed 1gp package by a 2gp package(obviously same namespace) or vice-versa.

No, you can't have a 1GP and 2GP with the same namespace in the same org. An uninstall and reinstall will be necessary.

I don't have a clear idea about the branch structured versioning system in the 2gp package, could you please enlighten me?

It's just like a git repository. You can create branches to support diverging code and metadata. This is kind of an advanced topic, and I wouldn't recommend doing it without understanding the consequences. You can't "hop" between installed branches, so that means that once you go down a certain path, you can never switch to another without uninstalling and reinstalling.

Lastly, there's no defined way to convert from 1gp to 2gp, right? Since we can just create a 2gp from DevHub and add any components(I don't know about the restrictions) and move on.

At the time of this answer, no, but this tentatively planned to release in 2022. Since you only have beta packages, just abandon your current work in the 1GP and start with a new 2GP version.

Is it possible to upgrade 2gp Managed Package?

Yes, as long as the new version has a common ancestor with the prior version, you're allowed to upgrade. This document should prove useful.

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