function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sai tarunsai tarun 

How to deploy Profiles from one org to another org Using ANT Tool?

What should mention in package.xml file for the retrieve and deployment of profile and permission set using ANT so that all object permission ,fields permission and others permission will remain same after the deployment. Is it possible.If possible could you please tell what should be in pakage.xml file.Please add in below xml file if any thing is required .Could you please tell me is this best way to deploy or better to create profile rather than deploy....

Package.xml:

<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<!-- **************************  
    <types>
     <members>*</members>
     <name>CustomObject</name>
    </types> 
    <types>
        <members>*</members>
        <name>Layout</name>
    </types>
    <types>
        <members>*</members>
        <name>CustomApplication</name>
    </types>
    <types>
        <members>*</members>
        <name>CustomTab</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexPage</name>
    </types> 
    <types>
        <members>*</members>
        <name>ApexClass</name>
    </types>
************************** -->  
    <types>
     <members>PermissionSetName</members>
     <name>PermissionSet</name>
    </types>     
    <types>
     <members>ProfileName</members>
     <name>Profile</name>
    </types>
    <version>39.0</version>
</Package> 
Salesforce DeveloperSalesforce Developer
Not recommended, you have to add a lot of related things and It could become a mess. Better create them manually in Prod.