Вы находитесь на странице: 1из 11

Getting Started with SalesForce CRM

Working Force.com Migration Utility

Description:
BISP is committed to provide BEST learning material to the beginners and advance learners. In the same series, we have prepared a complete end-to end Hands-on Beginners G ide !or Sales"orce. The doc ment !oc ses on !orce.com migration tilit#. $oin o r pro!essional training program and learn !rom e%perts.

History:
Version Description Change 0.1 Initial Draft 0.1 %e&ie'(1 Author Chandra Prakash har!a A!it har!a Publish Date 10th "ct #01$ 10th "ct #01$

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 1

Contents
......................................................................................................................................................... 2 Force.com Migration Tool Overview .................................................................................................3 Understanding Metadata API :....................................................................................................3 Installing the Force.com Migration Tool..........................................................................................3 How set ant ath :....................................................................................................................... ! ...................................................................................................................................................... " Using the Force.com Migration Tool .............................................................................................." #alesForce $onnection In%ormation:..........................................................................................." $onstr&cting a Pro'ect Mani%est :................................................................................................( )escri*ing Metadata T+ es :......................................................................................................, -isting $om onents %or a Metadata T+ e :................................................................................. $reating /etrieve Targets :.........................................................................................................0 /etrieving Metadata %rom a #alesForce Organi1ation :................................................................12

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 2

Force.com Migration Tool Overview


The Force.com Migration Tool is a 3ava4Ant5*ased command5line &tilit+ %or moving metadata *etween a local director+ and a #alesForce organi1ation. )evelo ment ro'ects where +o& need to o &late a test environment with large amo&nts o% set& changes 6 Ma7ing these changes &sing a 8e* inter%ace co&ld ta7e a long time. M&ltistage release rocesses 6 A t+ ical develo ment rocess re9&ires iterative *&ilding: testing: and staging *e%ore releasing to a rod&ction environment. #cri ted retrieval and de lo+ment o% com onents can ma7e this rocess m&ch more e%%icient. /e etitive de lo+ment &sing the same arameters 6 ;o& can retrieve all the metadata in +o&r organi1ation: ma7e changes: and de lo+ a s&*set o% com onents. I% +o& need to re eat this rocess: it<s as sim le as calling the same de lo+ment target again. 8hen migrating %rom stage to rod&ction is done *+ IT 6 An+one that re%ers de lo+ing in a scri ting environment will %ind the Force.com Migration Tool a %amiliar rocess.

Understanding Metadata API :


Metadata API contains a set o% o*'ects that manage set& and c&stomi1ation in%ormation =metadata> %or +o&r organi1ations: and the #OAP calls that mani &late those o*'ects. 8ith Metadata API +o& can: 8or7 with set& con%ig&ration as ?M- metadata %iles Migrate con%ig&ration changes *etween organi1ations $reate +o&r own tools %or managing organi1ation and a lication metadata

Installing the Force.com Migration Tool


