How to Deploy Profiles and Fields with SFDX in VSCode

We're deploying from Stage to Prod via VSCode and package.xml. We're concerned of overwriting certain existing Profiles on Production. We haven't updated Stage from Prod in too long.

We still need to deploy those Profiles as they relate to the new fields and other metadata in our package.xml

If we use SFDX (we are thinking of retreating to ant migration for this) still, we need to be assured:
A) that anything that doesn't exist in the Profile on Stage, does not remove it from Profile on Prod
B) that Profiles in Prod will only receive the changes associated with fields in our package.xml

Please help, as I cannot find official documentation for this most important topic.

Best Answer

Profiles only take on changes that are specified in the XML. If you don't specify a permission, it remains whatever it was before the deployment. This allows you to build incremental changes to permissions across multiple packages.

That said, as you move to DX, it may be time to start migrating towards Permission Sets instead. These are far more flexible, can be applied to many users at once, users can have more than one assigned to them, and they work better with packaging.

Related Topic