πŸš€

App Deployment

Sandbox types and lifecycle, Change Sets and deployment tools, managed vs unmanaged packages, and AppExchange.

⏱️ Estimated reading time: 40 minutes

Sandbox Types and Development Lifecycle

Sandboxes are copies of the production environment used for development, testing, and training without affecting real data.

The 4 Sandbox types:

TypeWhat it copiesStorageRefreshMain use case
DeveloperMetadata only (configuration)200 MB1 dayIndividual development
Developer ProMetadata only (more storage)1 GB1 dayTeam development or unit testing
Partial CopyMetadata + template-selected data5 GB5 daysTesting with partial real data
FullEVERYTHING: metadata + all data + filesSame as production29 daysUAT, performance testing, staging

Important details per type:

Developer Sandbox:
- The lightest and fastest to create.
- Only copies configuration (objects, fields, flows, page layouts, etc.).
- Does NOT copy any data (records).
- Ideal for isolated individual development.

Developer Pro Sandbox:
- Similar to Developer but with more storage (1 GB vs 200 MB).
- Ideal when multiple developers work on the same project.
- Also doesn't copy data.

Partial Copy Sandbox:
- Copies metadata + a data subset defined by a Sandbox Template.
- The template defines which objects to include and how many records per object.
- Ideal for testing with real data without copying EVERYTHING.
- Maximum 5 GB of data.

Full Sandbox:
- Copies ABSOLUTELY EVERYTHING: metadata, data, file attachments.
- Can take hours or days to create depending on volume.
- Minimum refresh: 29 days between updates.
- Used for: UAT (User Acceptance Testing), performance testing, pre-production staging, training with real data.
- Most expensive in terms of licensing.

Recommended development lifecycle:
Developer Sandbox β†’ Developer Pro β†’ Partial Copy β†’ Full β†’ Production
(Development) (Integration) (QA/Testing) (UAT) (Live)


Sandbox Refresh:
- Refreshing a sandbox completely replaces it with a new production copy.
- All unmigrated changes are lost.
- Refresh intervals are minimums, not fixed β€” you can wait longer but not less.

Sandbox Login:
- Different URL: https://test.salesforce.com (not login.salesforce.com).
- Username: user@company.com.sandboxname.
- When creating a sandbox, only users with active permission are copied (with passwords reset).

🎯 Key Points

  • βœ“ Developer and Developer Pro: metadata only, NO data (1-day refresh)
  • βœ“ Partial Copy: metadata + template data (5-day refresh, max 5 GB)
  • βœ“ Full: EVERYTHING including data and files (29-day refresh)
  • βœ“ Refreshing a sandbox REPLACES everything β€” unmigrated changes are lost
  • βœ“ Sandbox login: test.salesforce.com with username user@company.com.sandboxname
  • βœ“ Full Sandbox is the only one suitable for UAT and performance testing

Change Sets and Deployment Tools

Change Sets are Salesforce's native tool for migrating metadata (configurations) between connected environments.

Fundamental concepts:

Outbound Change Set:
- Created in the SOURCE environment (e.g., Developer Sandbox).
- Components to migrate are selected (objects, fields, flows, page layouts, profiles, etc.).
- Uploaded to the target environment.
- The Add Dependencies button automatically analyzes what additional components your selection needs.

Inbound Change Set:
- Appears in the TARGET environment after upload.
- An administrator must manually Deploy the Change Set.
- Before deploying, can run Validate to verify no errors without making actual changes.
- Deploy can include: Run default tests, Run specified tests, Run local tests, Run all tests.

Critical Change Set rules (asked on the exam):
1. Only work between connected environments (sandboxes from the same production org).
2. They are unidirectional β€” sent from source, received at target.
3. Only migrate metadata, NEVER data (records).
4. Do NOT migrate: Custom Settings data, users, record data, complete profiles (only specific profile changes are migrated).
5. Components are overwritten in the target (not merged).
6. Destructive changes (deleting components) CANNOT be done with Change Sets.

Connection Settings:
Before using Change Sets, environments must be connected. Configured in: Setup > Deploy > Deployment Settings. Each environment must explicitly allow receiving Change Sets from other environments.