@e%ore +o& install the Force.com Migration Tool +o& will need 3ava and Ant installed on +o&r local machine. +o& can download on this lin7 : htt :44ant.a ache.org4 and also need 3)A 1.(.B or later. . htt :44www.oracle.com4technetwor74'ava4'avase4downloads4indeB.html 1. Install 3ava and Ant. 2. -ogin to a #alesForce organi1ation and download the Force.com Migration Tool: as descri*ed in Installing the Force.com Migration Tool. download the Force.com Migration Tool %rom a #alesForce organi1ation. $lic7 on et!" C #evelo" C Tools: then clic7 Force.com Migration Tool. see *elow.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 3

#ave the .1i %ile locall+ and eBtract the contents to the director+ o% +o&r choice. $o + ant5sales%orce.'ar and aste into +o&r Ant installation<s li* director+. The li* director+ is located in the root %older o% +o&r Ant installation. A%ter install 3d7 chec7 'ava version o en command rom t then t+ e 'ava 5version: +o& can see *elow.

$ow set ant "ath :


ynta% &T A'T($OM&)my("ath(to(ant(*older &%am"le DB : #DT AETFHOMDG ):Hc sharmaHswHa ache5ant51.0.35*inHa ache5ant5 1.0.3 DB: $:HProgram FilesH3avaH'd71.,.2F!" DB : #DT PATHGIPATHIJIAETFHOMD I4*inJI3AKAFHOMDIH*inJ

&T +A,A($OM&)my("ath(to(-dk(*older &T PAT$).PAT$./.A'T($OM&.01in/ .+A,A($OM&.21in/

A%ter set ath +o& can chec7 ant version *+ &sing this s+ntaB. s+ntaB : ant 5version

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page !

Using the Force.com Migration Tool


The Force.com Migration Tool is a 3ava4Ant5*ased command5line &tilit+ %or moving metadata *etween a local director+ and a #alesForce organi1ation. The general roced&re +o& will %ollow when &sing the Force.com Migration Tool to co + metadata %rom one #alesForce organi1ation to another is: 1> Dnter credentials and connection in%ormation %or so&rce #alesForce organi1ation in *&ild. ro erties 2> $reate retrieve targets in *&ild.Bml 3> $onstr&ct a ro'ect mani%est in ac7age.Bml !> /&n the Force.com Migration Tool to retrieve metadata %iles %rom #alesForce "> Dnter credentials and connection in%ormation %or destination #alesForce organi1ation in *&ild. ro erties (> /&n the Force.com Migration Tool to de lo+ metadata %iles or deletions to #alesForce

alesForce Connection In*ormation:


1. Lo to the location where +o& eBtracted the Force.com Migration Tool %iles and o en the sam le s&*director+. 2. O en *&ild. ro erties in a teBt editor and s&*stit&te a valid #alesForce &sername and assword. I% +o& are &sing a sec&rit+ to7en: aste the 2"5digit to7en val&e to the end o% +o&r assword. +o& can see *elow.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page "

Constr!cting a Pro-ect Mani*est :


The ac7age.Bml %ile is a ro'ect mani%est that lists all the com onents +o& want to retrieve or de lo+ in a single re9&est. ;o& can retrieve or de lo+ onl+ a single ac7age at a time. The %ollowing elements ma+ *e de%ined in ac7age.Bml : 'ame #escri"tion 3*!ll'ame4 The name o% the server5side ac7age to de lo+ into. I% the M%&llEameC %ield is omitted: com onents will not *e assigned to a ac7age when de lo+ed: and will *e in the &n ac7aged ac7age. 3ty"es4 This element contains one or more Mmem*ersC tags and one MnameC tag: and is &sed to list the metadata com onents o% a certain t+ e to retrieve or de lo+. 3mem1ers4 The %&ll name o% a com onent. There is one Mmem*ersC element de%ined %or each com onent in the director+. ;o& can re lace the val&e in this mem*er with the wildcard character N =asteris7> instead o% listing each mem*er se aratel+. 3name4 There is one name de%ined %or each com onent t+ e in the director+. This is a child element o% Mt+ esC. 3version4 The Metadata API version n&m*er o% the %iles *eing retrieved or de lo+ed. 8hen de lo+ing: all the %iles m&st con%orm to the same version o% the Metadata API. "eci*ying tandard O1-ects : To retrieve standard o*'ects and4or c&stom %ields on standard o*'ects: +o& m&st name the com onent in ac7age.Bml.

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page (

"eci*ying 'amed Com"onents : To retrieve a com onent: s eci%+ the t+ e o% com onent in the MnameC element and declare each com onent to *e retrieved or de lo+ed in the Mmem*ersC element. The %ollowing is a sam le ac7age.

"eci*ying all Com"onents o* a Ty"e : To retrieve all com onents o% a artic&lar t+ e: &se the wildcard s+m*ol =N>. For eBam le: to retrieve all c&stom o*'ects:

"eci*ying tandard O1-ects : To retrieve standard o*'ects and4or c&stom %ields on standard o*'ects: +o& m&st name the com onent in ac7age.Bml.

#escri1ing Metadata Ty"es :


www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page ,

Field !sername

"assword

server!rl

a"i,ersion res!ltFilePath

trace

#escri"tion /e9&ired. The #alesForce &sername %or login. The &sername associated with this connection m&st have the OModi%+ All )ataO ermission. /e9&ired. The assword +o& &se to log into the organi1ation associated with this ro'ect. I% +o& are &sing a sec&rit+ to7en: aste the 2"5digit to7en val&e to the end o% +o&r assword. O tional. The #alesForce server U/- =i% *lan7: de%a&lts to login.sales%orce.com>. To connect to a sand*oB instance: change this to test.sales%orce.com. O tional. The API version to &se %or the metadata. The de%a&lt is 20.2. O tional. The ath o% the o&t &t %ile where res&lts are stored. The de%a&lt o&t &t is the console. )irecting the o&t &t to a %ile ma7es it easier to eBtract the relevant in%ormation %or +o&r ac7age.Bml mani%est %ile. O tional. )e%a&lts to %alse. Prints the #OAP re9&ests and res onses to the console. Eote that this will show the &ser<s assword in lain teBt d&ring login.

Let the list o% metadata t+ es ena*led %or +o&r organi1ation: s eci%+ a target in the *&ild.Bml %ile &sing

5isting Com"onents *or a Metadata Ty"e :


The listMetadata target retrieves ro ert+ in%ormation a*o&t metadata com onents in +o&r organi1ation. This target is &se%&l when +o& want to identi%+ individ&al com onents in ac7age. Field #escri"tion !sername /e9&ired. The #alesForce &sername %or login. The &sername associated with this connection m&st have the PModi%+ All )ataQ ermission. "assword /e9&ired. The assword +o& &se to log into the organi1ation associated with this ro'ect. I% +o& are &sing a sec&rit+ to7en: aste the 2"5digit to7en val&e to the end o% +o&r assword. server!rl O tional. The #alesForce server U/- =i% *lan7: de%a&lts to login.sales%orce.com>. To connect to a sand*oB instance: change this to test.sales%orce.com. metadataTy"e /e9&ired. The name o% the metadata t+ e %or which +o& are retrieving ro ert+ in%ormationJ %or eBam le: $&stomO*'ect %or c&stom o*'ects: or /e ort %or c&stom re orts. *older The %older associated with the com onent. This %ield is re9&ired %or com onents that &se %olders: s&ch as )ash*oard: )oc&ment: Dmail Tem late: www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page .

a"i,ersion res!ltFilePath

trace

or /e ort. O tional. The API version to &se %or the metadata. The de%a&lt is 20.2. O tional. The ath o% the o&t &t %ile where res&lts are stored. The de%a&lt o&t &t is the console. )irecting the o&t &t to a %ile ma7es it easier to eBtract the relevant in%ormation %or +o&r ac7age.Bml mani%est %ile. O tional. )e%a&lts to %alse. Prints the #OAP re9&ests and res onses to the console. Eote that this will show the &ser<s assword in lain teBt d&ring login.

Let ro ert+ in%ormation %or com onents o% one metadata t+ e: s&ch as $&stomO*'ect: s eci%+ a target in the *&ild.Bml %ile &sing

Creating 6etrieve Targets :


The *&ild.Bml %ile s eci%ies a series o% commands to *e eBec&ted *+ Ant. 8ithin the *&ild.Bml %ile are named targets that rocess a series o% commands when +o& r&n Ant with a target name. The %ollowing arameters ma+ *e set %or each Ms%:retrieveC target : Field #escri"tion !sername /e9&ired. The #alesForce &sername %or login. The &sername associated with this connection m&st have the PModi%+ All )ataQ ermission. "assword /e9&ired. The assword +o& &se to log into the organi1ation associated with this ro'ect. I% +o& are &sing a sec&rit+ to7en: aste the 2"5digit to7en val&e to the end o% +o&r assword. server!rl O tional. The #alesForce server U/- =i% *lan7: de%a&lts to login.sales%orce.com>. To connect to a sand*oB instance: change this to test.sales%orce.com. retrieveTarget /e9&ired. The root o% the director+ str&ct&re into which the metadata %iles are retrieved. "ackage'ames /e9&ired i% &n ac7aged is not s eci%ied. A comma5se arated list o% the names o% the ac7ages to retrieve. a"i,ersion O tional. The API version to &se %or the metadata. The de%a&lt is 20.2. pollWaitMillis O tional. )e%a&lts to 12222. The n&m*er o% milliseconds to wait *etween attem ts when olling %or res&lts o% the retrieve re9&est. ma%Poll O tional. )e%a&lts to 22. The n&m*er o% times to oll the server %or the res&lts o% the retrieve re9&est. singlePackage O tional. )e%a&lts to tr&e. This m&st *e set to %alse i% +o& are retrieving m&lti le www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 0

trace

!n"ackaged

!n7i"

ac7ages. I% set to %alse: the retrieved 1i %ile incl&des an eBtra to 5level director+ containing a s&*director+ %or each ac7age. O tional. )e%a&lts to %alse. Prints the #OAP re9&ests and res onses to the console. Eote that this will show the &ser<s assword in lain teBt d&ring login. /e9&ired i% ac7ageEames is not s eci%ied. The ath and name o% a %ile mani%est that s eci%ies the com onents to retrieve. O tional. )e%a&lts to tr&e. I% set to tr&e: the retrieved com onents are &n1i ed.

6etrieving Metadata *rom a alesForce Organi7ation :


To retrieve Force.com com"onents : 1. O en a command rom t. 2. /&n Ant *+ s eci%+ing a target name in *&ild.Bml. I% this is the %irst time +o& are r&nning Ant: &se ant retrieveUn ac7aged to retrieve &n ac7aged com onents s eci%ied in ac7age.Bml. 6!nning Tests in a #e"loyment : For de lo+ment to a rod&ction organi1ation: all the tests in +o&r organi1ation: eBce t %or those that originate %rom installed I% the de lo+ment incl&des com onents %or an+ o% the %ollowing metadata t+ es: all the tests are a&tomaticall+ r&n. A eB$lass A eB$om onent A eBPage A eBTrigger ArticleT+ e $riteria@ased#haring/&le $&stom)ataT+ e $&stomField $&stomO*'ect )ata$ategor+Lro& Flow InstalledPac7age EamedFilter Owner#haring/&le Permission#et Pro%ile R&e&e /emote#ite#etting/ecordT+ e /ole #haring/eason www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 12

Territor+ Kalidation /&les 8or7%low

www.bispsolutions.com

www.bisptrainigs.com

www.hyperionguru.com

Page 11

Вам также может понравиться