Loading TOC...

MarkLogic 12 EA 1 Product Documentation
admin:forest-copy

admin:forest-copy(
   $config as element(configuration),
   $forest-id as xs:unsignedLong,
   $forest-name as xs:string,
   $data-directory as xs:string?,
   [$large-data-directory as xs:string?],
   [$fast-data-directory as xs:string?]
) as element(configuration)

Summary

This function creates a new forest specification with the same settings as the forest with the specified ID. The new forest configuration will have the specified name. It copies the forest configuration, but does not copy the forest data.

Parameters
config A configuration specification, typically as returned from one of the Admin module functions.
forest-id The ID of the forest. For example, xdmp:forest("myForest") specifies the ID for a forest named "myForest".
forest-name The name for the new forest.
data-directory The optional data directory of the forest. If no directory is specified, then it will be a private forest.
large-data-directory The optional directory where large objects are stored. If no directory is specified, then large objects will be stored in DATA_DIR/Forests/FOREST_NAME/Large.
fast-data-directory An optional directory located on a fast storage device, such as an SSD.

Required Privileges

http://marklogic.com/xdmp/privileges/admin/forest

Example


  xquery version "1.0-ml";

  import module namespace admin = "http://marklogic.com/xdmp/admin"
		  at "/MarkLogic/admin.xqy";

  admin:forest-copy(admin:get-configuration(), xdmp:forest("myForest"),
         "myNewForest",())

   => returns the new configuration element -- use admin:save-configuration
      to save the changes to the configuration or pass the configuration
      to other Admin API functions to make other changes.

  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.