What components can be included in a Change Set?
- Custom Objects, Custom Fields, Page Layouts, Record Types.
- Flows, Validation Rules, Formula Fields.
- Profiles (partial: only permissions for included components), Permission Sets.
- Lightning Pages, Quick Actions, Custom Buttons.
- Apex Classes, Apex Triggers, Visualforce Pages, LWC.
- Reports, Dashboards, Email Templates.
- Custom Metadata Type Records (yes, they migrate!).

Other deployment tools:

ToolTypeMain use
Change SetsDeclarative (UI)Simple migrations between connected sandboxes
Salesforce CLI (sf/sfdx)Command lineModern development, CI/CD, Scratch Orgs
Metadata APIProgrammatic APIDeployment automation, third-party tools
Packages (Managed/Unmanaged)PackagedSolution distribution
VS Code + Salesforce ExtensionsIDEDevelopment with metadata retrieval and deployment

Salesforce CLI and Salesforce DX:
- Modern development approach based on source control (Git).
- Uses Scratch Orgs (temporary environments) instead of Developer Sandboxes.
- Enables CI/CD pipelines (continuous integration / continuous deployment).
- Not deeply required for the PAB exam, but you should know it exists.

🎯 Key Points

  • βœ“ Change Sets: only between connected environments (same org), metadata only, unidirectional
  • βœ“ Outbound = from source; Inbound = at target (requires manual admin Deploy)
  • βœ“ Add Dependencies: automatically analyzes required components
  • βœ“ Change Sets do NOT migrate: record data, Custom Settings data, destructive changes
  • βœ“ Custom Metadata Type Records DO migrate with Change Sets (unlike Custom Settings)
  • βœ“ Validate before Deploy to verify without making actual changes

Managed vs Unmanaged Packages and AppExchange

Packages are containers of Salesforce components that can be distributed and installed in other organizations.

Unmanaged Packages:
- Components are installed as independent copies in the target org.
- Once installed, they can be freely modified (editable).
- Do NOT support upgrades β€” no way to update already installed components.
- The creator loses control over components after installation.
- Ideal for: configuration templates, starter kits, metadata transfer between unconnected orgs.

Managed Packages:
- Components are protected (obfuscated Apex code, locked components).
- The creator (ISV) maintains control and intellectual property.
- Support upgrades: Updates can be sent to installed orgs.
- Can be published on AppExchange after passing Security Review.
- Installed components CANNOT be modified by the user (except exposed configurations). They have a unique namespace prefix.
- Ideal for: ISVs (Independent Software Vendors), commercial app distribution.

Comparison table:

FeatureUnmanagedManaged
Editable componentsβœ… Yes (after install)❌ No (protected/locked)
Supports upgrades❌ Noβœ… Yes
IP protection (code)❌ Noβœ… Yes (obfuscated)
Namespace prefix❌ Noβœ… Yes (required)
AppExchange❌ Generally noβœ… Yes
Uninstallβœ… (removes everything)βœ… (removes everything)
Ideal forTemplates, transfer between orgsCommercial distribution, ISVs

Second-Generation Packaging (2GP):
- More modern managed packaging model.
- Compatible with Salesforce DX and source-driven development.
- Supports semantic versioning and better dependency control.
- Not a deep PAB exam topic, but you should know it exists.

AppExchange publishing process:
1. Develop the solution in a Developer Org.
2. Create a Managed Package with all components.
3. Submit the package for Salesforce Security Review.
4. Once approved, list on AppExchange.
5. Customers install from AppExchange.
6. Push upgrades when new versions are available.

Package installation:
- Installed using an installation URL or from AppExchange.
- When installing, choose: Install for Admins Only, Install for All Users, or Install for Specific Profiles.
- Dependencies must be satisfied before installation.

Key concept: If asked "how to distribute a solution to unconnected orgs" β†’ the answer is a Package (not Change Sets, which require connected environments).

🎯 Key Points

  • βœ“ Unmanaged: editable after install, no upgrades, no code protection
  • βœ“ Managed: protected (locked), support upgrades, required namespace prefix
  • βœ“ To distribute to unconnected orgs β†’ Packages (Change Sets only between connected environments)
  • βœ“ AppExchange requires Managed Package + Salesforce Security Review
  • βœ“ When installing a package, choose access level: Admins Only, All Users, or Specific Profiles
  • βœ“ Managed Packages protect intellectual property β€” obfuscated Apex code