If you’ve never created or worked with managed 2GP packages, scratch orgs, or Salesforce CLI, take some time to learn more about Salesforce DX and second-generation managed packages.
Before starting package conversion, review the requirements regarding metadata support, API version, and managed-released versions. Ensure your package meets these criteria.
Metadata Support
If your 1GP package contains metadata that isn’t currently supported in 2GP packages, the package conversion fails. You can compare the metadata in your package against the Metadata Coverage Report and ensure the metadata in your 1GP managed package is also supported in 2GP.
Alternatively, you can identify metadata issues by running the CLI package convert command. The package convert CLI command detects and reports back to you any 1GP metadata types that prevent the package from being converted to 2GP. Using the package convert CLI command in this way lets you quickly assess whether you have any packaged metadata that isn’t supported in 2GP. During package conversion, your original managed 1GP package isn’t altered. It’s safe to test out the conversion command, before you are ready to migrate your packages to 2GP.
If your package contains metadata that isn’t supported in managed 2GP, either remove the metadata from your package, or wait to convert the package until managed 2GP supports that metadata type.
API Version: You can convert first-generation managed packages created using API version 57 (Spring ’23) or higher.
Managed-Released Package Versions: You can convert managed-released package versions only.