Sub topic 7
Uploading the change set
This chapter assumes you can build an outbound change set and have an authorized deployment connection to the target org. It covers what happens when you upload, what to check first, and what to do when the upload fails.
What uploading does
An outbound change set is only a list of components until you upload it. Uploading copies the metadata for each listed component to the target org. After that, the change set appears there as an inbound change set. Nothing is deployed yet. The upload only delivers the package.
Two rules follow from this:
- You can upload only to an org that has a deployment connection with the source org, and the connection must allow the direction you need. A sandbox can send to production, but production cannot send to a sandbox through the same path unless the connection allows it.
- You cannot edit a change set after you upload it. To change the contents, clone it, adjust the clone, and upload the clone.
Before you upload
Check these items in the source org:
- Open the change set and review the Change Set Components list.
- Click View/Add Dependencies and add the components it suggests. Missing dependencies are the most common cause of a failed deployment later.
- Confirm the description is useful. The reviewer in the target org sees only this text and the component list.
If you want a second view of what is in the package, you can retrieve the same components from the sandbox with the Salesforce CLI and compare them with the list.
sf project retrieve start --manifest manifest/package.xml --target-org MySandboxSteps to upload
- In the source org, go to Setup, enter Outbound Change Sets in Quick Find, and select it.
- Click the name of your change set.
- Click Upload.
- Select the target org from the list and click Upload.
- Wait for the confirmation message. The status in the Change Set History section shows the upload result.
When the upload takes time
Large change sets can take a while to arrive. The change set shows a status such as Upload in progress. It does not show in the target org's inbound list until the upload finishes, so refreshing the target org early can mislead you into thinking it failed.
Common upload problems
| Symptom | Likely cause | What to do |
|---|---|---|
| The target org is not in the upload list | No deployment connection, or the connection does not allow this direction | Check **Deployment Settings** in the target org and authorize the connection |
| Upload is blocked | The change set contains a component type that change sets do not support | Remove it and move it by another method |
| Change set is not visible in the target org | Upload still running, or you are viewing the wrong org | Check the status in **Change Set History**, then look under **Inbound Change Sets** |
| Old content arrives | You uploaded before adding a late change | Clone, update, and upload again |
Exercise
You uploaded a change set and then realized you left out an Apex class that a flow calls. The change set is already in production's inbound list. What should you do?
Show answer
Go back to the source org, clone the uploaded change set, add the Apex class (and use View/Add Dependencies to catch anything else missing), and upload the clone. You cannot edit the original after upload. Then validate and deploy the new inbound change set in production, and ignore or leave the first one undeployed.