{"id":1432,"date":"2015-11-23T05:50:32","date_gmt":"2015-11-23T05:50:32","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/salesforce\/?p=1432"},"modified":"2025-05-29T10:28:01","modified_gmt":"2025-05-29T10:28:01","slug":"using-force-com-migration-tool-part-ii-deployment","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/11\/23\/using-force-com-migration-tool-part-ii-deployment\/","title":{"rendered":"Using Force.com Migration Tool Part II \u2013 Deployment"},"content":{"rendered":"<p align=\"JUSTIFY\">In our previous blog \u201c<strong><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/11\/23\/using-force-com-migration-tool-part-i-configuration\/\" target=\"_blank\" rel=\"noopener\">Using Force.com Migration Tool Part I \u2013 Configuration<\/a><\/strong>\u201d, we discussed about setting up environment for using Ant tool. In this blog we will discuss about how to use Ant based Force.com Migration tool for metadata migration.<strong><strong style=\"color: #000000;\"><a style=\"color: #225e9b;\" href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/\" target=\"_blank\" rel=\"noopener\"><br \/>\n<\/a><span style=\"color: #800000;\"><a style=\"color: #225e9b;\" href=\"https:\/\/www.greytrix.com\/product\/gumu\/salesforce-sage-erp-integration\" target=\"_blank\" rel=\"noopener\">Real-time, bi-directional, multi-company \u2013 Sage ERP Integration with Salesforce<\/a><\/span><\/strong><\/strong><\/p>\n<p align=\"JUSTIFY\"><strong>Steps for Metadata migration using Ant Force.com Migration tool &#8211;<\/strong><\/p>\n<ul>\n<li>\n<p lang=\"en-IN\" align=\"JUSTIFY\"><strong>Preparing build:\u00a0<\/strong>Preparing build for your project needs 3 files as follows.<\/p>\n<\/li>\n<li lang=\"en-IN\">Build.xml<\/li>\n<li lang=\"en-IN\">Build.properties<\/li>\n<li lang=\"en-IN\">Package.xml<\/li>\n<li lang=\"en-IN\">Create new folder for storing your project migration Data.<\/li>\n<li lang=\"en-IN\">Copy \u2018build.xml\u2019 &amp; \u2018build.properties\u2019 files from unzipped in step 2. i.e. salesforce_ant_33.0\\sample &amp; paste it into project folder (created in previous step).<\/li>\n<li lang=\"en-IN\">Edit \u2018build.xml\u2019 &amp; \u2018build.properties\u2019 as below:<\/li>\n<\/ul>\n<ol>\n<li lang=\"en-IN\"><strong>build.xml:<\/strong><\/li>\n<\/ol>\n<p lang=\"en-IN\" align=\"JUSTIFY\">Specify the actions\/operations that you want to perform (either retrieve or deploy or any other possible operation). These are also called as targets. So, you can run these targets one by one and complete the task in sequential manner. Every target has given a name which is used for calling targets from command prompt.<\/p>\n<p lang=\"en-IN\" align=\"JUSTIFY\">This file refers\u00a0build.properties\u00a0file where you have mentioned all the required details like username, password, and serverurl.<\/p>\n<p lang=\"en-IN\" align=\"JUSTIFY\"><span style=\"color: #2c2b2b;\">E.g. <\/span><\/p>\n<ul>\n<li lang=\"en-IN\"><span style=\"color: #000000;\">Retrieving the Package contents from Source Salesforce Org into directory<\/span><\/li>\n<\/ul>\n<p lang=\"en-IN\" align=\"JUSTIFY\">&lt;target name=&#8221;<span style=\"color: #2e74b5;\">&lt;Command name (User defined)&gt;<\/span>&#8220;&gt;<br \/>\n&lt;mkdir dir=&#8221;<span style=\"color: #2e74b5;\">&lt; folder to be created to store retrieved data&gt;<\/span>&#8220;\/&gt;<br \/>\n&lt;sf: retrieve username=&#8221;${sf.username}&#8221; password=&#8221;${sf.password}&#8221; serverurl=&#8221;${sf.serverurl}&#8221; maxPoll=&#8221;${sf.maxPoll}&#8221; retrieveTarget=&#8221;<span style=\"color: #2e74b5;\">&lt;folder specified in mkdir&gt;<\/span>&#8221; packageNames=&#8221;<span style=\"color: #2e74b5;\">&lt;your package name&gt;<\/span>&#8220;\/&gt;<br \/>\n&lt;\/target&gt;<\/p>\n<ul>\n<li><span style=\"color: #000000;\">Deploying the Package contents into Target Salesforce Org <\/span><\/li>\n<\/ul>\n<p>&lt;target name=&#8221;<span style=\"color: #2e74b5;\">&lt;Command name (User defined)&gt;<\/span>&#8220;&gt;<br \/>\n&lt;sf: deploy username=&#8221;${sf.username}&#8221; password=&#8221;${sf.password}&#8221; serverurl=&#8221;${sf.serverurl}&#8221; maxPoll=&#8221;${sf.maxPoll}&#8221; deployRoot=&#8221;<span style=\"color: #2e74b5;\">&lt;Path of folder which is to be deployed&gt;<\/span>&#8221; rollbackOnError=&#8221;true&#8221;\/&gt;<br \/>\n&lt;\/target&gt;<\/p>\n<ol start=\"2\">\n<li lang=\"en-IN\"><strong>build.properties:<\/strong><\/li>\n<\/ol>\n<p lang=\"en-IN\" align=\"JUSTIFY\">Specify the login credentials for the desired Salesforce organization on which you want to perform the operation (deploy or retrieve)<\/p>\n<p>sf.username = &lt;Insert your Salesforce username here&gt;<br \/>\nsf.password = &lt;Insert your Salesforce password along with security token here&gt;<br \/>\nsf.serverurl = https:\/\/login.salesforce.com<br \/>\nsf.maxPoll = 20<br \/>\n(Note:\u00a0All contents displayed above in blue color are need to be customized\/defined by user.)<\/p>\n<ol start=\"3\">\n<li><strong>package.xml:<\/strong><\/li>\n<\/ol>\n<p>This file is created in Force.com IDE (explained in Step 7).<br \/>\nIt contains information of metadata components to be migrated in xml format.<\/p>\n<ol start=\"4\">\n<li lang=\"en-IN\"><strong>Sequence of Metadata Migration<\/strong><\/li>\n<\/ol>\n<ul>\n<li lang=\"en-IN\"><u>Logical steps for Data Migration are:<\/u><\/li>\n<\/ul>\n<p style=\"padding-left: 30px;\">&#8211; Retrieve Metadata from Source Salesforce Org using <b>ant-retrieve<\/b> command.<br \/>\n&#8211; Retrieved data is stored in a folder specified in ant command.<br \/>\n&#8211; Stored metadata is gets deployed in Target Salesforce Org using <b>ant-deploy<\/b> command.<\/p>\n<ul>\n<li lang=\"en-IN\"><u>Detailed steps to migrate metadata from one Salesforce org to another:<\/u><\/li>\n<\/ul>\n<p style=\"padding-left: 30px;\">&#8211; Open Force.com IDE<br \/>\n&#8211; Create new Force.com Project for the source Salesforce Org as follows:<\/p>\n<ol>\n<li lang=\"en-IN\">Open Eclipse &amp; Change its Perspective to \u2018Force.com\u2019<\/li>\n<li lang=\"en-IN\">Click on File -&gt; New -&gt; Force.com Project<\/li>\n<li lang=\"en-IN\">Specify all credentials of Source Salesforce Org, Click Next.<\/li>\n<li lang=\"en-IN\">Choose desired Components to be migrated i.e. Package, VF pages &amp; Classes or all components.<\/li>\n<li lang=\"en-IN\">Click Finish<\/li>\n<li lang=\"en-IN\">Now Project has been created in IDE. Expand it &amp; in source directory, you will find package.xml file.<\/li>\n<\/ol>\n<ul>\n<li lang=\"en-IN\">Create new folder for storing metadata &amp; copy above package.xml file in it.<\/li>\n<li lang=\"en-IN\">Also copy build.xml &amp; build.properties files in newly created folder. Edit them as specified in step 6.<\/li>\n<li lang=\"en-IN\">Open Command Prompt<\/li>\n<li lang=\"en-IN\">Run the ant commands<\/li>\n<\/ul>\n<ol start=\"5\">\n<li><strong>Running Ant Commands<\/strong><\/li>\n<\/ol>\n<p style=\"padding-left: 30px;\">Ant Command to run above script is:<br \/>\nant &lt;<span style=\"color: #000000;\">target name specified by user<\/span>&gt;<span style=\"color: #2e74b5;\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2015\/11\/Force.com-migration-tool-deployment.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-1435 aligncenter\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2015\/11\/Force.com-migration-tool-deployment.png\" alt=\"Force.com migration tool - deployment\" width=\"676\" height=\"342\" \/><\/a><\/span><\/p>\n<p lang=\"en-IN\" align=\"JUSTIFY\"><span style=\"color: #000000;\">Thus, we have discussed deploying project\/metadata in Salesforce Org using Ant based Force.com Migration tool.<\/span><\/p>\n<p><span style=\"font-size: Medium;\"><strong>About Us<\/strong><\/span><br \/>\n<a href=\"https:\/\/www.greytrix.com\" target=\"_blank\" rel=\"noopener\">Greytrix<\/a> as a Salesforce Product development partner offers a wide variety of integration products and services to the end users as well as to the Partners across the globe. We offer Consultation, Configuration, Training and support services in out-of-the-box functionality as well as customizations to incorporate custom business rules and functionalities that require apex code incorporation into the Salesforce platform.<\/p>\n<p><a href=\"https:\/\/www.greytrix.com\" target=\"_blank\" rel=\"noopener\">Greytrix<\/a>\u00a0has some unique solutions for Cloud CRM such as Salesforce integration with\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-x3\/gumu-x3-salesforce-integration\" target=\"_blank\" rel=\"noopener\">Sage Enterprise Management (Sage X3)<\/a>,\u00a0Sage Intacct, <a href=\"https:\/\/www.greytrix.com\/product\/sage-100-erp\/gumu-100-salesforce-integration\" target=\"_blank\" rel=\"noopener\">Sage 100<\/a> and\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp\/gumu-300-salesforce-integration\" target=\"_blank\" rel=\"noopener\">Sage 300 (Sage Accpac)<\/a>. We also offer best-in-class Cloud CRM\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/crm-development\/salesforce-com\" target=\"_blank\" rel=\"noopener\">Salesforce customization and development services<\/a> along with services such as Salesforce <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/data-migration-services\" target=\"_blank\" rel=\"noopener\">Data Migration<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/integrated-application-development\" target=\"_blank\" rel=\"noopener\">Integrated App development<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/custom-development\" target=\"_blank\" rel=\"noopener\">Custom App development<\/a> and <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/maintenance-support\" target=\"_blank\" rel=\"noopener\">Technical Support<\/a> to business partners and end users.<\/p>\n<p>Greytrix GUMU&#x2122; integration for Sage ERP \u2013 Salesforce is a 5-star app listed on <a href=\"https:\/\/appexchange.salesforce.com\/listingDetail?listingId=a0N30000000psM5EAI\" target=\"_blank\" rel=\"noopener\">Salesforce AppExchange<\/a>.<\/p>\n<p>For more information, please contact us at <a href=\"mailto:salesforce@greytrix.com\">salesforce@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n<p><strong><span style=\"font-size: Medium;\">Related Posts<\/span><\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/11\/23\/using-force-com-migration-tool-part-i-configuration\/\" target=\"_blank\" rel=\"noopener\">Using Force.com Migration Tool Part I \u2013 Configuration<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/10\/19\/enable-lightning-experience-on-salesforce\/\" target=\"_blank\" rel=\"noopener\">Enable Lightning Experience on Salesforce<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/10\/05\/pre-release-orgs-in-salesforce\/\" target=\"_blank\" rel=\"noopener\">Pre-release orgs in Salesforce<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/09\/03\/apex-message-as-debug-tool\/\" target=\"_blank\" rel=\"noopener\">Apex message as Debug Tool<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/09\/03\/deploying-project-using-force-com-ide\/\" target=\"_blank\" rel=\"noopener\">Deploying project using Force.com IDE<\/a><\/li>\n<li><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In our previous blog \u201cUsing Force.com Migration Tool Part I \u2013 Configuration\u201d, we discussed about setting up environment for using Ant tool. In this blog we will discuss about how to use Ant based Force.com Migration tool for metadata migration. Real-time, bi-directional, multi-company \u2013 Sage ERP Integration with Salesforce Steps for Metadata migration using Ant\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2015\/11\/23\/using-force-com-migration-tool-part-ii-deployment\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[91,631,630,627,235,632,237],"class_list":["post-1432","post","type-post","status-publish","format-standard","hentry","category-salesforce-srv","tag-deployment","tag-deployment-in-salesforce","tag-force-com-migration","tag-force-com-migration-tool","tag-metadata","tag-metadata-migration","tag-migration"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/1432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/comments?post=1432"}],"version-history":[{"count":6,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/1432\/revisions"}],"predecessor-version":[{"id":10839,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/1432\/revisions\/10839"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/media?parent=1432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/categories?post=1432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/tags?post=1432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}