I've created a custom profile in a scratch org using Salesforce CLI.

The thing is that by using either sfdx force:mdapi:retrieve or sfdx force:source:pull commands, only the Admin profile is retrieved.

Is there a way to retrieve the other profiles so that I can deploy them to another org?

  • 2
    Have you tried sfdx force:source:retrieve -m "Profile" -u <orgAlias> ? it worked me for and retrieved all profile from scratch. – sfdx bomb Dec 20 '19 at 12:23

It's been a while since I've had a chance to do DX work, but I found you can definitely get the profiles by including them in your package.xml or package manifest (Setup > Apps > Package Manager or Setup > Create > Packages). You must explicitly include the profile names in order to get them to appear with the mdapi commands.

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.