Experience Cloud Deployment Dev
This skill activates when a practitioner needs to script or automate the migration of an Experience Cloud site between Salesforce orgs using the Metadata API or Salesforce CLI. It guides selection of the correct metadata type for the site's runtime (Aura vs. enhanced LWR), diagnoses silent retrieval failures caused by missing ExperienceBundleSettings, handles the CMS content exclusion gap, and documents the post-deployment manual steps that no metadata type captures.
Before Starting
Gather this context before working on anything in this domain:
- Site runtime type — Determine whether the site is Aura-based (uses the original Communities runtime) or enhanced LWR (Lightning Web Runtime, available from Summer '22). This is the single most important prerequisite: the wrong metadata type retrieves nothing silently or deploys to the wrong structure.
- ExperienceBundleSettings status — For Aura-based sites, ExperienceBundle retrieval only works if the
ExperienceBundleSettingsmetadata type is enabled in the org. Attempting to retrieve without it returns an empty result with no error. - CMS workspace content — Identify whether the site displays content managed through a CMS workspace (Managed Content / Digital Experiences CMS). This content is excluded from both ExperienceBundle and DigitalExperienceBundle and cannot be promoted via
sf project deploy. A deploy will exit 0 but the content will not appear in the target org. - Post-deployment configuration gaps — Domain URL bindings, custom domain certificates, SSO provider configuration, and CDN URL bindings are not captured by any Experience Cloud metadata type. Plan for manual post-deployment steps in every migration.
Questions to Ask Before Configuring
| Ask | Why it matters | What a good answer adds |
|---|---|---|
| Is the site Aura, LWR, or an enhanced LWR site created in Winter '23 or later? | Enhanced LWR sites deploy as DigitalExperienceBundle; Aura and other LWR sites use ExperienceBundle, and the wrong one deploys a broken structure. | Fixes the bundle type, its directory and the sourceApiVersion floor before the first retrieve (Gotchas 1 and 5). |
| For an Aura site, is enableExperienceBundleMetadata true in ExperienceBundle.settings in both source and target? | With the setting off, a retrieve can come back with no site files while still reporting success. | Adds Settings:ExperienceBundle to the manifest and a pre-retrieve check in CI (Gotcha 1). |
| Does any page show content from a CMS workspace? | Managed content in a non-enhanced CMS workspace is data, not metadata, so a clean deploy leaves those content zones empty; enhanced CMS general workspaces can travel as DigitalExperienceBundle (api_meta.txt L51125). | Plans a separate CMS export/import or API migration in the release (Gotcha 2). |
| Does the site use custom CMS content types? | ContentTypeBundle is a separate metadata type that the site bundle does not include. | Adds the content types to the deploy before or with the site bundle (Gotcha 6). |
| Who activates and publishes the site in the target after each deploy, and how? | A clean deploy can leave the site offline or showing its previous version. | Makes activation and publish a scripted or named runbook step (Gotcha 3). |
| Does the site use a custom domain, single sign-on, or a CDN? | None of these bindings travel in any Experience Cloud metadata type. | Adds a post-deploy section for domain, SSO and CDN setup in each target (Gotcha 4). |
| Will full-site deploys be tested in scratch orgs or in a sandbox? | Enhanced LWR site deploys into scratch orgs have known gaps and can fail or half-render. | Uses scratch orgs for components and a sandbox for full-site deploy tests (Gotcha 5). |
A proper configuration settles the runtime type, the settings flag and the content outside metadata before scripting, so a pipeline run that reports success has actually delivered a working site.
Core Concepts
ExperienceBundle vs. DigitalExperienceBundle — The Runtime Split
Salesforce maintains two separate metadata types for Experience Cloud sites, split by the site's underlying runtime:
- ExperienceBundle (API v46+) — used for Aura-based sites (Classic, Customer Service, Partner Central templates, and similar). Must be explicitly enabled by deploying
ExperienceBundleSettingswithenableExperienceBundleMetadataset totruebefore any retrieve/deploy of site bundles will work. - DigitalExperienceBundle (API v56+, api_meta.txt L51223; for enhanced LWR sites created in Winter '23 or later, L51233) — used for enhanced LWR sites (Build Your Own LWR, Microsites, Help Center, and other LWR-native templates). Has a different directory structure: workspace folders under
digitalExperiences/site/, each holding content-type folders such assfdc_cms__routeandsfdc_cms__view(api_meta.txt L51134-L51135, L51215-L51217) instead of the ExperienceBundleexperiences/layout.
Using the wrong type is the most common mistake: deploying an enhanced LWR site's files into an ExperienceBundle structure produces a deployment that completes with no errors but renders incorrectly or not at all.
ExperienceBundleSettings Prerequisite
ExperienceBundle retrieval is gated behind an org-level feature flag. The metadata type ExperienceBundleSettings (a singleton Settings metadata) must exist in the project and be deployed first to enable the bundle-based retrieve/deploy workflow. Without it, sf project retrieve start --metadata ExperienceBundle completes successfully but returns zero components. This behavior is documented in the Salesforce Metadata API Developer Guide and is one of the most frequently misdiagnosed silent failures in Experience Cloud deployments.
To enable it, include in package.xml:
<types>
<members>ExperienceBundle</members>
<name>Settings</name>
</types>
The member is ExperienceBundle because the settings file is named ExperienceBundle.settings (api_meta.txt L115883). Ensure the retrieved ExperienceBundle.settings file has <enableExperienceBundleMetadata>true</enableExperienceBundleMetadata>.
CMS Managed Content Is Not Deployable via Metadata API
Content created in a CMS workspace (Digital Experiences CMS, accessible from the CMS Workspaces app) is stored as Managed Content records, not as metadata. The site's own bundle does not include this content. Exception: content in an enhanced CMS general workspace is metadata — DigitalExperienceBundle supports the general workspace type for Salesforce CMS (api_meta.txt L51125, L51133). A deployment that omits CMS content will exit with code 0 (success) but the content will not appear in the target org — no warning is issued.
The two supported options for CMS content migration are:
- CMS export/import — Export a content collection from the source org (Setup > CMS Workspaces > Export) and import it in the target org. Manual and error-prone for large volumes.
- Managed Content REST API — The
connect/cms/contentsREST API can be used to script content creation in the target org, but it requires custom scripting outside the standard CLI deployment flow.
Network Metadata and Deployment Ordering
The Network metadata type represents the community/site record configuration (active status, guest profile, login page, etc.). It is a separate metadata type from ExperienceBundle. Deploying ExperienceBundle without the corresponding Network record in the target org will create an orphaned site bundle. The correct deployment order is: (1) ExperienceBundleSettings, (2) Network, (3) ExperienceBundle or DigitalExperienceBundle.
Common Patterns
Pattern 1: Deploy an Aura-Based Experience Cloud Site
When to use: Migrating a site built on the Aura runtime (Customer Service, Partner Central, Salesforce Tabs + Visualforce, or similar legacy templates) from sandbox to production.
How it works:
- Verify
ExperienceBundleSettingsis enabled in the target org or include it in the deployment. - Construct a
package.xmlthat includesSettings:ExperienceBundle,Network:<SiteName>, andExperienceBundle:<SiteName>. - Retrieve from the source org:
```bash
sf project retrieve start \
--metadata "Settings:ExperienceBundle" \
--metadata "Network:My_Site" \
--metadata "ExperienceBundle:My_Site" \
--target-org source-sandbox
```
- Review the retrieved bundle under
force-app/main/default/experiences/My_Site.site/. - Deploy to the target org with the same component set.
- Execute post-deployment manual steps (domain, SSO, CDN).
Why not the alternative: Retrieving only ExperienceBundle without ExperienceBundleSettings returns empty results. Deploying without the Network record creates an orphaned bundle with no associated site configuration.
Pattern 2: Deploy an Enhanced LWR Site
When to use: Migrating a site built on the LWR runtime (Build Your Own LWR, Microsites, Help Center, or any template marked "Enhanced" in Experience Builder) from sandbox to production.
How it works:
- Confirm the site is LWR-enhanced (check in Experience Builder: Settings > Advanced > Site Runtime shows "Enhanced LWR").
- Construct a
package.xmlwithDigitalExperienceBundle:<SiteName>andNetwork:<SiteName>. - Retrieve from the source org:
```bash
sf project retrieve start \
--metadata "DigitalExperienceBundle:My_LWR_Site" \
--metadata "Network:My_LWR_Site" \
--target-org source-sandbox
```
- Review the retrieved bundle under
force-app/main/default/digitalExperiences/site/My_LWR_Site/. - Deploy to the target org. Activate the site manually in Experience Builder if it deploys in inactive state.
- Execute post-deployment manual steps.
Why not the alternative: Using ExperienceBundle for an enhanced LWR site does not retrieve it; non-enhanced LWR sites, by contrast, do use ExperienceBundle (api_meta.txt L51233-L51234, L59902-L59903). The underlying file structure differs — DigitalExperienceBundle uses workspace and content-type folders (sfdc_cms__route, sfdc_cms__view) that ExperienceBundle does not have.
Pattern 3: CI/CD Pipeline for Experience Cloud Sites
When to use: Setting up a repeatable automated pipeline that deploys Experience Cloud site changes alongside Apex, LWC, and other metadata.
How it works:
- In
sfdx-project.json, setsourceApiVersionto 56.0 or higher to support DigitalExperienceBundle. - Add a pre-deploy step that checks ExperienceBundleSettings is enabled in the target org (for Aura sites).
- Deploy in the correct order: shared metadata first, then ExperienceBundleSettings, then Network, then the site bundle.
- Add a post-deploy step script that calls the Managed Content REST API to sync CMS content if the site uses a CMS workspace.
- Run a smoke-test step that fetches the site's public URL and checks for a non-5xx response.
Why not the alternative: A single-step sf project deploy start --manifest package.xml for all metadata does not guarantee the correct deployment order and may fail if ExperienceBundleSettings is not already active in the target org.
Decision Guidance
| Situation | Recommended Approach | Reason |
|---|---|---|
| Site is Aura-based (Customer Service, Partner Central, etc.) | Use ExperienceBundle + ExperienceBundleSettings | DigitalExperienceBundle does not support Aura runtime sites |
| Site is enhanced LWR (Build Your Own LWR, Microsites, Help Center) | Use DigitalExperienceBundle | ExperienceBundle retrieves nothing for LWR sites |
| Unsure of runtime type | Check Experience Builder > Settings > Advanced > Site Runtime | Avoids silent failures from wrong metadata type |
| Site uses CMS workspace content | Plan CMS export/import or Managed Content REST API script in addition to metadata deploy | CMS content is not included in either metadata type |
| Post-deploy site is inactive | Manually activate in Experience Builder or use sf community publish CLI command (UNVERIFIED (2026-10-19): confirm with --help) | Site status is not reliably deployed by metadata |
| Scratch org development | Use DigitalExperienceBundle only; ExperienceBundle has known scratch org support gaps | Avoid inconsistent behavior in scratch orgs with Aura sites |
| Target org missing custom domain or CDN config | Document as post-deployment manual step in release runbook | Domain/CDN config is not captured in any metadata type |
Recommended Workflow
Step-by-step instructions for deploying an Experience Cloud site:
- Identify the site runtime — In Experience Builder for the source site, navigate to Settings > Advanced and note the Site Runtime value. "Aura" means use ExperienceBundle; "Enhanced LWR" means use DigitalExperienceBundle. This step cannot be skipped.
- Verify ExperienceBundleSettings (Aura sites only) — Attempt a test retrieve of
Settings:ExperienceBundle. If the retrieve returns empty, the feature is not yet enabled. Deploy the settings metadata to activate it in the source and target orgs before proceeding. - Build the component list and deploy order — Construct the full component list: ExperienceBundleSettings (Aura only), shared LWC/Apex dependencies, Network record, and the site bundle. Document the required deployment order.
- Retrieve from source — Run
sf project retrieve startwith the correct metadata type. Inspect the retrieved file structure to confirm the bundle directory is non-empty before proceeding. - Assess CMS content — Determine whether the site uses CMS workspace content. If yes, create a parallel CMS migration plan using export/import or the Managed Content REST API. Document this as a separate runbook step.
- Deploy to target — Execute the deployment in the correct order. Monitor for partial success states — Experience Cloud deployments can return 0 exit codes even when post-activation steps are required.
- Execute post-deployment manual steps — Configure domain bindings, CDN URLs, SSO providers, and guest user profile settings in the target org. Verify the site is active and publicly accessible. Document completed steps in the release runbook.
Review Checklist
Run through these before marking work in this area complete:
- [ ] Site runtime type (Aura vs. enhanced LWR) confirmed and correct metadata type selected
- [ ] ExperienceBundleSettings enabled in both source and target orgs (Aura sites only)
- [ ] Retrieve from source org returns non-empty bundle directory
- [ ] Network metadata record included alongside the site bundle in the deployment
- [ ] CMS managed content migration plan documented separately (if applicable)
- [ ] Deployment order enforced: shared dependencies > ExperienceBundleSettings > Network > site bundle
- [ ] Post-deployment manual steps completed and documented: domain config, SSO, CDN, site activation
Salesforce-Specific Gotchas
Non-obvious platform behaviors that cause real production problems:
- Wrong metadata type returns empty results with no error — Attempting to retrieve an enhanced LWR site using
ExperienceBundle(or vice versa) completes successfully with exit code 0 but returns zero components. There is no warning. The practitioner must know to check the retrieved directory for non-empty content before proceeding. - CMS deploy succeeds but content is invisible — A deployment that excludes CMS workspace content completes with exit 0 and no warnings. The site loads but content zones are empty in the target org. This is the most common Experience Cloud deployment gap reported by practitioners.
- ExperienceBundleSettings must be deployed before ExperienceBundle can be retrieved — This is a sequencing constraint that is not obvious from the metadata type names. Many teams discover it after spending hours debugging empty retrieve results. The setting must be active in the org, not just in the project files.
- Site activates in a deactivated state after deployment — The
Networkmetadata record may deploy the site in an inactive state even if it was active in the source org. The active/inactive toggle is often environment-specific and not reliably migrated. Manual activation in Experience Builder (orsf community publish) is required after every deployment. - DigitalExperienceBundle has limited scratch org support — Creating a scratch org with
DigitalExperienceBundlecomponents pre-loaded is not fully supported as of Spring '25. Scratch orgs are typically used for component development, not full LWR site deployment. Runningsf project deploy startwith DigitalExperienceBundle into a fresh scratch org can fail silently or produce an incomplete site structure.
Output Artifacts
| Artifact | Description |
|---|---|
| Metadata type selection rationale | Written record of whether ExperienceBundle or DigitalExperienceBundle is correct for this site and why |
| package.xml with deployment order | Component manifest including ExperienceBundleSettings, Network, and the correct site bundle type |
| CMS content migration plan | Documented approach for migrating CMS workspace content outside the standard metadata deploy |
| Post-deployment runbook | Step-by-step checklist for domain config, SSO, CDN, and site activation with responsible owners |
| Smoke test script | Shell or Node script that fetches the site's public URL and validates a 200 response after deployment |
Related Skills
- devops/metadata-api-coverage-gaps — Use when the Experience Cloud metadata type is behaving inconsistently or when CMS content gaps need to be documented in a formal coverage gap table
- devops/post-deployment-validation — Use for validating the deployed site and running post-deploy smoke tests after Experience Cloud deployment
- devops/pre-deployment-checklist — Use for the pre-deploy gate checks before any Experience Cloud site migration
- devops/cross-cloud-deployment-patterns — Use when the Experience Cloud site is part of a larger multi-cloud deployment that includes Sales Cloud, Service Cloud, or other metadata
- devops/scratch-org-management — Use when the Experience Cloud development workflow involves scratch org setup and known scratch org support gaps for LWR sites