Loading TOC...

xdmp:database-restore

xdmp:database-restore(
   $forestIDs as xs:unsignedLong*,
   $pathname as xs:string,
   [$restoreToTime as xs:dateTime?],
   [$journal-archiving as xs:boolean?],
   [$journal-archive-path as xs:string?],
   [$incremental-backup as xs:boolean?],
   [$incremental-backup-path as xs:string?],
   [$backup-passphrase as xs:string?],
   [$forest-map as map:map?]
) as xs:unsignedLong

Summary

Starts an asynchronous restore of the specified list of forests from the backup data directory. Returns a job ID that uniquely identifies the restore task.

Parameters
$forestIDs A sequence of forest IDs.
$pathname A backup data directory pathname.
$restoreToTime The date and time to restore the forest data to.
$journal-archiving Whether to restore from archived journals. Defaults to false.
$journal-archive-path Path to where archived journals are stored. Defaults to the backup data directory.
$incremental-backup Whether to restore using incremental backups. Defaults to false.
$incremental-backup-path Path to where incremental backups are stored. Defaults to the backup data directory.
$backup-passphrase An additional backup passphrase that can be used to restore from backup.
$forest-map An optional forest map that specify the change of forest topology.

Required Privileges

This operation requires at least one of the following privileges:

http://marklogic.com/xdmp/privileges/xdmp-database-restore

http://marklogic.com/xdmp/privileges/xdmp-database-restore/database/{id}

Usage Notes

Reindexing will stop while a backup or restore is in progress.

Example

xdmp:database-restore((11183608861595735720,898513504988507762),
    "/backups/Data")
=> 33030877979801813489

Example

let $map := map:map()
let $put := map:put($map, "forest1", ("forest2","forest3"))
let $put := map:put($map, "forest2", ("forest1"))
let $put := map:put($map, "forest3", (""))
return xdmp:database-restore(xdmp:database-forests(xdmp:database("db1")),
"/backups/Data",(),fn:false(),"",fn:false(),"","",$map)

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