Reputation: 3373
I tried the following xquery example but it seems to be only returning a configuration script and not actually creating the NewDB on the server. What are the steps to actually create the DB and forest?
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin"
at "/MarkLogic/admin.xqy";
let $config := admin:get-configuration()
return
admin:database-copy($config, xdmp:database("ExistingDB"), "NewDB")
Upvotes: 3
Views: 280
Reputation: 8422
The missing step is to call admin:save-configuration(). Most of the admin function help you set up a revised configuration, with the idea that you'll apply all changes at once by calling the above function.
Additional reference: General Steps for Scripting Administrative Tasks -- part of the Scripting Administrative Tasks Guide
Upvotes: 2