Combining Forests
You can use the PUT:/manage/v2/forests
resource address to combine multiple forests into a single forest. For example, to combine the forests, 2011-0001
and 2011-0002
, into a single forest named 2011
, follow these steps:
$ cat combine-forests.xml <forest-combine xmlns="http://marklogic.com/manage"> <forests> <forest>2011-0001</forest> <forest>2011-0002</forest> </forests> <forest-name>2011</forest-name> <hosts> <host>MyHost</host> </hosts> </forest-combine>
$ curl --anyauth --user user:password -X PUT \ -d @combine-forests.xml -H 'Content-type: application/xml' \ http://MyHost:8002/manage/v2/forests
You can both combine forests and migrate the combined forest to another host in a single operation by specifying a different host value. You can also move the forests to a different storage tier (such as local-to-shared) by specifying one of the migration options described in Migrating Forests and Partitions.
Note
If you want to combine forests that are attached to databases configured for database replication, first combine the foreign replica forests with the snapshot
option before combining the master forests.
If failover is configured on your forests, do a full backup of database after a forest combine operation to ensure that you can recover your data should something go wrong. You may also need to increase the timeout setting on the combine operation, as it will take longer when failover is configured.