Loading TOC...


   $config as element(configuration),
   $database-id as xs:unsignedLong,
   $database-name as xs:string
) as element(configuration)


This function creates a new database specification with the same settings as the database with the specified ID. The new database configuration will have the specified name.

config A configuration specification, typically as returned from one of the Admin module functions.
database-id The ID of the database to copy (for example, xdmp:database("myDatabase") ).
database-name The name of the new database to create.

Required Privileges



  xquery version "1.0-ml";

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

  let $config := admin:get-configuration()
  admin:database-copy($config, xdmp:database("myOldDatabase"),

   => Creates a configuration with a new database specification
      having the same settings as the database named "myOldDatabase".
      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.