I have a salesforce community site, and it is built off mostly visual force pages and apex classes. I would like to move the 'application' into sfdx. I am able to, with a little coaxing, deploy the classes, packages... etc to my scratch orgs. But not the community itself or any of the community configs through sfdx.

My main objective is to be able to standup a scratch org with my app automatically.

  • I'm being Mr Obvious here, but... have you added the right features in the scratch org? I'm looking at you, Communities... Commented Apr 13, 2018 at 21:45
  • 1
    Did you deploy "CommunityTemplate" and "Network" metadata?
    – steals
    Commented Apr 14, 2018 at 6:47

1 Answer 1


I believe this is possible with shape-based Scratch orgs.. and as the comments stated, you need to have "features":["Communities",...] declared in your project-scratch-def.json

I have a multi-layered (multiple packageDirectories) sfdx-project.json that is deploying to my shape-based Scratch org

sfdx progress bars from my VS Code

The last progress bar shown in the screenshot is the communities portion of my metadata (I'm getting 1 error related to my siteDotComSites/My_Corporate_Portal1.site file)

So, I've deployed this specific packageDirectory directly to another sandbox with zero errors (so that's almost an answer to your original question) and hopefully will get this totally licked before the day is over and will update my answer.


I don't believe I can deploy the production .site file I spoke of above (if it's in production) so I marked it (and the .site-meta.xml) in my .forceignore. I have a similar one I use in sandbox and scratch orgs that seems to deploy just fine. So, with that wrapped up, my communities metadata is deployable to a scratch org (immediately after deployment I get welcome emails, and the whole nine-yards)

You may need to also pull down your email templates. I used the manifest/package.xml to right-click and retrieve source from my production org

This is what I used to get my templates to come down:

<Package xmlns="http://soap.sforce.com/2006/04/metadata">

If you have a logo or site footer graphic, you may have to pull that into your contentassets directory. This may work in manifest/package.xml...

<Package xmlns="http://soap.sforce.com/2006/04/metadata">

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .