Play with ANT: Salesforce Force.com Migration Tool
The Force.com Migration Tool is a command-line utility based on Java Ant. It is helpful in moving metadata, code, objects and schema between a Salesforce org and local directory.
The ANT Salesforce Migration Tool is particularly useful in the scenarios as:
- Whenever you need to populate a test environment for development projects.
- Multi-Environment release processes such as iteration, testing, and staging before going to a production environment.
- Repetitive deployment using the same set of parameters.
- Migrating from stage to production environment.
- Scheduling deployments in batches.
Installing the Force.com Migration Tool
Before you proceed to install the Force.com Migration Tool, you will need Ant as well as Java installed on your machine. You also need to configure ANT and Java correctly. Java version 1.7.x or later is advisable for better security.
However, you can download the Force.com Migration software Tool from the Salesforce organization. After downloading, install the Force.com Migration Tool. This Salesforce integration will benefit your business in the long run.
After installing the Force.com Migration tool, you need to:
1. Enter Salesforce Connection Information.
2. Construct a Project Manifest.
- Specify Standard Objects.
- Specify Named Components
- Mention all Components of a Type
- Specify Standard Objects
- Get Information About Metadata Types
- Describe Metadata Types
- List Components for a Metadata Type
3. Create, Retrieve Targets
- Retrieve Components in Bulk
- Reclaim Unpackaged Components
- Retrieve Managed or Unmanaged Packages
- Retrieve Components in Bulk
4.. Retrieve Metadata from a Salesforce Organization
5. Edit Metadata
6. Delete Files from an Organization
- Delete Components in a Deployment
- Add and Delete Components in a Single Deployment
7. Deploy Changes to a Salesforce Org. (The details of the specific target environment to deploy is given in build .xml file).
- Use Components
- Deploy Code
- Deploy a Recent Validation
- Run Tests in a Deployment
- Default Test Execution in Production
- Default Test Execution in Production for API Version 33.0 and Earlier
- Run a Subset of Tests in a Deployment
- Run Specific Tests. You can specify only test classes, but you cannot give specific individual test methods.
- Run the Similar Tests in Production and Sandbox Deployments.
- Cancel the Deployment if required.
- Check the Status of the task deployed.
You can check the infographic here:
Common Migration Issues
There are certain common migration issues you may run into when migrating metadata as well as deploying changes. These issues can also be broadly classified into three categories as Metadata Issues, Connectivity Issues and Testing and Code Coverage issues.
The most common Metadata issues faced are:
- Retrieving custom fields on standard objects
- Profiles or permission sets and field-level security
- Understanding packages
- Retrieving or deploying components that depend on an object definition
- Personal folders — Users' personal folders, for both documents and reports are not exposed in the Metadata API.
The most common Connection Issues are detailed below:
Request timed out
- PollWaitMillis is the number of milliseconds system waits between polls for deployment and retrieves results.
- MaxPoll is the number of poll attempts performed before aborting with the default value of 200.
Invalid username, password, user locked out or security token issues.
- Username - Ensure your username is correct.
- Password — Ensure your password is correct and security token is appended to the end of the password.
- Security token — Ensure that the security token is a 25 digit string appended to the password.
- Locked out — Unsuccessful logging into an organization many times will lock your username temporarily.
Proxy settings Error— you will get a Proxy error if you do not follow proper Ant Proxy Configuration instructions.
- To avoid Testing and Code Coverage issues, you need to conduct the test in Apex before deployment.
However, in order to install the Ant Salesforce migration and overcome these migration, metadata and connection issues, you can take help of the best Salesforce consulting company. Signity solutions, a leading cloud based CRM development company can help you with Salesforce integration services. We have a team of experts who can understand your requirements and provide you with the best solutions. So, contact us now and hire our outsourcing team! You can also send us your requirements at: firstname.lastname@example.org.