Loading TOC...

MarkLogic 12 EA 2 Product Documentation
xdmp:database-backup

xdmp:database-backup(
   $forestIDs as xs:unsignedLong*,
   $pathname as xs:string,
   [$journal-archiving as xs:boolean?],
   [$journal-archive-path as xs:string?],
   [$lag-limit as xs:unsignedLong?],
   [$backup-kek-id as xs:string?],
   [$backup-passphrase as xs:string?]
) as xs:unsignedLong

Summary

Starts an asynchronous backup of the specified list of forests to the backup data directory. Optionally starts journal archiving of the specified list of forests to the specified journal archive directory. Returns a job ID that uniquely identifies the backup task.

Parameters
forestIDs A sequence of forest IDs.
pathname A backup data directory pathname. The directory must exist and be writable by the operating system user under which MarkLogic Server is running. The directory cannot be the MarkLogic Server install directory or the MarkLogic Server data directory. The directory specified can be an operating system mounted directory path, it can be an HDFS path, or it can be an S3 path. For detail on using HDFS and S3 storage in MarkLogic, see Disk Storage Considerations.
journal-archiving Whether or not to enable journal archiving. Defaults to false.
journal-archive-path Path to where archived journals are stored. Defaults to the backup data directory.
lag-limit Maximum difference in seconds that the archived journal can lag behind its forest's active journal. Defaults to 15.
backup-kek-id An additional backup key encryption key (KEK) that can be used to restore from backup. This parameter is only applicable when database encryption is enabled for use with an external KMS.
backup-passphrase An additional backup passphrase that can be used to encrypt the backup. If a passphrase is specified, it must have a length between 16 and 1000 characters

Required Privileges

This operation requires at least one of the following privileges:

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

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

Usage Notes

You cannot restore to a read-only forest.

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

The backup directory must exist on each host that has a forest specified in the database backup call (that is, the d-nodes in which the forests being backed up are hosted).

If enabling journal archiving, all forests must belong to the same database.

Example

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

Example

xdmp:database-backup(xdmp:database-forests(xdmp:database("Documents")),
    "/backups/Data", fn:true(), "/backups/JournalArchiving", 15)
=> 437302857479804813287

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