+ Start a Discussion
GAURAV SETHGAURAV SETH 

How to migrate Communities , Roles, profile from Developer Edition org?

Need Help to migrate Communities , Roles, profile from Developer Edition org. We are using VS code and able to migrate all custom Objects, custom fields, visual force pages, apex classes etc using unmanaged package. Then we are using scratch orgs for development.
But Roles and communities are not a part of unmanaged package.
Can someone please tell me how to migrate these items so that we have all items?

What is the best way to accomplish that ?

Thanks,
Gaurav Seth
AnudeepAnudeep (Salesforce Developers) 
Hi Gaurav, 

Try Including them in the Manifest (package.xml) File in VS Code

Here is the sample Manifest file for communities - http://​​​​​​​https://help.salesforce.com/articleView?id=networks_migrating_from_sandbox.htm&type=5 (http://https://help.salesforce.com/articleView?id=networks_migrating_from_sandbox.htm&type=5)

For Roles, you can add
 
<types>
<members>*</members>
<name>Role</name>
</types>

Please see section 'The Manifest (package.xml) File' in http://https://salesforcedx-vscode.netlify.app/tools/vscode/en/user-guide/development-models/ to learn more

If this information is helpful, please mark this as best so that it can help others in the future

Thanks, 
Anudeep

 
GAURAV SETHGAURAV SETH
Thanks Anudeep. I am getting below errors and others too.

I have enabled communities in my scratch org where I am pushing my code.
Do I have to manually do some actvities on scratch org every time ?



Error    force-app/main/default/networks/AMS.network-meta.xml                                 Not available for deploy for this organization
Error    force-app/main/default/roles/Same_level.role-meta.xml                                field integrity exception: unknown (Case access level below organization default)
Error    force-app/main/default/objects/Lien__c/fields/Reason__c.field-meta.xml               The global picklist cannot be resolved (316:13)
Error    force-app/main/default/layouts/Lien__c-Lien Layout.layout-meta.xml                   In field: field - no CustomField named Lien__c.Reason__c found (52:26)
Error    force-app/main/default/applications/Live_User.app-meta.xml                           Chat must be set up
Error    force-app/main/default/applications/test.app-meta.xml                                In field: utilityBar - no FlexiPage named test_UtilityBar found
Error    force-app/main/default/applications/standard__LightningInstrumentation.app-meta.xml  Cannot create a new component with the namespace: standard.  Only components in the same namespace as the organization can be created through the API
Error    force-app/main/default/applications/standard__LightningSalesConsole.app-meta.xml     Cannot create a new component with the namespace: standard.  Only components in the same namespace as the organization can be created through the API
Error    force-app/main/default/applications/standard__LightningService.app-meta.xml          Cannot create a new component with the namespace: standard.  Only components in the same namespace as the organization can be created through the API
Error    force-app/main/default/applications/standard__ServiceConsole.app-meta.xml            Chat must be set up
Warning  force-app/main/default/contentassets/Background_Header.asset                         ContentAsset Background_Header [03S0t000000D9vL] - No Network named [AMS] (0:0)
Error    force-app/main/default/siteDotComSites/AMS1.site                                     You don't have the correct site publisher privileges for this operation Site : AMS, type: Site.com Community(db=C,api=ChatterNetworkPicasso)
Error    force-app/main/default/pages/LienCreation.page                                       Could not resolve field 'Reason__c' from <apex:inputField> value binding '{!newLien.Reason__c}' in page LienCreation
Error    force-app/main/default/roles/ApplicationsForAdjudicationCustomerUser.role-meta.xml   In field: DeveloperName - no Role named Same_level found
Error    force-app/main/default/objects/Lien__c/Lien__c.object-meta.xml   
GAURAV SETHGAURAV SETH
Thanks Anudeep, I am able to resolve the issues above and migrate communities.
I am still facing some missing items like
1) Missing Tile Menu images in migrated community. I can see those images in contentassets folder but not able to see in community.When I naviate to navigation item and went to Tile Menu-then can not see those images.
2) I can see all the tabs in tab folder but they are not coming on Home page of the application. I am attaching package.xml which I am using .
3) Dashboard and Reports are also not coming.

