Choosing between Export and Extract
You can use the export
and extract
commands to save content in a MarkLogic database to files on the native file system. You should usually use export
rather than extract
. The extract
command is best suited for archive data in offline or read-only forests. Otherwise, use the export
command.
The extract
command places no load on MarkLogic Server. The export
command offloads most of the work to your MarkLogic cluster. Thus, export
honors document permissions, takes advantage of database indexes, and can apply transformations and filtering at the server. By contrast, extract
bypasses security (other than file permissions on the forest files), must access all document sequentially, and applies a limited set of filters on the client.
The export
command offers a richer set of filtering options than extract
. In addition, export
only accesses the documents selected by your options, while extract
must scan the entirety of each input forest, even when extracting selected documents.
For more information, see the following topics: