xdmp.databaseRestore( forestIDs as (Number|String)[], pathname as String, [restoreToTime as Date?], [journal-archiving as Boolean?], [journal-archive-path as String?], [incremental-backup as Boolean?], [incremental-backup-path as String?], [backup-passphrase as String?], [forest-map as Object?] ) as (Number|String)
Starts an asynchronous restore of the specified list of destination forests from the backup data directory. Returns a job ID that uniquely identifies the restore task.
http://marklogic.com/xdmp/privileges/xdmp-database-restore
http://marklogic.com/xdmp/privileges/xdmp-database-restore/database/{id}
Reindexing and rebalancing will stop while a backup or restore is in progress.
All forests in forestIDs
must exist in the current
configuration.
$forest-map
is a map from the names of destination forests
to be restored to the names of backup forests (fd1<-fb1, fd2<-fb2,
...).
Please note that there are several constraints on the map:
$forestIDs
, otherwise
XDMP-FORESTMAPNOTSUBSET
will be thrown.
forestIDs
are not provided in the
keys of the map, they will be self-mapped. Self-mapping means mapping
destination forests to backup forests that have the same names.$forest-map
is not provided, all forests will by
default be self-mapped.xdmp.databaseRestore([11183608861595735720,898513504988507762], "/backups/Data") => 33030877979801813489
const map = { fd1: xdmp.arrayValues(["fb1"]), fd2: xdmp.arrayValues(["fb2"]), fd3: xdmp.arrayValues(["fb3"]) }; xdmp.databaseRestore( xdmp.databaseForests(xdmp.database("db")), "/backups/Data", null, false, "", false, "", "", map); => 33030877979801813489
const map = { fd1: xdmp.arrayValues(["fb1","fb2"]), fd2: xdmp.arrayValues(["fb3"]), fd3: xdmp.arrayValues([]), fd4: xdmp.arrayValues([]) }; xdmp.databaseRestore( xdmp.databaseForests(xdmp.database("db")), "/backups/Data", null, false, "", false, "", "", map); => 33030877979801813489