An Introduction to Salesforce Force.com Migration Tool (ANT)
Let’s understand Metadata as:
- Data which give information about other Data.
- Metadata sums up essential data about information, making discovering, and working with specific examples of information simpler.
- Metadata can be made physically to be increasingly exact, or naturally and contain progressively fundamental data.
To put it plainly, metadata is significant. I like to answer this "what is metadata" question all things considered: metadata is a shorthand portrayal of the information to which they allude. In the event that we use analogies, we can consider metadata references to information. Consider the last time you looked through Google. That search began with the metadata you had in your brain about something you needed to discover. You may have started with a word, expression, image, place name, slang or something different. The opportunities for portraying things appears to be interminable. Surely metadata composition can be basic or complex, however, they all share a few things for all intents and purpose.
Don't forget to check out: Salesforce Integration Services: 7 Popular Apps for Salesforce Integration with Service Cloud
Understanding Metadata API
Metadata API contains a lot of items that oversee arrangement and customization data (metadata) for your associations, and the SOAP calls that control those articles. With Metadata API you can:
- Work with arrangement design as XML metadata records
- Migrate design changes between associations
- Create your own instruments for overseeing association and application metadata
In spite of the fact that you can compose your own customer applications for utilizing Metadata API SOAP calls, Salesforce gives the Ant Migration Tool to recover and convey Apex and metadata.
Getting Package and Directory Structure
Metadata API works in a bundle driven way. Parts can be in at least one bundles, or in no bundle. Bundles can be neighborhood (made in your Salesforce organization) or introduced from Salesforce AppExchange. At whatever point the Ant Migration Tool recovers a lot of parts, that set is restricted to what's in a solitary bundle or what's in no bundle by any means. There are three sorts of bundles.
- Unpackaged— Components that live locally in your association, for example, standard items, go in the unpackaged bundle.
- Unmanaged bundle— Unmanaged bundles are normally used to convey open-source tasks or application layouts to give engineers the essential structure obstructs for an application. When the segments are introduced from an unmanaged bundle, the segments can be altered in the association they are introduced in. The designer who made and transferred the unmanaged bundle has no power over the introduced segments, and can't change or overhaul them. Unmanaged bundles ought not be utilized to move parts from a sandbox to creation association. Rather, use Change Sets.
- Managed bundle— An assortment of use segments that is posted as a unit on the AppExchange and related with a namespace and perhaps a License Management Organization. To help updates, a bundle must be overseen. An association can make a solitary oversaw bundle that can be downloaded and introduced by various associations. Overseen bundles contrast from unmanaged bundles by having some bolted segments, permitting the oversaw bundle to be redesigned later. 1 Unmanaged bundles do exclude bolted segments and can't be overhauled. Moreover, oversaw bundles muddle certain segments (like Apex) on buying in associations to ensure the licensed innovation of the engineer.
What is Another Neat Tool?
Subterranean insect (Another Neat Tool) is a Java apparatus that performs undertakings dependent on XML guidelines. The Ant Migration Tool is a Java/Ant-based order line utility for moving metadata between a nearby registry and a Salesforce organization. In Simple language, ANT is a device to assist you with moving Metadata (data, for example, Objects/Reports/Apex Classes/Visualforce Pages) between various Salesforce situations. When designed, ANT permits you to effortlessly move arrangement starting with one Salesforce condition then onto the next with a progression of straightforward content orders that you go into a Terminal window on your PC.
For what reason do you have to think about ANT?
We need to know ANT because it provides a flexible way to send changes to many Salesforce conditions at a time.
Explanation:
Scheduling cluster arrangements— We can plan a sending for 12 PM to not disturb clients. Or on the other hand you can pull down changes to your Developer Edition organization consistently.
How about we start with the greatest bit of leeway that ANT offers.
Envision that you have 2 distinct colleagues some 'cool new stuff' in their particular advancement situations. In a Condition, these two colleague developer wants to put their new features into our testing and live environments.
On the off chance that every engineer worked freely, you may not know whether their work will be good with the other. ANT tool provides support for this by giving us a powerful way to keep 2 (or more than 2) Salesforce Orgs synchronised all through your advancement procedure.
Consistently contrasting and synchronizing your new improvement work assists with guaranteeing that any incongruencies are discovered a lot before on in your procedure. This procedure is known as 'Consistent Integration'.
Continuous Integration
The idea driving ceaseless incorporation, or CI, the device is that a steady progression of improvement changes and unit testing will be done to recognize clashes and blunders inside the advancement cycle itself. It permits you to play out a pattern of value affirmation absent a lot of dependence on any manual procedures (at any rate until you get that warning that your code simply broke the fabricate). The stream is something like:
So even with different engineers taking a shot at divided cases, you'll make them a test case which endeavors to construct the present condition of the task dependent on source control. Disappointments get conveyed with the goal that they can be fixed as a component of the cycle.
Check out another amazing blog by Mohit here: Salesforce Data Migration - Guide to the Best Practices
Shouldn't something be said about Change sets?
Salesforce provides us a revelatory tool to move configuration from one Salesforce Sandbox (test) environment to any other Sandbox or any Production environment.
The change set apparatus is exceptionally direct, in any case, things should be included individually, it is not entirely obvious parts, and change sets must be sent between organizations that are associated with your creation organization. For instance, you can just convey a change set from a creation organization and its sandbox, or two sandboxes made from the equivalent organization can send or get change sets.
Insect can send design from one Salesforce condition to a totally random second condition.
Shouldn't something be said about a Package?
A Salesforce engineer can likewise bundle up changes to an unmanaged bundle. It will give permission to take some code from one Salesforce Environment and deploy it to any other unrelated second Salesforce Environment.
In any case, bundling has restrictions. You again need to physically make the bundle, including segments with extra special care. You at that point need to transfer the bundle to Salesforce.Then you have to wait till that package synchronises over the entirety of the Salesforce servers/nodes.
At long last, when it has done that you can introduce the bundle in your new condition, bringing over the new setup.
Normal Migration Issues
There are various basic issues you may run into while moving metadata and conveying changes. These issues can be assembled into three classifications:
- Metadata — Special contemplations for managing certain metadata parts
- Connectivity — Problems associating with an association or surveying for results
- Testing and Code Coverage — Testing Apex before arrangement
References: blogs.absyz, sfdcnotes