Pages

Force.com Migration Tool

The Force.com Migration Tool is a Java/Ant-based command-line utility for moving metadata between a local directory and a Salesforce organization.

Before you install the Force.com Migration Tool you will need Java and Ant installed on your local machine. Then you can download the Force.com Migration Tool from a Salesforce organization.

To install and configure Ant
1. Download Apache Ant version 1.6 or newer to a directory of your choice: http://ant.apache.org/bindownload.cgi. This directory will be known as ANT_HOME. Once the files are on your computer, there is no further installation required.

2. Add the bin directory to your path. (Only the bin and lib directories are required to run Ant.)
3. If you are using a Windows operation system, create an ANT_HOME environment variable and set the value to where you have installed Ant. Also create a JAVA_HOME environment variable and set the value to the location of your JDK.

3. Save the .zip file locally and extract the contents to the directory of your choice.
4. Copy ant-salesforce.jar and paste into your Ant installation's lib directory. The lib directory is located in the root folder of your Ant installation.

Entering Salesforce Connection Information
In order to retrieve or deploy metadata components, you need to edit build.properties to point to a Salesforce organization:

1. Go to the location where you extracted the Force.com Migration Tool files and open the sample subdirectory.
2. Open build.properties in a text editor and substitute a valid Salesforce username and password. If you are using a security token, paste the 25-digit token value to the end of your password.

Constructing a Project Manifest
The package.xml file is a project manifest that lists all the components you want to retrieve or deploy in a single request. You can retrieve or deploy only a single package at a time.

Create package.xml file with the components to be retrieved or deployed.

You can find the sample in "D:\sample\codepkg", the location where you unzipped Force.com Migration tool zip.