2
votes

I would like to move from one saleforce Dev org to another Dev org using ANT Migration Tool. I would like to autogenerate package.xml file which takes care for all customfields, customObjects and all custom components so which helps me to move easily Source org to target org without facing dependencies issues.

2

2 Answers

0
votes

There are a lot of answers here.

I would like to rank those answers here.

  1. The simplest way I think is to consider using Ben Edwards's heroku service https://packagebuilder.herokuapp.com/

  2. Another option is to use npm module provided by Matthias Rolke.

To grab a full package.xml use force-dev-tool, see: https://github.com/amtrack/force-dev-tool.

npm install --global force-dev-tool
force-dev-tool remote add mydev user pass --default
force-dev-tool fetch --progress
force-dev-tool package -a

You will now have a full src/package.xml.

  1. Jar file provided by Kim Galant

Here's a ready made Java JAR that you point to an org (through properties files), tell it what metadata types to go and look for, and it then goes off and inventories your org and builds a package.xml for you based on the types you've specified. Even has a handy-dandy feature allowing you to skip certain things based on a regular expression, so you can easily e.g. exclude managed packages, or some custom namespaces (say you prefix a bunch of things that belong together with CRM_) from the generated package.

So a command line like this:

java -jar PackageBuilder.jar [-o <parameter file1>,<parameterfile2>,...] [-u <SF username>] [-p <SF password>] [-s <SF url>] [-a <apiversion>] [-mi <metadataType1>,<metadataType2>,...] [-sp <pattern1>,<pattern2>,...] [-d <destinationpath>] [-v]

will spit out a nice up-to-date package.xml for your ANT pleasure.

  1. Also another way is to use Ant https://www.jitendrazaa.com/blog/salesforce/auto-generate-package-xml-using-ant-complete-source-code-and-video/

I had idea to create some competing service to aforementioned services but I dropped that project ( I didn't finish the part that was retrieving all parts from reports and dashboards)

0
votes

There is an extention in VS Code that allows you to choose components and generate package.xml file using point and click

Salesforce Package.xml generator for VS Code

https://marketplace.visualstudio.com/items?itemName=VignaeshRamA.sfdx-package-xml-generator

I am affiliated to this free vs code extension as the developer