+ Start a Discussion
Brandon H. BarrBrandon H. Barr 

When retrieving metadata using DX from production org, profiles are not deployable to Scratch org.

After retrieving a custom Profile based on system administrator using `sfdx force:mdapi:retrieve`, and converting the retrieved directory, I am unable to deploy to a Scratch org. 

Using `sfdx force:source:push`, I am returned the following error:
=== Push Errors

Permission ModifyAllData depends on permission(s): EditPublicReports, ManageDashboards

Has anyone seen in this error and able to work around it? I have seen many posts with similar situations but other errors (Unknown user permission: AllowUniversalSearch is another one)
NagendraNagendra (Salesforce Developers) 
Hi Brandon,

Sorry for this issue you are facing.

I would like to try to assist here.

The error you are getting when deploying the profile might be due to required permissions. It appears that you have "Modify All Data" enabled for the profile, but it requires the following permissions too:
  • Edit Public Reports
  • Manage Dashboards
I suggest removing the Modify All Data permission first and add the permissions above before adding Modify All Data again.

Then I would suggest you please go ahead and deploy the profile which might do the trick for you.

Hope this helps.

Kindly mark this as solved if the reply was helpful.

Brandon H. BarrBrandon H. Barr
@nagendra - These options, though not worded exaclty, are already selected. This is a clone of system admin and no options have been changed yet.