I am trying to bundle up certain metadata in a change set in my scratch org. Is there a way to pull that using sfdx? I am having trouble finding the appropriate command in the documentation.


I managed to create a change set in my scratch org and put the metadata I wanted to retrieve from the scratch org.

I managed to pull that change set the same way one pulls a package:

sfdx force:mdapi:retrieve -r retrieval -p NameOfChangeSet -u core

Where retrieval is the name of the folder the metadata gets retrieved to and NameOfChangeSet is the name of the change set.

| improve this answer | |
  • 2
    Curiously, I couldn't find this usage in the documentation. I wonder if it's actually supported. Be aware, however, that change sets can implicitly miss data, so if you use it, you risk having an incomplete package. – sfdcfox Sep 18 '18 at 21:24
  • 1
    Thanks for the warning. How can they miss data? The problem I was experiencing was that no matter what I couldn't get the Create->Packages to show up. That's why I had to go the change set route. – Arthlete Sep 19 '18 at 21:33
  • 1
    Sandboxes should have both Change Sets and Packages, while Scratch Orgs should have only Packages. Change Sets can miss data if you don't include it. For example, let's say you select a VF page, but forget to choose the class for the page's controller. When you retrieve it, you will get only the page, not the class, thus be unable to deploy the change to a new org where the class doesn't exist. – sfdcfox Sep 19 '18 at 21:35
  • Thanks for the clarification. I will play around with it more next time I have to do this again! – Arthlete Sep 19 '18 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.