0

First time i'm deploying the all the salesforce org details from one org to other. for the secong time i have changed something and deploying it again deploying all details instead of deploying only changes how can i deploy only changes to other salesforce org.

 how to modify my build.xml file and package.xml file as required to deplo only changes.

 package.xml file 
 ------------------

 <?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
    <members>*</members>
    <name>ApexClass</name>
</types>

<types>
    <members>*</members>
    <name>ApexPage</name>
</types>
<types>
    <members>*</members>
    <name>ApexTrigger</name>
</types>
<types>
    <members>*</members>
    <name>StaticResources</name>
</types>
<version>41.0</version>

build.xml file

<property file="build.properties"/>
<property environment="env"/>

<target name="deploy">

    <sf:deploy username="${sf.username}"
                 password="${sf.password}"
                 serverurl="${sf.serverurl}"
                 runAllTests="true"
                 logType="Detail"
                 deployRoot="src"/>

</target>

Thanks In Advance basha

build.

  • You can refer my answer of how to use ANT. Also I've maintained one github repository for the same. ANT Github link – Rohit Mourya Nov 10 '17 at 10:30
  • Thanks for giving the reply.if i have already deployed the data into second salesforce org.suppose now i'm changing the data in apex class,now i'm doing the deployment it deployes all data again including changed apex class as well.Here but i want to deploy only changes.i'm doing CI with jenkins for deploying – user50839 Nov 10 '17 at 11:50
  • When you deploy any component, it just replaces it with new copy. It doesn't ask you which changes for that particular component needs to be deployed. – Rohit Mourya Nov 10 '17 at 11:53
  • sorry i'm little confusing ,here i setup CI with salesforce-bitbucket-jenkins.once i have commiting the changes to bitbucket,jenkins automatically triggers and deploy data to other salesforce org.at that time it deploys all data again how can we deploy only comminting data by modifying the package.xml or build.xml file . – user50839 Nov 10 '17 at 12:35
2

For deploying specific components you need to specify API name of that component with appropriate type.

For example following package.xml moves Custom button, Page Layout and Apex class:

?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>ApexClassName</members>
        <name>Apexclass</name>
    </types>
    <types>
        <members>Account-Appointment Layout</members>
        <members>Contact-Event Layout</members>

        <name>Layout</name>
    </types> 
    <types>
        <members>Contact.Custom_button</members>
        <name>WebLink</name>
    </types>

    <version>34.0</version>
</Package>

<members>*****</members> specifies all components of that particular Metadata whereas <members>Contact.Custom_button</members> retrieves only one Custom button.

And you don't need to change build.xml.

0

The migration toolkit doesn't automatically do a diff. What you want to do is (eventually) to migrate to Second-Generation Packaging, which allows upgradeable packaging components without the headache of ISV managed packages. Mind you, it doesn't have full feature parity yet (needs about two more releases), but all of the common types of metaata you'd use are already available. You'll want to start migrating to Salesforce DX at your earliest convenience to take advantage of the new features.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy