How I can retrieve “Community” metadata in Salesforce and will make to deploy for example to QA org. Need I create community/site in QA with equal site name how in DevOrg before deployment?.
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Answers for your questions first.
How I can retrieve “Community” metadata in Salesforce and will make to
deploy for example to QA org
depends on which deployment tool r u using?
–if you using change set just follow “community deployment by change set” below link
— by sfdx you have to create package.xml as below code snippet then retrieve by using sfdx command
sfdx force:source:retrieve --manifest manifestpackage.xml -u source org
Need I create community/site in QA with equal site name how in DevOrg
—yes you have to create Community with same name in your target org before deployment.
My very rough notes below:
Community metadata deployment is not straightforward like others. some of the things you need to do in manually in target org like (publish & assign audiences). for community deployment you have to follow the order strictly other wise it ‘ll get errors keep on.
–if your using change set deployment, Network is main key metadata component for choose.community deployment by change set
— if you want deploy by SFDX you have to follow below steps.
- first deployed the Community’s Apex framework like(objects,fields,lightning components,apex classes/triggers)
- and then the Network/CustomSite/SiteDotCom metadata,
- and finally the Branding and Content Asset metadata
your package.xml should be like below.
<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>DSN</members> <name>CustomSite</name> </types> <types> <members>DSN</members> <name>Network</name> </types> <types> <members>DSN_C</members> <name>SiteDotCom</name> </types> <types> <members>A_Faculty</members> <members>B_Faculty</members> <members>C_Faculty</members> <name>Audience</name> </types> <types> <members>cbDSN_Community</members> <name>NetworkBranding</name> </types> <version>46.0</version> </Package>
You can refer to Metadata developer guide for metadata names.
It would be
You can refer to https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_communitytemplatedefinition.htm for all the sub-metadata for community.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0