I'm trying to deploy an Enhanced LWR Experience Cloud site from my source org to a target org using VS Code and Salesforce CLI. I'm facing an issue retrieving the DigitalExperienceBundle metadata.
Environment
- Site Name: Employee Portal1
- Framework: Lightning Web Runtime (LWR)
- Site Type: Enhanced LWR
- Metadata API version: 67.0
- Tool: VS Code / Salesforce CLI
Problem
In Experience Builder, the site is displayed as Employee Portal1, with Lightning Web Runtime and the Enhanced badge.
In my local Salesforce project, I have the following metadata:
- DigitalExperienceConfig/Employee_Portal12.digitalExperienceConfig-meta.xml
- ExperienceBundle/Employee_Portal1
- ExperienceBundle/Employee_Portal12
- Network metadata for Employee Portal and Employee Portal1
- CustomSite metadata for Employee_Portal and Employee_Portal11
However, the DigitalExperienceBundle folder is empty.
I have enabled Enable ExperienceBundle Metadata API in Setup → Digital Experiences → Settings.
When I run the following command:
sf project retrieve start --metadata "DigitalExperienceBundle:Employee_Portal12" --target-org <SOURCE_ORG_ALIAS>
I receive this warning:
Nothing retrieved
Entity of type 'DigitalExperienceBundle'
named 'Employee_Portal12' cannot be found
My DigitalExperienceConfig file contains this reference:
<space>site/Employee_Portal12</space>
During deployment, I also receive this error:
In field: space - no DigitalExperienceBundle named site/Employee_Portal12 found
Other deployment errors indicate missing Network references, an audience without criteria, and an unsupported emailDomainSubstitutionEnabled property in API version 67.0.
What I've tried
- Enabled ExperienceBundle Metadata API.
- Tried retrieving DigitalExperienceBundle using Salesforce CLI.
- Checked the local metadata folders in VS Code.
- Confirmed that the site is an Enhanced LWR site in Experience Builder.
Questions
- Why is Salesforce unable to find the DigitalExperienceBundle when the site exists in Experience Builder?
- Could the site have been created or migrated using the older ExperienceBundle metadata type?
- Is there a recommended way to retrieve or migrate an existing site from ExperienceBundle to DigitalExperienceBundle?
- Should I rename the existing target site and update its Custom URLs before deployment, as described in Salesforce's guidance for migrating non-enhanced LWR sites?
- How can I correctly deploy the LWR site with its DigitalExperienceConfig, Network, CustomSite, navigation menus, and branding metadata?
Any guidance or a working deployment example would be greatly appreciated. Thank you!
#Salesforce Developer #Trailhead Challenges #Trailhead
- If your local Salesforce CLI or sfdx-project.json file defaults to an API version lower than the org's current release, the CLI fails to map the enhanced LWR architecture correctly.
- The string you pass to the CLI or put in the <members> tag of your manifest must be the unique API Name (DeveloperName) of the site workspace, which is frequently different from the user-facing site name.
- Retrieving a DigitalExperienceBundle strictly by name directly from the CLI command can occasionally miss mappings if local configuration tracking gets out of sync. A structured package.xml manifest forces the Metadata API to evaluate the package constraints directly.