Sub topic 13
What change sets cannot do
This chapter assumes you can build, upload, validate and deploy a change set, and that you know the difference between a production org and a sandbox. Here you will learn where change sets stop working. You will also learn how to spot those limits before they cost you a deployment window.
Change sets move metadata, nothing else
A change set carries metadata: object definitions, fields, flows, Apex classes and similar components. It never carries records. If your new flow depends on a Pricing Rule record, a custom setting value, or a list of Price Book entries, those rows must be created in the target org separately.
This also means a change set cannot copy the state of an org. It copies the definition of the components you picked, and the target org merges those definitions into whatever already exists.
Orgs that cannot exchange change sets
Change sets only work between orgs that are related. In practice that means a production org and its sandboxes, or sandboxes that share the same production org. Each pair also needs an authorized deployment connection.
The following cases are not supported:
- Two unrelated production orgs, such as two different companies or two business units with separate contracts.
- A Developer Edition org and your production org.
- A trial org and your production org.
- Scratch orgs, which are designed for source-driven development and do not use change set connections.
If your path is not in this list but still fails, check the connection in Setup under Deployment Settings. A connection that exists in one direction does not guarantee that the component you want can travel in that direction.
No deletions and no renames
A change set can add or update components. It cannot remove them. If you delete a field in the sandbox, nothing in the change set tells production to delete it. The field stays in production until an admin removes it by hand.
Renaming has the same problem. If you change the API name of a field in the sandbox and deploy it, the target org receives a new field with the new name. The old field remains. Records, reports and automation that used the old field are not moved over for you.
The practical rule is to treat deletions and renames as separate, manual tasks. Write them down in your release notes and perform them in the target org after deployment, once nothing references the old component.
Not every component can be added
The component list in the change set builder is limited to the types that the Metadata API supports for change sets. Some org-wide settings, some Setup pages, and some newer features have no entry in the list at all. When a component is missing from the picker, there is nothing to configure. You must repeat the setup by hand in the target org.
Some components deploy but do not behave like a full copy. Profiles are the usual example. A profile in a change set carries only the settings for the other components in that same change set, such as object permissions for an included object. It does not overwrite the whole profile in the target. Permission sets are usually a cleaner way to move access.
Flows are another example. Whether a flow arrives active or inactive depends on a deployment setting in the target org. Check the flow status after every deployment instead of assuming it matches the sandbox.
Dependencies are not always found for you
The View/Add Dependencies button adds components that your selected components reference directly. It cannot see every relationship. References built at run time, such as an Apex class that looks up a record type by name in a string, are invisible to it. A missing dependency then shows up as a validation error in the target org, or worse, as a runtime failure after deployment.
Every dependency must also exist in the target org or be in the change set. If the target org is a different sandbox that is out of date, it may lack a component that production has. Keep the sandboxes you deploy to refreshed or at least comparable.
Change sets are frozen after upload
After you upload an outbound change set, you cannot edit it. You can look at its contents but you cannot add or remove components. If you find a mistake, you clone the change set, fix the clone, and upload the new version.
Cloning is also how you send the same set of components to another target org. An uploaded change set is tied to the org it was sent to.
Everything is manual
Change sets live in the Setup user interface. They have no public API for creating or running them, so you cannot script a release, run one from a pipeline, or schedule it. Each step needs a person with the Deploy Change Sets permission to click through it.
This has three consequences:
- Releases are slow and hard to repeat. A deployment of 40 components to three orgs means three manual passes.
- There is no review step. Nobody sees a diff of what changed before it is deployed.
- There is no source of truth. A change set is a one-time package, not a record of what your org should contain.
No rollback
Deploying a change set does not create a restore point. If a deployment goes wrong, you cannot undo it with a button. You must build a new change set that contains the previous versions of the components, and that only works if you still have those versions. Change sets cannot give you that history.
Before any production deployment, save the current production versions of the components you are about to replace. You can do that with a retrieve command using the same manifest that describes the components.
sf project retrieve start --manifest manifest/package.xml --target-org MyProductionCommit the retrieved files somewhere safe. If you must roll back, you will have the old definitions to deploy from another tool.
Size, time and test limits
A single deployment has documented limits on the number of files and on total size. Large change sets can approach them, and Salesforce can change the exact numbers, so check the current limits in the Salesforce documentation if you move thousands of components at once.
A deployment to production also runs Apex tests, and a long test run delays the whole deployment. A change set that contains only a label change can still take a long time if the org runs all local tests. Plan your release window around the test run, not around the number of components.
Summary of limits and responses
| Limit | What happens | Typical response |
|---|---|---|
| Metadata only | Records do not move | Load data with Data Loader or an import tool |
| Related orgs only | Unrelated orgs cannot connect | Use the Metadata API or a CLI deploy |
| No deletions | Removed components stay in the target | Delete by hand, or use a destructive manifest |
| No renames | The new name arrives as a new component | Plan a manual migration of data and references |
| Unsupported types | Component is not in the picker | Configure manually in the target org |
| Frozen after upload | Mistakes need a clone | Clone, fix, upload again |
| Manual only | No automation | Use the CLI or a CI/CD tool |
| No rollback | No built-in undo | Back up the target metadata first |
Doing a deletion outside change sets
When a deletion is required, the Salesforce CLI can do it with a destructive changes manifest. This is one of the main reasons teams add the CLI alongside change sets.
First, a destructive manifest that lists the component to remove:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Invoice__c.Legacy_Code__c</members>
<name>CustomField</name>
</types>
<version>61.0</version>
</Package>Then a deploy command that runs it after the main deployment. The package.xml named in --manifest can list only the version and no types if you want a deletion-only deployment.
sf project deploy start --manifest manifest/package.xml --post-destructive-changes manifest/destructiveChanges.xml --target-org MySandboxRun this against a sandbox first. A deleted field also deletes its data, so confirm that nothing else uses it.
Choosing what to do next
Use the questions in the diagram to decide whether a change set is still the right tool for a given release.
The chapter on alternatives covers those other tools in detail. For now, the point is that each limit above has a known response, and none of them requires abandoning change sets for every release.
Exercise
Exercise
You renamed the API name of a custom field in your sandbox from Region_c to SalesRegion__c, added it to a change set, and deployed it to production. What do you find in production, and what must you do next?
Show answer
Production now has the new field SalesRegionc, and the old Regionc field is still there, because change sets cannot rename or delete components. The new field is empty. You must copy the data from Regionc to SalesRegion_c, update reports, flows and Apex that reference the old name, and then delete Region_c by hand or with a destructive manifest once nothing uses it.
Exercise
A teammate wants to deploy a change set from a Developer Edition org to your production org. Why will this not work, and what could they use instead?
Show answer
Change sets only work between related orgs, such as a production org and its sandboxes. A Developer Edition org is not related to your production org, so no deployment connection can be authorized. They can retrieve the metadata and deploy it with the Salesforce CLI or the Metadata API, which do not require related orgs.