1

Currently when we issue the sfdx force:source:pull -f command, SFDX only pulls the differences in components.

I want to know if there is a way to get a complete refreshed copy of "force-app" subfolders. [on the lines of a eclipse project pull]

Ways I tried:

I authenticated my scratch org with sfdx force:auth:web:login and then tried to retrieve the metadata with sfdx force:mdapi:retrieve -s -r ./temp -u <authenticated user>. What I learnt is:

1) The mdapi retrieve command only packages/zips whatever is present in force-app [that is my already out of sync local copy] | if the force-app folder is missing, the command fails.

2) In scratch org you cannot create packages, so you cannot add the -p parameters to the sfdx force:mdapi:retrieve command.

Please help me to find a way to pull all my metadata.

  • 2
    If you know which specific types you want, sfdx force:source:retrieve -m can help, such as sfdx force:source:retrieve -m ApexClass,ApexTrigger. I suppose you could build a huge list of all the types. – sfdcfox Oct 29 '18 at 20:37
  • Thank you @sfdcfox. Do we have a document list the types? – Shridhar Puntambekar Oct 29 '18 at 20:55
  • ERROR: This command cannot be used on orgs that have source tracking enabled. – Shridhar Puntambekar Oct 29 '18 at 21:24
  • 1
    Well you can use sfdx force:mdapi:retrieve with -k ./package.xml that package.xml should have list of everything that you want retrieve (can be generated from here: packagebuilder.herokuapp.com ) and after that convert it to sfdx format and error that you got is from this issue: success.salesforce.com/… – user1974566 Oct 29 '18 at 22:16
  • Thank you @user1974566. That is what I needed. – Shridhar Puntambekar Oct 29 '18 at 23:06
3

Well you can use sfdx force:mdapi:retrieve with -k ./package.xml that package.xml should have list of everything that you want retrieve (can be generated from here ) and after that convert it to sfdx format.

| improve this answer | |

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.