Newer Version Available

This content describes an older version of this product. View Latest

Complete the Move to 2GP Package Development

To fully transition to 2GP package development, you retrieve the source files for your package’s latest converted version. Then, you confirm in Setup for your packaging org that you’re ready to develop and distribute your package solely using 2GP packaging.

Before you complete your move to 2GP package development, it’s critical that you thoroughly test package conversions and subscriber migrations first. See Test Converted Packages and Subscriber Migrations.

Important

  1. To retrieve the source files for your package’s latest converted version, run the sf package version retrieve CLI command. This example retrieves the package metadata for a converted subscriber package version ID into my-folder/ within a Salesforce DX project directory:
    1sf package version retrieve  --package 04tXXX --output-dir my-folder –-target-dev-hub devhub@example.com
  2. Open the new sfdx-project.json file and update the versionName, versionNumber, and ancestorVersion.
  3. From Setup in the packaging org, enter Package Manager in the Quick Find box, and then select Package Manager.
  4. Click the package that you want to move to 2GP development.
  5. On the package’s detail page, click Move to 2GP.
    The Move to 2GP button on a package's detail page
  6. Carefully review and acknowledge the statements in the Move to Second-Generation Managed Packaging window, then click Proceed.
    The statements to acknowledge before you proceed with moving to 2GP.
After you click Proceed, you can no longer create new major or minor versions in the packaging org. To innovate on the package using 2GP, you create new package versions using the sf package version create CLI command.