admin.forestCopy( config as element(configuration), forest-id as (Number|String), forest-name as String, data-directory as String?, [large-data-directory as String?], [fast-data-directory as String?] ) as element(configuration)
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.
http://marklogic.com/xdmp/privileges/admin/forest
const admin = require('/MarkLogic/admin.xqy'); admin.forestCopy(admin.getConfiguration(), xdmp.forest("myForest"), "myNewForest",()) => returns the new configuration element -- use admin.saveConfiguration to save the changes to the configuration or pass the configuration to other Admin API functions to make other changes.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.