Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Retrieving Managed or Unmanaged Packages

The Ant Migration Tool is retired with Spring ’24. The tool continues to function as-is for future API versions but isn’t updated with new functionality and isn’t supported.  If Salesforce adds a new feature that is incompatible with Ant, the Ant Migration Tool won't be updated to support it. To manage metadata changes, switch to Salesforce CLI for a modern, supported developer experience.

Note

Packages are useful for distributing related bundles of metadata across multiple instances or organizations, via Lightning Platform AppExchange. However, you can use the Ant Migration Tool to freely retrieve and deploy packaged metadata without using AppExchange. You retrieve both managed and unmanaged packages in the same way.

To retrieve a package, specify a packageNames parameter in the build.xml file. For example:

1<target name="retrieveNamedPackage">
2  <sf:retrieve 
3      username="${sf.username}" 
4      password="${sf.password}"
5      sessionId="${sf.sessionId}" 
6      serverurl="${sf.serverurl}" 
7      retrieveTarget="projectFolder" 
8      packageNames="mySourcePackage"/>
9</target>