How to Deploy a Community

Migrating communities from one environment to another is a complex process that involves some manual steps. In this article we will provide useful insights into the deployment of a community to production with Copado, using the Metadata API.

First of all, if you are deploying a community to an org for the first time, you will need to enable communities in that Org. To do this, follow the steps below:

  1. Navigate to Setup.
  2. Go to Feature Settings and click on Communities.
  3. Click on Communities Settings and enable the Enable communities checkbox.

    User-added image
  4. Enter a Domain name and click on Save.
Note: Make sure you use the same domain name you used in your sandbox to avoid errors.

A community is composed of three metadata types:
  • Network: Metadata type that contains the community’s settings.
  • CustomSite: Metadata type that includes information about the page such as the domain, the URL and the settings.
  • SiteDotCom: Metadata type that contains the site’s layout.


To deploy the metadata from one org to another, you can use Copado Developer application.

  1. Manually create the new community in the target org with the same parameters (domain, name, template)

    Note: When you create a new community, there are a few default pages that are provided by Salesforce such as login, self-registration, change password, forgot password and home pages. The look and feel of these pages will vary depending on the template you choose to create the community, but you can customize them as you wish.
  2. Use Copado Developer application to retrieve the different metadata types and deploy them from one org to another.
    1. Create a User Story record and commit the metadata types.
    2. Check the Promote & Deploy checkbox. Copado will trigger the creation of a Promotion and a Deployment record and will execute the deployment.
    Tip: You can leverage Copado’s environment variables feature to deploy URL sites from one environment to another. For more information, please check out the article Environment Variables.
Deploying Changes to an Existing Community

If you just want to implement some changes in a community you have previously created, you can use Copado Developer​​​​​​​ application to commit and deploy just the changes you want to make following the same steps as above.

 


How did we do?