Salesforce-metadata-xml File to Retrieve/Deploy Components : jayakrishnasfdc

Salesforce-metadata-xml File to Retrieve/Deploy Components
by: jayakrishnasfdc
blow post content copied from  Jayakrishna Ganjikunta
click here to view original post


When we want to Retrieve/Deploy All Metadata components of salesforce like( objects, Apex , Aura etc) we have many ways & tools to do it.
I am giving various options here in this post.


Note: Do not try to either Retrieve /Deploy all types of member components through XML file in single shot, you will get below error. So always try in chunks with limited member components.
The metadata retrieve operation failed: LIMIT_EXCEEDED: Too many files in retrieve call, limit is: 10000

WorkBench

The external tool Workbench can retrieve and deploy the metadata of custom applications, objects, and other components. Hence, Workbench helps structure the organization. 

To perform a Retrieve operation (Get the configuration data from Salesforce): 
1. Prepare an XML file with the standards and types defined with the version of API for the request. 
Example:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>CustomApplication</name>
    </types>
    <version>36.0</version>
</Package>

2. Visit the Workbench site and login with your username and password.
3. Click the Migration tab.
4. Select the Retrieve option.
5. In Unpackaged Manifest section click the ‘Browse’ button, then select the package XML file created in step 1 to obtain the component attributes. 
6. Click the Next Button.
7. Click the Retrieve button.
8.Click Download Zip File remember the location for any future deployment.

To perform a Deploy operation (Upload changes from the configuration data to Salesforce): 
1. Create a folder the package XML file in the root and a sub level folder with the component name.
2. Zip the folder.
3. Visit the Workbench site and login with username and password, if not already logged in.
4. Click the Migration tab.
5. Select the Deploy section.
6. Click the Choose file option.
7. Check the following if applicable to the your scenario:

  • Auto Update Package
  • Check Only
  • Ignore Warnings
  • Perform Retrieve
  • Purge On Delete
  • Rollback On Error
  • Single Package

8. Confirm all of the options for deployment.
9. Click on the Deploy button when ready.
10. Wait for process to become completed.
11. Confirm the results deploy successfully, if not check the file for any errors.


Packagebuilder


https://packagebuilder.herokuapp.com/

Open the above URL and login into source salesforce or either production /Sanbox

Click on Get Components, it will take few minutes of time based on your organization metadata weightage.

Visual Studio Code

You have to create one project with Manifest
And download below extenstionin VS Code developed by Vignesh(most downloaded extentension)

Salesforce Package.xml Generator Extension for VS Code

This extension provides a User Interface to choose metadata components for Package.xml file for development against sandboxes or DE orgs (Org Development Model with VS Code). This is similar to Eclipse Force.com IDE Add/Remove Metadata Components option.

Prerequisites

Before you set up Salesforce Package.xml Generator Extension for VS Code, make sure that you have these essentials.

  • Salesforce Extensions for Visual Studio Code
  • Visual Studio Code v1.26 or later

Screenshots

Screenshot 1
Screenshot 2

How to use?

How to Use
  • Setup your project using SFDX: Create Project with Manifest command and authorize it using SFDX: Authorize an Org command. Skip this step if already done. For more details refer [Org Development Model with VS Code] (https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model).
  • Open the command palette (press Ctrl+Shift+P on Windows or Linux, or Cmd+Shift+P on macOS) and run SFDX Package.xml Generator: Choose Metadata Components command.
  • In Choose Metadata Components for Package.xml page, select the Metadata you need and click on Update Package.xml button.
  • Package.xml file opens up with the selected metadata components.
  • Open the command palette (press Ctrl+Shift+P on Windows or Linux, or Cmd+Shift+P on macOS) and run SFDX: Retrieve Source in Manifest from Org
  • Select All button selects all the metadata components expect Reports, Dashboards, Email Templates and Documents.
  • If you don’t want to modify the existing package.xml file & only want the generated xml content, click on Copy to Clipboard button. This copies the formatted package.xml contents to clipboard which can be pasted somewhere else.

Salesforce Inspector

Install the below plugin to your chrome browser.

chrome://extensions/?id=aodjmnfhjibkcdimpodiifdjnnncaafh

click on extenstion and ‘Download metadata’

XML File

Or take my below xml file and you can use this in VS code, Workbench, IntelliJ and Ant etc. tools to retrieve member components..

