The Ant Migration Tool is a Java/Ant-based command-line utility for moving metadata between a local directory and a Salesforce org.
Usage of Ant-migration Tool
- Easily retrieve and deploy components.
- All types of metadata will migrate between many environments.
- Quick test environment configuration.
Installation Process of Ant-migration Tool
STEP - 1
- First, you have to check if the JAVA JDK file is already installed in your system or not.
- For this, you have to go to the COMMAND PROMPT in your system and open it.
- Then type “java-version” in COMMAND PROMPT and click on enter.
- If your system already has a JAVA JDK file then it will show on that COMMAND PROMPT and if not then also it will show on COMMAND PROMPT.
STEP - 2
- If your system doesn’t have JAVA JDK then firstly download it from the following link https://www.oracle.com/in/java/technologies/javase/jdk11-archive-downloads.html
- Download the JDK “.exe” file according to your system configuration. If your system has a 64-bit configuration then download the JAVA JDK File accordingly.
- In my system, I downloaded the JAVA JDK .exe file “VERSION-11 ” for windows.
- NOTE - Always try to download the latest version of the JAVA JDK file in your system. Because I personally got problems with an older version of the JAVA JDK file.
- After downloading the JAVA JDK file, you have to install it in your system.
- Then check whether this JDK file is downloaded or not in your system from the command prompt using the “java -version” command.
- After downloading and installing the JAVA JDK File I have checked it from the command prompt as shown in the image below -
- Hence your JAVA JDK File was downloaded and installed successfully.
Don't forget to check out: Salesforce Ant Migration Ubuntu
STEP - 3
- Now we download and install the latest version of “APACHE -ANT” from the below link - http://ant.apache.org/bindownload.cgi
- I downloaded this apache-ant-1.10.11-bin.zip from the above link.
- Now cut and paste the apache-ant to local disc C.
- After that extract this apache-ant file by right-clicking on the apache-ant file and click on Extract all here.
- Hence your “apache-ant zip file” was extracted successfully. As shown in the image there are both compressed apache-ant and extracted apache-ant files.
- For checking if “apache-ant” is installed successfully on your system or not, by applying the “ant-version” command on “COMMAND PROMPT” and clicking enter.
- If “apache-ant” is installed on your system successfully then it will show the message as shown in image -
- Hence “apache-ant” downloaded and installed on your system successfully.
STEP - 4
- Now we are downloading the “Ant Migration Tool” in our system.
- For downloading the Ant Migration tool, go to the following link - https://gs0.salesforce.com/dwnld/SfdcAnt/salesforce_ant_52.0.zip
- Or for downloading the Ant-Migration Tool use the following link - https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/forcemigrationtool_install.htm
- Now cut and paste this Ant-Migration Tool file into Local disc C.
- Right-click on the Ant-Migration Tool file and click on the extract here.
- Now your Ant-Migration tool “.Zip File” was extracted there successfully.
STEP - 5
- Now, copy the “ant-salesforce” executable jar file from the “Ant-Migration Tool” file and paste it to the Lib folder of the “Apache-ant” file.
Check out another amazing blog by Rajat here: How to Freeze and Deactivate the User Account | Salesforce Developer Guide
STEP - 6
- Now we have to set the “PATH” of “Apache-ant” and “Java -Jdk” files into “System Variable Environment”.
- Search “Variable” in your system.
- Click on “Edit the system environment variables”.
- Now Click on the “Environment variable”.
- Now you will again have one Pop-Up.
- Now go to your “Apache-Ant” .zip file in your system.
- And select the path of the “Apache-Ant” file and copy it.
- Now Click on the new button in “User Variable for your name” and create “ANT_HOME” and paste that path which you already copied. Now save it.
- Now go to the local disc C, then select the program file, then select the java file and then select the JDK file and copy its path.
- Now click on the new button in “User Variable for your name” and create “JAVA_HOME” and paste that path which you already copied. Now save it.
- Also, create JAVA_HOME and ANT_HOME in “System Variable” and paste the same path as we did in the User variable for Rajat.
- Now copy the path of “APACHE-ANT” and “JAVA-JDK” up to the “bin” folder.
- And save these paths into the Path folder of “User variable for Rajat” and “System Variable”.
- Hence, your “ANT MIGRATION TOOL” is downloaded and Installed successfully into your system.
- Now you can Retrieve and Deploy the Metadata from one org to another org.
I hope this will help you to install and configure the Ant Migration tool into your system.