Sub topic 15
Pushing upgrades and shipping patches
This chapter assumes you can already create, promote, and install a package version, and that you understand ancestry. Here you will learn how to move subscribers to a new version without waiting for them, and how to ship a bug fix as a patch.
Pull upgrades and push upgrades
By default, a subscriber upgrades by installing a newer version. That is a pull upgrade. A push upgrade is started by you, the publisher, and runs in the subscriber's org without them clicking anything. It suits urgent fixes and keeps most subscribers on a few versions, which lowers your support load.
A push upgrade has these requirements:
- The package is a managed 2GP package.
- The target version is promoted to released.
- The subscriber org already has an earlier version of your package installed.
- The target version has a valid ancestry from the installed one.
Upgrades run in the background, and any failure is recorded per org. Push upgrades are not for features that need a decision from the subscriber's admin.
Scheduling a push upgrade
Push upgrades use the version's subscriber package version ID, which starts with 04t. Give the target orgs in a CSV file with an OrgId column.
OrgId
00D000000000001AAA
00D000000000002AAAThen schedule the request against your Dev Hub:
sf package push-upgrade schedule --package 04tXXXXXXXXXXXXXXX --start-time "2026-12-10T02:00:00" --org-list orgs.csv --target-dev-hub devhubUse the report and list commands to follow progress, and the abort command to cancel a request that has not started:
sf package push-upgrade report --push-request-id 0DVXXXXXXXXXXXXXXX --target-dev-hub devhub
sf package push-upgrade list --package 04tXXXXXXXXXXXXXXX --target-dev-hub devhubFlag names can change between CLI releases. Run sf package push-upgrade schedule --help to confirm them for your version.
Shipping a patch
A patch is a release that contains only fixes. It uses the third number in the version, major.minor.patch.build. To patch released version 1.2.0, set the patch number in sfdx-project.json and name the base version as the ancestor:
{
"path": "force-app",
"default": true,
"package": "AcmeApp",
"versionName": "Fix for 1.2",
"versionNumber": "1.2.1.NEXT",
"ancestorVersion": "1.2.0"
}Build the version with sf package version create, test it, and promote it as usual. Then push it to the affected orgs, or let subscribers install it.
Common errors
- The request is rejected. The target version is still beta. Promote it first.
- An org is skipped or fails. The org may not have the package installed, or its installed version may not be an ancestor of the target. Check the push job report.
- A patch cannot be built. The ancestor must be the released base version for that major and minor number.
Exercise
A critical bug affects subscribers on released version 2.0.0 of your package. Name the version number you would set for the fix, the ancestor you would name, and the step that gets it into subscriber orgs without their action.
Show answer
Set versionNumber to 2.0.1.NEXT with ancestorVersion 2.0.0. Build it, promote it to released, then schedule a push upgrade with sf package push-upgrade schedule, using the new 04t ID and a CSV of the affected org IDs.