<?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
<Package xmlns=”http://soap.sforce.com/2006/04/metadata”&gt;
<types>
<members>*</members>
<name>ActionLinkGroupTemplate</name>
</types>
<types>
<members>*</members>
<name>ApexClass</name>
</types>
<types>
<members>*</members>
<name>ApexComponent</name>
</types>
<types>
<members>*</members>
<name>ApexPage</name>
</types>
<types>
<members>*</members>
<name>ApexTrigger</name>
</types>
<types>
<members>*</members>
<name>AppMenu</name>
</types>
<types>
<members>*</members>
<name>ApprovalProcess</name>
</types>
<types>
<members>*</members>
<name>AuraDefinitionBundle</name>
</types>
<types>
<members>*</members>
<name>AuthProvider</name>
</types>
<types>
<members>*</members>
<name>AutoResponseRules</name>
</types>
<types>
<members>*</members>
<name>ConnectedApp</name>
</types>
<types>
<members>*</members>
<name>CustomApplication</name>
</types>
<types>
<members>*</members>
<name>CustomApplicationComponent</name>
</types>
<types>
<members>*</members>
<name>CustomFeedFilter</name>
</types>
<types>
<members>*</members>
<name>CustomHelpMenuSection</name>
</types>
<types>
<members>*</members>
<name>CustomLabels</name>
</types>
<types>
<members>*</members>
<name>CustomMetadata</name>
</types>
<types>
<members>*</members>
<name>CustomObject</name>
</types>
<types>
<members>*</members>
<name>CustomObjectTranslation</name>
</types>
<types>
<members>*</members>
<name>CustomPageWebLink</name>
</types>
<types>
<members>*</members>
<name>CustomPermission</name>
</types>
<types>
<members>*</members>
<name>CustomSite</name>
</types>
<types>
<members>*</members>
<name>CustomTab</name>
</types>
<types>
<members>*</members>
<name>DelegateGroup</name>
</types>
<types>
<members>*</members>
<name>Document</name>
</types>
<types>
<members>*</members>
<name>DuplicateRule</name>
</types>
<types>
<members>*</members>
<name>EclairGeoData</name>
</types>
<types>
<members>*</members>
<name>EmailServicesFunction</name>
</types>
<types>
<members>*</members>
<name>EmailTemplate</name>
</types>
<types>
<members>*</members>
<name>EscalationRules</name>
</types>
<types>
<members>*</members>
<name>ExternalDataSource</name>
</types>
<types>
<members>*</members>
<name>ExternalServiceRegistration</name>
</types>
<types>
<members>*</members>
<name>FlexiPage</name>
</types>
<types>
<members>*</members>
<name>Flow</name>
</types>
<types>
<members>*</members>
<name>FlowCategory</name>
</types>
<types>
<members>*</members>
<name>FlowDefinition</name>
</types>
<types>
<members>*</members>
<name>GlobalValueSet</name>
</types>
<types>
<members>*</members>
<name>GlobalValueSetTranslation</name>
</types>
<types>
<members>*</members>
<name>HomePageComponent</name>
</types>
<types>
<members>*</members>
<name>HomePageLayout</name>
</types>
<types>
<members>*</members>
<name>InstalledPackage</name>
</types>
<types>
<members>*</members>
<name>Layout</name>
</types>
<types>
<members>*</members>
<name>Letterhead</name>
</types>
<types>
<members>*</members>
<name>LightningBolt</name>
</types>
<types>
<members>*</members>
<name>LightningComponentBundle</name>
</types>
<types>
<members>*</members>
<name>LightningExperienceTheme</name>
</types>
<types>
<members>*</members>
<name>MatchingRules</name>
</types>
<types>
<members>*</members>
<name>NamedCredential</name>
</types>
<types>
<members>*</members>
<name>NetworkBranding</name>
</types>
<types>
<members>*</members>
<name>PathAssistant</name>
</types>
<types>
<members>*</members>
<name>PermissionSet</name>
</types>
<types>
<members>*</members>
<name>PlatformCachePartition</name>
</types>
<types>
<members>*</members>
<name>PostTemplate</name>
</types>
<types>
<members>*</members>
<name>Profile</name>
</types>
<types>
<members>*</members>
<name>ProfileSessionSetting</name>
</types>
<types>
<members>*</members>
<name>Queue</name>
</types>
<types>
<members>*</members>
<name>QuickAction</name>
</types>
<types>
<members>*</members>
<name>RecommendationStrategy</name>
</types>
<types>
<members>*</members>
<name>RecordActionDeployment</name>
</types>
<types>
<members>*</members>
<name>RemoteSiteSetting</name>
</types>
<types>
<members>*</members>
<name>ReportType</name>
</types>
<types>
<members>*</members>
<name>Role</name>
</types>
<types>
<members>*</members>
<name>SamlSsoConfig</name>
</types>
<types>
<members>*</members>
<name>Scontrol</name>
</types>
<types>
<members>*</members>
<name>Settings</name>
</types>
<types>
<members>*</members>
<name>SharingRules</name>
</types>
<types>
<members>*</members>
<name>SiteDotCom</name>
</types>
<types>
<members>*</members>
<name>StandardValueSetTranslation</name>
</types>
<types>
<members>*</members>
<name>StaticResource</name>
</types>
<types>
<members>*</members>
<name>SynonymDictionary</name>
</types>
<types>
<members>*</members>
<name>TopicsForObjects</name>
</types>
<types>
<members>*</members>
<name>TransactionSecurityPolicy</name>
</types>
<types>
<members>*</members>
<name>Workflow</name>
</types>
<version>49.0</version>
</Package>

Other tools : IntelliJ, Ant, Mavens Mate with Sublime etc.

Thanks for Reading…


December 25, 2020 at 10:43AM
Click here for more details...

=============================
The original post is available in Jayakrishna Ganjikunta by jayakrishnasfdc
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Salesforce