Deploy a Community (Digital Experiences)

Key Points:

  1. You cannot deploy a community across mismatched Salesforce versions (i.e. Summer ‘21 > Winter ‘21)!
  2. Selecting the same domain name, site name, and template when enabling communities will help you avoid extra work and deployment failures.
  3. Choose a deployment path:
    1. SiteDotCom:
      1. There is a file size limitation of this binary file when using the Metadata API to deploy it - the assets in the .site file can’t be larger than 40 MB
      2. The site gets created, but the assets show in the new site as broken
      3. To fix the assets, export the assets from the source sandbox separately and then import them into your new site
      4. Overview: 
        1. https://help.salesforce.com/articleView?id=000323350&type=1&mode=1
    2. ExperienceBundle (Spring ‘20):
      1. Ensure Experience Bundles are enabled in your source and target environment
        1. Setup > Feature Settings > Digital Experiences > Settings:
          1. Select Enable ExperienceBundle Metadata API
          2. Enter a sub-domain name to match what you’ve entered in your source org, check availability and save your changes
        2. Overview: 
          1. https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_networks_developers_exp.htm
          2. https://developer.salesforce.com/docs/atlas.en-us.communities_dev.meta/communities_dev/networks_migrating_from_sandbox.htm
        3. Some helpful tips that may be worth reviewing:
          1. https://www.foxy-solutions.com/salesforce/community-deployment-experiencebundle
          2. https://slacker.ro/2020/02/24/experiencebundle-salesforce-dx-a-developers-dream-for-coding-lighting-communities
  4. Although MDAPI support has improved over the years, Communities are still not 100% deployable (as of Jan 2021)
    1. Not currently supported:
      1. Some administrative settings
      2. Topics
      3. Moderation criteria
  5. Follow these steps to deploy the maximum amount of community components!

Prerequisites

(Dev Sandbox)
  1. Configure the community completely
    1. Ensure that you set default page variations for each page (Salesforce recommendation)
  2. Create an outbound change-set (for analysis purposes)
    1. The name cannot contain any spaces (We recommend using camel-case naming convention)
    2. Add the "Network" component only - then add all dependencies of "Network"
  3. Using Workbench or ANT, retrieve the change-set using the change-set's name
  4. After unzipping the package.zip, examine the contents to determine which components to include when selecting them in your Copado User Story
  5. Also, consider adding Profiles and Translations as needed
Note: Communities are comprised of three main critical components:
1 - Network: Metadata type that contains the community’s settings
2 - CustomSite: Metadata type that includes information about the page such as the domain, the URL, and the settings
3 - SiteDotCom: Metadata type that contains the site’s layout (binary file)
OR

3 - ExperienceBundle: Metadata type that contains the site’s layout (collection of JSON files) and replaces SiteDotCom

Pre-Manual Steps

(Target Org)
Record these steps as Deployment Tasks on your Copado User Story

  1. (Setup > Feature Settings > Digital Experience > Settings > "Experiences" > Enable Digital Experiences)
  2. Enable Communities (Digital Experiences) User-added image
  3. Enter a domain name
    1. Name the domain the same as your Dev org to avoid additional problems with dependencies based on the domain name
  4. Stub-out the community
    1. (Setup > Feature Settings > Digital Experience > All Sites > "Digital Experiences" > New)
    2. Choose the Experience You Love: (i.e. Customer Service) and click "Get Started"   User-added image 
    3. Enter a Name: <Home> and click "Create"User-added image
    4. After the community is created, click "Administration"
    5. Under Members, add the desired profiles
    6. Under Email, un-check "Send welcome email" if you don't want notifications to go out automatically to all members when you active later  
User-added image

Note: It's very important to set the domain name, site name, and template to the same values as constructed originally in your Dev org

Copado Deployment

(Copado Governance Org)
  1. Add all the components identified previously to your User Story
  2. Validate the deployment by doing a check-only deploy
    1. It's possible that you may need to fix a couple of dependencies (i.e. missing users in the target org, fix some profile bits, etc...)
      1. Network component
        1. You may need to remove profiles that don't exist from the <networkMemberGroups> tag and/or <selfRegProfile> tag. You can accomplish this using YML (Global Find/Replace). Or, deploy them to the target first.
      2. CustomSite component
        1. <subdomain> - If you name your domains the same in each org, you won't have to alter this value. Otherwise, use Environmental Variables (with a scope of CustomSite/* or CustomSite/<specific_site>)
        2. <siteAdmin> - You may need to modify this or ensure the user exists in the target. If modifying, use Environmental Variables (with a scope of CustomSite)
    2. Depending on your site's content, you may need to add test classes to get your coverage high enough
    3. Deploy your User Story components to the target org once you've validated your User Story components

Review and Activation

(Target Org)
  1. (Setup > Feature Settings > Digital Experience > All Sites > "Digital Experiences" > [siteName URL]) User-added image
  2. After deployment, review your community to ensure you have moved everything you can
  3. Make a note of items that:
    1. Have been missed and determine if they can be deployed using metadata
    2. Need to be completed by hand (post-manual steps) and add these to your User Story as Deployment Tasks
  4. Complete any additional configuration
  5. Activate & Publish the Community
    1. (Setup > Feature Settings > Digital Experience > All Sites > "Digital Experiences" > Workspace: [siteName] > Administration > Settings > Activate) User-added image
    2. (Setup > Feature Settings > Digital Experience > All Sites > "Digital Experiences" > Builder: [siteName] > Publish [top-right] > Publish)                             User-added image        
 
​​​​​​




 


How did we do?