Skip to main content

Using MarkLogic Content Pump (mlcp)

Basic Steps

To copy one database to another with mclp:

  1. Set -input_host, -input_port, -input_username, and -input_password to identify the source MarkLogic Server instance and user.

  2. Set -output_host, -output_port, -output_username, and -output_password to identify the destination MarkLogic Server instance and user.

  3. Select what documents to copy. For details, see Filtering Archive and Copy Contents.

    • To select documents in one or more collections, set -collection_filter to a comma separated list of collection URIs.

    • To select documents in one or more database directories, set -directory_filter to a comma separated list of directory URIs.

    • To select documents matching an XPath expression, use -document_selector. To use namespace prefixes in the XPath expression, define the prefix binding using -path_namespace.

    • To select document matching a query, use -query_filter. You can use this option alone or in combination with a directory, collection or document selector filter. False positives are possible; for details, see Understanding When Filters Are Accurate.

    • To select all documents in the database, leave -collection_filter, -directory_filter, -document_selector, and -query_filter unset.

  4. If you want to exclude some or all source document metadata:

    • Set -copy_collections to false to exclude document collections metadata.

    • Set -copy_permissions to false to exclude document permissions metadata.

    • Set -copy_properties to false to exclude document properties.

    • Set -copy_quality to false to exclude document quality metadata.

    • Set -copy_metadata to false to exclude document key-value metadata.

  5. If you want to add or override document metadata in the destination database:

    • Set -output_collections to add destination documents to a collection.

    • Set -output_permissions to add permissions to destination documents.

    • Set -output_quality to set the quality of destination documents.

  6. If you want the destination documents to have database URIs different from the source URIs, set -output_uri_replace, -output_uri_prefix, and/or -output_uri_suffix. For details, see Controlling Database URIs During Ingestion.

For a complete list of mlcp copy command options, see Copy Command Line Options.