App Deployment
Moving metadata
Deployment is getting configuration from a source org to a target. Sandboxes come in four flavors: Developer (small data, one-day refresh), Developer Pro (more storage), Partial Copy (a template sample of data, refreshed every five days), and Full (all data, refreshed every 29 days). Change sets move metadata between related orgs: outbound from a sandbox to production or to another sandbox, never from production. Components must be added along with their dependencies, and a change set cannot delete anything; deletion needs a destructive changes manifest through the Metadata API or a deployment tool.
Packages and pipelines
Unlocked packages support repeatable, modular releases; managed packages are for AppExchange distribution; second-generation packaging adds source tracking. The Metadata API, Salesforce CLI, and DevOps Center automate what change sets do by hand. Always validate in a sandbox, test in staging, and deploy with a rollback plan.
Traps
- Believing change sets can delete components.
- Trying to send a change set from production down to a sandbox.
- Forgetting a profile in a change set carries all its permissions and can overwrite the target.
- Assuming a Full sandbox refreshes as often as a Developer sandbox.
- Overlooking settings that are excluded from change sets and must be recreated manually.
Worked example
Releasing a custom object with a validation rule, a flow, and a Lightning page: add the object, use Add Dependencies to pull in fields, flow, and page, grant field access through permission sets rather than profiles, validate the deployment, then deploy and manually recreate anything excluded.