Am I missing some settings ?
Can you please help me in finding the issue ?

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>Network</name>
    </types>
    <types>
        <members>*</members>
        <name>CustomSite</name>
    </types>
    <types>
        <members>*</members>
        <name>SiteDotCom</name>
    </types>
    <types>
        <members>*</members>
        <name>CustomTab</name>
    </types>
    
    <types>
        <members>Case</members>
        <members>Account</members>
        <members>Contact</members>
        <members>User</members>
        <members>Opportunity</members>
        <members>Lead</members>
        <name>CustomObject</name>
    </types>

    <types>
        <members>*</members>
        <name>CustomObject</name>
    </types>
    <types>
        <members>Case.AllClosedCases</members>
        <members>Case.MyCases</members>
        <name>ListView</name>
    </types>
     <types>
        <members>AMS</members>
        <!--<members>SolarBots</members>-->
        <name>CustomApplication</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexPage</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexComponent</name>
    </types>
    
    <types>
        <members>ADJ Clerk</members>
        <members>AMS</members>
        <members>AMSCustomerCommunityPlus</members>
        <name>Profile</name>
    </types>
     <types>
        <members>*</members>
        <name>PermissionSet</name>
    </types>
    <types>
        <members>*</members>
        <name>Document</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexTestSuite</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexTrigger</name>
    </types>
    <types>
        <members>*</members>
        <name>AuraDefinitionBundle</name>
    </types>
    <types>
        <members>*</members>
        <name>LightningComponentBundle</name>
    </types>
    <types>
        <members>*</members>
        <name>StaticResource</name>
    </types>
    
    <types>
        <members>Account-Account Layout</members>
        <members>AccountCaseLink__c-AccountCaseLink Layout</members>
        <members>Address__c-Address Layout</members>
        <members>Case-Case Layout</members>
        <members>Contact-Contact Layout</members>
        <members>Disability__c-Disability Layout</members>
        <members>Employer__c-Employer Layout</members>
        <members>Event-Event Layout</members>
        <members>Form_Data__c-Applications for Adjudication Layout</members>
        <members>Global-Global Layout</members>
        <members>Hearing__c-Hearing Layout</members>
        <members>Hearing_Schedule__c-Hearing Schedule Layout</members>
        <members>Injury_Detail__c-Injury Detail Layout</members>
        <members>Lien__c-Lien Layout</members>
        <members>UserAddressLink__c-UserAddressLink Layout</members>
        <name>Layout</name>
    </types>
    <types>
        <members>Recent_Accounts</members>
        <members>AMS</members>
        <members>AMS1</members>
        <name>Dashboard</name>
    </types>
    <types>
    <members>*</members>
    <name>NavigationMenu</name>
  </types>

    <types>
        <members>*</members>
        <name>QuickAction</name>
    </types>
    <types>
        <members>AMS/Histrocial_Ca_omt</members>
        <members>AMS/Active_Cases_Report_ldM</members>
        <members>AMS/New_Cases_Report_SG9</members>
        <members>AMS/Recent_Accounts_LC9</members>
        <members>AMS/Recent_Cases_Eu6</members>
        <name>Report</name>
    </types>
    <types>
        <members>Accounts_and_Cases</members>
        <members>Cases</members>
        <name>ReportType</name>
    </types>
    <types>
        <members>*</members>
        <name>Role</name>
    </types>
    <types>
        <members>Account</members>
        <members>AccountIntelligence</members>
        <members>Actions</members>
        <members>Activities</members>
        <members>Account</members>
        <members>Address</members>
        <members>Apex</members>
        <members>AppExperience</members>
        <members>Archive</members>
        <members>Blockchain</members>
        <members>Bot</members>
        <members>BusinessHours</members>
        <members>Campaign</members>
        <members>Chatter</members>
        <members>ChatterEmailsMD</members>
        <members>Communities</members>
        <members>Company</members>
        <members>ConnectedApp</members>
        <members>Content</members>
        <members>Contract</members>
        <members>Currency</members>
        <members>CustomerDataPlatform</members>
        <members>Deployment</members>
        <members>Discovery</members>
        <members>DocumentChecklist</members>
        <members>EmailAdministration</members>
        <members>EmailIntegration</members>
        <members>EmailTemplate</members>
        <members>EnhancedNotes</members>
        <members>Entitlement</members>
        <members>Essentials</members>
        <members>Event</members>
        <members>ExperienceBundle</members>
        <members>ExternalServices</members>
        <members>FieldService</members>
        <members>FilesConnect</members>
        <members>FileUploadAndDownloadSecurity</members>
        <members>Flow</members>
        <members>Forecasting</members>
        <members>Formula</members>
        <members>GoogleApps</members>
        <members>Ideas</members>
        <members>Industries</members>
        <members>InvocableAction</members>
        <members>IoT</members>
        <members>Knowledge</members>
        <members>LeadConfig</members>
        <members>LiveAgent</members>
        <members>Macro</members>
        <members>MyDomain</members>
        <members>Name</members>
        <members>Notifications</members>
        <members>ObjectLinking</members>
        <members>OmniChannel</members>
        <members>Opportunity</members>
        <members>Order</members>
        <members>PathAssistant</members>
        <members>Picklist</members>
        <members>Portals</members>
        <members>Privacy</members>
        <members>Product</members>
        <members>QuickText</members>
        <members>Quote</members>
        <members>Schema</members>
        <members>Sharing</members>
        <members>Site</members>
        <members>SocialProfile</members>
        <members>SystemNotification</members>
        <members>Trailhead</members>
        <members>UserEngagement</members>
        <members>Voice</members>
        <members>Security</members>
        <name>Settings</name>
    </types>
    <types>
        <members>Contact.SNN_should_only_have_numbers</members>
        <members>Lien_c.Allow_Integers</members>
        <members>User.NoUsernameChangesAllowed</members>
        <name>ValidationRule</name>
    </types>
    
     <types>
        <members>*</members>
        <name>GlobalValueSet</name>
    </types>
    <types>
        <members>AMS_UtilityBar</members>
        <members>Appeal_Management_System_AMS</members>
        <members>Case_Record_Page</members>
        <members>Contact_Record_Page</members>
        <members>Employer_Record_Page</members>
        <members>Employer_Record_Page1</members>
         <members>Employer_Record_Page2</members>
        <members>Lien_Record_Page</members>
        <members>SolarBots_UtilityBar</members>
       
        <name>FlexiPage</name>
    </types>
<types>
   <!-- <members>SolarBot_App_Icon</members>
    <members>LEX_Badge</members>
    <members>X111</members>
    <members>X114</members>
    <members>X115</members>
    <members>X116</members>
    <members>Login</members>
    -->
    <members>*</members>
    <name>ContentAsset</name>
 </types>
    <version>48.0</version>
</Package>


Regards,
Gaurav Seth