MarkLogic Server 11.0 Product Documentation
xdmp.databaseRestoreValidate

xdmp.databaseRestoreValidate(
   forestIDs as (Number|String)[],
   pathname as String,
   [restoreToTime as Date?],
   [include-replicas as Boolean?],
   [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 Object

Summary

Validates that the specified list of destination forests can be restored from the backup data directory. Returns a database restore set node.

Parameters
forestIDs A sequence of destination forest IDs.
pathname A backup data directory pathname.
restoreToTime The date and time to restore the forest data to.
include-replicas Whether to include replica forests
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 backup passphrase that can be used to decrypt this backup.
forest-map An optional forest map that specify the change if forest topology.

Required Privileges

This operation requires at least one of the following privileges:

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

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

Example

xdmp.databaseRestoreValidate(
  xdmp.databaseForests(
            xdmp.database("MyDB")),
    // previously backed-up dir
    "/tmp/database_backup"
)
=>
{
    "tagInfo": {
        "version": "8.0-20141119",
        "jobid": "1975326905393827288",
        "startdate": "2014-11-19T10:37:37",
        "enddate": "2014-11-19T10:37:38"
    }
    ,
    "forests": [
        {
            "forestName": "forest1",
            "forestId": "12393306467180079458",
            "forestStatus": "okay",
            "directoryPath": "/tmp/database_backup/20141119-1037377997450",
            "directoryStatus": "okay",
            "action": "restore",
            "incrementalBackup": false,
            "journalArchiving": false
            "backupForests" : [
              {
                "forestName": "foresta",
                "directoryStatus": "okay",
              }
              {
                "forestName": "forestb",
                "directoryStatus": "okay",
              }
            ]
        },
        {
            "forestName": "forest2",
            "forestId": "2102578687500930109",
            "forestStatus": "okay",
            "directoryPath": "/tmp/database_backup/20141119-1037377997450",
            "directoryStatus": "okay",
            "action": "restore",
            "incrementalBackup": false,
            "journalArchiving": false
        }
    ],
    "databases": [
        {
            "databaseName": "MyDB",
            "databaseId": "13433268924640794832",
            "assignmentPolicyName": "bucket",
            "databaseForests": [
                {
                    "forestName": "forest1",
                    "forestId": "12393306467180079458"
                },
                {
                    "forestName": "forest2",
                    "forestId": "2102578687500930109"
                }
            ]
        }
    ]
}

Example

const map = {
    forest1: xdmp.arrayValues(["forest2", "forest3"]),
    forest2: xdmp.arrayValues(["forest1"]),
    forest3: xdmp.arrayValues([])
};
xdmp.databaseRestoreValidate(
xdmp.databaseForests(xdmp.database("db1")), "/space/tsoi/backup",
null, true, false, "", true, "", "", map);
=>
{
    "tagInfo": {
        "version": "9.0-20171103", 
        "jobid": "897252092727381381", 
        "startdate": "2017-11-03T13:38:42", 
        "enddate": "2017-11-03T13:38:43"
    }, 
    "forests": [
        {
        "forestName": "forest1", 
        "forestId": "172083195763380802", 
        "forestStatus": "okay", 
        "directoryPath": "/space/tsoi/backup/20171103-1337145777320", 
        "directoryStatus": "okay", 
        "action": "restore", 
        "incrementalBackup": true, 
        "incrementalDirectoryPath": "/space/tsoi/backup/20171103-1337145777320/20171103/1338338439870", 
        "incrementalDirectoryPathStatus": "okay", 
        "incrementalBackupTimestamp": "15097415138439870", 
        "incrementalMinQueryTimestamp": "15097409220413550", 
        "journalArchiving": false, 
        "backupForests": [
            {
            "forestName": "forest2", 
            "directoryStatus": "okay"
            }, 
            {
            "forestName": "forest3", 
            "directoryStatus": "okay"
            }
            ]
        }, 
        {
        "forestName": "forest2", 
        "forestId": "7765837070180252819", 
        "forestStatus": "okay", 
        "directoryPath": "/space/tsoi/backup/20171103-1337145777320", 
        "directoryStatus": "okay", 
        "action": "restore", 
        "incrementalBackup": true, 
        "incrementalDirectoryPath": "/space/tsoi/backup/20171103-1337145777320/20171103/1338338439870", 
        "incrementalDirectoryPathStatus": "okay", 
        "incrementalBackupTimestamp": "15097415138439870", 
        "incrementalMinQueryTimestamp": "15097409220413550", 
        "journalArchiving": false, 
        "backupForests": [
            {
            "forestName": "forest1", 
            "directoryStatus": "okay"
            }
            ]
        }, 
        {
        "forestName": "forest3", 
        "forestId": "8801375350195007054", 
        "forestStatus": "okay", 
        "directoryPath": "/space/tsoi/backup/20171103-1337145777320", 
        "directoryStatus": "okay", 
        "action": "restore", 
        "incrementalBackup": true, 
        "incrementalDirectoryPath": "/space/tsoi/backup/20171103-1337145777320/20171103/1338338439870", 
        "incrementalDirectoryPathStatus": "okay", 
        "incrementalBackupTimestamp": 0, 
        "incrementalMinQueryTimestamp": 0, 
        "journalArchiving": false, 
        "backupForests": [
            ]
        }
    ], 
    "databases": [
        {
        "databaseName": "db1", 
        "databaseId": "10598856079264601200", 
        "assignmentPolicyName": "bucket", 
        "databaseForests": [
            {
            "forestName": "forest1", 
            "forestId": "172083195763380802"
            }, 
            {
            "forestName": "forest2", 
            "forestId": "7765837070180252819"
            }, 
            {
            "forestName": "forest3", 
            "forestId": "8801375350195007054"
            }
            ]
        }
    ]
}
Powered by MarkLogic Server | Terms of Use | Privacy Policy