---
schema_version: "1"
id: d42d1d9060a249593cbb04bf94687838e7887463bd269a4de5e190c8cbe7847c
title: Scheduling Push Upgrades
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform-pkg-exchange/managed_packaging/guides/first-generation/push-upgrade-scheduling.md
canonical_url: https://developer.salesforce.com/docs/platform/pkg1-dev/guide/push-upgrade-scheduling.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 72f94c7da97a2b23c9446c7da710e374157c06a18f355a7916f20317401b777d
products:
  - First-Generation Managed Packaging Developer Guide
  - merged-docs
---

# Scheduling Push Upgrades

After you’ve created an updated version of your package, you can automatically deploy it to customers using a push upgrade.

| User Permissions Needed |                             |
| ----------------------- | --------------------------- |
| To push an upgrade:     | Upload AppExchange Packages |

1.  Push the upgrade to your own orgs so you can run tests and fix any bugs before upgrading subscribers.
2.  When you’re ready and have coordinated with your customers on their change management process, push to a small number of customer organizations. Try sandbox organizations first, if possible.
3.  After you’re comfortable with the initial results, push to your wider customer base, based on your agreements with each customer.
4.  Deprecate the previous version of your package in your main development organization. Replace the version on AgentExchange if necessary, and update your Trialforce setup.
5.  If your upgrade was a patch, after you’ve successfully distributed the upgrade to subscriber organizations, reintegrate those changes into your main development organization. For more information about combining patches in the main development organization, see [Working with Patch Versions](https://developer.salesforce.com/docs/platform/pkg1-dev/guide/packaging-patches-about.md).

**note:** Partners can also grant select customers the ability to block push upgrades by setting up customized push upgrades. See [Enable a Package Subscriber to Restrict Push Upgrades](https://developer.salesforce.com/docs/platform/pkg1-dev/guide/push-upgrade-customized.md) for more information.

## Schedule a Push Upgrade Using the UI

**note:** Only first-generation managed packages can schedule a push upgrade using the UI. To schedule a push upgrade for unlocked and second-generation managed packages, use the [PackagePushRequest](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_packagepushrequest.htm) in the _Salesforce Object Reference_.

1.  Log in to your main development org (not the patch org you used to upload the new version).
2.  From Setup, enter `Packages` in the Quick Find box, then select **Packages**.
3.  Click the name of the managed package whose upgrade you want to push.
4.  On the package detail page, click the **Versions** tab, and then click **Push Upgrades**.
5.  Click **Schedule Push Upgrades**.
6.  Select a package version to push from the **Patch Version** dropdown list.

    **note:** Beta versions aren’t eligible for push.

7.  For the scheduled start date, enter when you want the push upgrade to begin.

    **note:** Scheduled push upgrades begin as soon as resources are available on the Salesforce instance, which is either at or after the start time you specify. In certain scenarios, the push upgrade could start a few hours after the scheduled start time.

8.  In the Select Target Organizations section, select the orgs to receive your push upgrade. If an org already received a push upgrade for the selected package version, it doesn’t appear in this list. You can select orgs by:


    -   Entering a term that filters based on an org’s name or ID. Names can match by partial string, but IDs must match exactly.
    -   Choosing between production and sandbox orgs from the **Organizations** dropdown list.
    -   Choosing orgs that have already installed a particular version.
    -   Clicking individual orgs or the **Select All** and **Deselect All** checkboxes.
    This section lists the following information about the org (in alphabetical order):

    |Field|Description|
    |-----|-----------|
    |Current Version|The current package version an organization has installed.|
    |Organization ID|The ID of the org.|
    |Organization Name|The name of the org. To view the upgrade history for the org, click the org name.|
    |Primary Contact|The name of the user who installed the package.|

9.  Click **Schedule**. While a push upgrade is in progress, you can click Abort to stop it.

## Schedule a Push Upgrade Using the Enterprise API

1.  Authenticate to your main development org (not the patch org you used to upload the new version).
2.  Determine the package version you want to upgrade subscribers to by querying the MetadataPackageVersion object.
3.  Gather the list of subscriber orgs that are eligible to be upgraded by querying the PackageSubscriber object.

    **note:** If you’re retrieving more than 2,000 subscribers, use SOAP API [`queryMore()`](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_querymore.htm) call.

4.  Create a PackagePushRequest object. PackagePushRequest objects take a PackageVersionId and, optionally, a ScheduledStartTime parameter to specify when the push begins. If you omit the ScheduledStartTime, the push begins when you set the PackagePushRequest's status to `Pending`.
5.  Create a PackagePushJob for each eligible subscriber and associate it with the PackagePushRequest you created in the previous step.
6.  Schedule the push upgrade by changing the status of the PackagePushRequest to `Pending`.
7.  Check the status of the PackagePushRequest and PackagePushJob objects by querying the Status fields. If the status is either Created or Pending, you can abort the push upgrade by changing the status of the PackagePushRequest to Canceled. You can’t abort a push upgrade that has a status of Canceled, Succeeded, Failed, or In Progress.

    **note:** If you’re pushing the upgrade to more than 2,000 subscribers, use the [Bulk_API](https://developer.salesforce.com/page/Bulk_API) to process the job in batches.

For sample code and more details, see _SOAP API Developer Guide_.
