Wednesday, 15 February 2017

Forest Migration at Local Node



Forest Migration is nothing but Change of Forest location one place to another place.


Now we can See 3 Forests Different Hosts .

Forest1->Primary Node
Forest2->Replica1 Node
Forest3->Replica2 Node




In our case all Forests are stored in data directory (/var/opt/MarkLogic)
But some Forest are created in different directory /var/MarkLoigc/data .

so we changed Forest directory like bellow /Var/opt/Mark Logic .

At we need create .Xml File. In XML file

1. Create migrate-forests.xml in node1 with below contents
<forest-migrate xmlns="http://marklogic.com/manage">
<forests>
<forest>Forest1</forest> /*forest name*/
</forests>
<host>mkl-dev-01.highroads.local</host> /*hostname*/
<data-directory>/var/opt/MarkLogic</data-directory> /*Directory_Name*/
<options>
<option>local-to-local</option>
</options>
</forest-migrate>


once created .xml file u need run this command to change old Forest location to new Forest location


2. Ran below curl command

curl --anyauth --user admin:admin -X PUT -d @"./migrate-forests.xml" -H 'Content-type: application/xml' 'http://mkl-dev-01.highroads.local:8002/manage/v2/forests'



Same procedure as to follow just replacing the forest name.Below are the two forests



now we can see Forest location changed to /var/opt/Marklogic/data to /var/opt/Marklogic.