A tool to help download Salesforce.com Metadata.
Using the Salesforce Metadata API, this tool will dynamically generate Ant
build.xml files and Salesforce Metadata
package.xml files for downloading the Metadata from your Organisation.
The metadata is downloaded in 3 phases:
- All bulk retrievable components are downloaded first, the
bulkRetrievableAnt target is dynamically generated and executed.
- Queries are performed on the Salesforce Org. to determine all folders for Dashboards, Documents, Email Templates and Reports. Then
package.xmlfiles are dynamically generated with this information. A bulk retrieve is then invoked for all folders and content.
- The remaining miscellaneous metadata components that can not be retrived by bulk or by wildcard methds are downloaded by building a
package.xmlfile that explicitly lists these items.
It uses the Force.com Migration Tool along with Ant to do most of the heavy lifting. Salesforce SOAP API and Metadata API are used in a Groovy script to dynamically build up lists of components for downloading.
The following tools should be installed before use:
GROOVY_HOME environment variable is defined and you are able to execute both
groovy on command line:
$> ant -version Apache Ant(TM) version 1.8.2 compiled on December 3 2011 $> groovy -version Groovy Version: 2.1.5 JVM: 1.7.0_51 Vendor: Oracle Corporation OS: Linux
build.propertiesand specify your Salesforce credentials. Note: Credentials used should be those of an Adminstrator, to ensure the correct access for retrieving metadata components.
- Open command prompt and enter command
The results will be downloaded to
How to exclude types from backup
To exclude specific metadata types from backup you can specify a comma list of
metadata types in the
For example to exclude Reports and Documents form backup add the following line