Update: Salesforce has now rebranded communities as Digital Experiences. See our related support document for more information.
Deploying communities can be challenging, so much so that we wrote a blog post about it, which contains detailed technical guidance and troubleshooting.
There are several metadata types associated with communities. The
SiteDotCom metadata type is a binary blob that includes the content; that's where any community pages you've created will be. As standard, they won't appear as separate entries in the comparison results table within Gearset, and you'll need to deploy this metadata type to see your pages in the target.
However, you can export the pages in Salesforce, so you can treat them as separate entities and reuse them in different communities should you wish to:
If you've exported a page, it will show up in its own row on the Gearset comparison results page, with the
Lightning page metadata type. The community it belongs to will be at the start of the page name.
If you deploy an exported page variation, you will then need to manually add the page in the target by clicking on
new page variation:
Your exported page should appear as a pre-configured page for you to select:
Metadata types to include for deploying communities
Gearset has a
Default Experience Cloud comparison filter to make it easy to compare and deploy communities.
The filter includes the typical metadata types you need:
Site.com- The binary blob that contains the site content
Network (Community)- The community's settings
Custom site- The settings for the associated site
Network branding (Community branding)- The core of your community's branding, including colors and logos
Branding set- Additional assorted branding properties
Content asset- The metadata for an asset file, required for logos and header images
Other metadata types relevant to communities
Note that the
Default Experience Cloud comparison filter is designed for comparing and deploying communities when you already have your target set up for communities. If there are currently no communities in the target, you will need to add the following metadata types to your metadata filter, so that the 'Apex scaffolding' that Salesforce automatically generates for communities is included. For further details on this, see our blog post.
Lightning page metadata type, which you would use for exported community pages as described above, is also not included in the
Default Experience Cloud comparison filter, so would need to be added if required.
For more on custom metadata filters, see our support article.
Running communities under custom domains
When you set up a community, that community by default runs under a force.com domain (for example: mycompany.force.com). Salesforce explain how to run your community under a custom domain (for example: community.mycompany.com) in this knowledge article, which includes guidance on certificates.
If you try to deploy
CustomSitemetadata from an org with a certificate defined into an org without the certificate, the deployment is expected to fail. You would first need to get the identical certificate in the target org. This Salesforce Stack Exchange post explains how to do this.
If you are deploying the
Site.com(the binary blob that contains the site content) metadata, you may want to hit publish to see the changes in the front end UI.