Skip to main content

Using MarkLogic Content Pump (mlcp)

Export Command Line Options

This section summarizes the command line options available with the mlcp export command. The following command line options define your connection to MarkLogic:

Option

Description

-host comma-list

Required. A comma separated list of hosts through which mlcp can connect to the destination MarkLogic Server. You must specify at least one host. For more details, see How mlcp Uses the Host List.

-password string

Password for the MarkLogic Server user specified with -username. Required, unless using Kerberos authentication.

-port number

Port number of the source MarkLogic Server. There should be an XDBC App Server on this port. Default: 8000.

-username string

MarkLogic Server user from which to export documents. Required, unless using Kerberos authentication.

The following table lists command line options that define the characteristics of the export operation:

Option

Description

-collection_filter comma-list

A comma-separated list of collection URIs. mlcp exports only documents in these collections, plus related metadata. This option may not be combined with -directory_filter or -document_selector. Default: All documents and related metadata.

-compress boolean

Whether or not to compress the output document. Only applicable when -output_type is document. Default: false.

-content_encoding string

The character encoding of output documents when -input_file_type is documents. The option value must be a character set name accepted by your JVM; see java.nio.char­set.Charset. Default: UTF-8. Set to system to use the platform default encoding for the host on which mlcp runs.

-copy_collections boolean

When exporting documents to an archive, whether or not to copy collections to the destination. Default: true.

-copy_metadata boolean

When exporting documents to an archive, whether or not to copy key-value metadata to the destination. Default: true.

-copy_permissions boolean

When exporting documents to an archive, whether or not to copy document permissions to the destination. Default: true.

-copy_properties boolean

When exporting documents to an archive, whether or not to copy properties to the destination. Default: true.

-copy_quality boolean

When exporting documents to an archive, whether or not to copy document quality to the destination. Default: true.

-database string

The name of the source database. Default: The database associated with the source App Server identified by -host and -port.

-directory_filter comma-list

A comma-separated list of database directory names. mlcp exports only documents from these directories, plus related metadata. Directory names should usually end with “/”. This option may not be combined with -collection_filter or -document_selector. Default: All documents and related metadata.

-document_selector string

Specifies an XPath expression used to select which documents are exported from the database. The XPath expression should select fragment roots. This option may not be combined with -directory_filter or -collection_filter. Default: All documents and related metadata.

-indented boolean

Whether to pretty-print XML output. Default: false.

-keystore_password string

Password to a Java KeyStore containing the User Private Key(s) and Certificate(s); if available mlcp will select the first available certificate from the KeyStore that satisfy the TLS Certificate Request from the MarkLogic Server.

Can be passed along with the existing -ssl option.

-keystore_path string

Path to a Java KeyStore containing the User Private Key(s) and Certificate(s); if available mlcp will select the first available certificate from the KeyStore that satisfy the TLS Certificate Request from the MarkLogic Server.

Can be passed along with the existing -ssl option.

-max_split_size number

The maximum number of document fragments processed per split. Default: 20000 in local mode.

-max_threads

The maximum number of threads that run mlcp. This command line option is optional.

-mode string

Export mode. Accepted values: local.

-options_file string

Specify an options file pathname from which to read additional command line options. If you use an options file, this option must appear first. For details, see Options File Syntax.

-output_file_path string

Destination directory where the archive or documents are saved. The directory must not already exist.

-output_type string

The type of output to produce. Accepted values: document, archive. Default: document.

-output_type string

Specifies one or more namespace prefix bindings for namespace prefixes usable in path expressions passed to -document_selector. The list items should be alternating pairs of prefix names and namespace URIs, such as 'pfx1,http://my/ns1,pfx2,http://my/ns2'.

-query_filter string

Specifies a query to apply when selecting documents for export. The argument must be the XML serialization of a cts:query or JSON serialization of a cts.query. Only documents matching the query are considered for export; false positives are possible. For details, see Controlling What is Exported, Copied, or Extracted.

-redaction comma-list

Apply one or more redaction rule collections. The argument must be a comma-separated list of rule collection URIs. The rule collections must be installed in the schemas database. For details and example, see Redacting Content During Export or Copy Operations and Redacting Document Content in the Application Developer’s Guide.

-restrict_hosts boolean

Restrict mlcp to connect to MarkLogic only through the hosts listed in the -host option. Default: false (no restriction). For more details, see Restricting the Hosts mlcp Uses to Connect to MarkLogic.

-snapshot boolean

Whether or not to export a consistent point-in-time snapshot of the database contents. Default: false. When true, the job submission time is used as the database read timestamp for selecting documents to export. For details, see Extracting a Consistent Database Snapshot.

-ssl boolean

Enable/disable SSL secured communication with MarkLogic. Default: false. If you set this option to true, your App Server must be SSL enabled. For details, see Connecting to MarkLogic Using SSL.

-ssl_protocol string

Specify the protocol mlcp should use when creating an SSL connection to MarkLogic. You must include this option if you use the -ssl option to connect to an App Server configured to disable MarkLogic’s default protocol (TLSv1.2). Allowed values: tls, tlsv1, tlsv1.1, tlsv1.2. Default: TLSv1.2.

-thread_count number

The number of threads to spawn for concurrent exporting. The total number of threads spawned by the process can be larger than this number, but this option caps the number of concurrent sessions with MarkLogic Server. Only available in local mode. Default: 4.

-truststore_passwd string

Password to a Java TrustStore containing any necessary CA Certificates needed to verify the TLS Server Authentication connection. If no TrustStore is provided the default TrustStore used by the existing -ssl parameter is used.

Can be passed along with the existing -ssl option.

-truststore_path string

Path to a Java TrustStore containing any necessary CA Certificates needed to verify the TLS Server Authentication connection. If no TrustStore is provided the default TrustStore used by the existing -ssl parameter is used.

Can be passed along with the existing -ssl option.