package xml using changeset

How To Generate package.xml Through Migration Tool and Change Sets

General Development

Prerequisites: Migration Tool [ANT]. This is one of the popular deployment tools used for migrating Salesforce metadata from one org/sandbox to another. Check this link for Installation details if you don’t already have Migration Tool.

Follow below steps to generate package.xml

  • Go to Setup and create a Change Set in your sandbox. You cannot test this feature with Developer edition since Developer edition doesn’t come with any sandboxes


  • Copy below script and paste it into build.xml file

  • Above code has operation called ‘retrieve-cs’, that retrieves Change Set components from your Sandbox. Make sure username and password variables in are same as in build.xml
  • Run ‘ant retrieve-cs’ command in command prompt/terminal. Enter the change set name when prompted and confirm the operation. Script should create a new folder called changeSet and stashes the components from Change Set in to the same. If everything is okay, you should see that build is successful like below

changeset to package.xml

Check also :  How to Find Salesforce Object ID prefixes (custom or standard)

Happy Coding!

About The contributor: 

Suneel Pelluru

1 Post Contribute

Suneel Pelluru sfdcMonkey blog contributor

Suneel is a Senior Salesforce Developer working for Indeed in Austin, Texas.








Blogs By Suneel :

  1. How To Generate package.xml Through Migration Tool and Change Sets


Leave a Reply