Basic Steps
- Last Updated: April 14, 2026
- 2 minute read
- MarkLogic Server
- Version 10.0
- Documentation
To copy one database to another with mclp:
-
Set
-input_host,-input_port,-input_username, and-input_passwordto identify the source MarkLogic Server instance and user. -
Set
-output_host,-output_port,-output_username, and-output_passwordto identify the destination MarkLogic Server instance and user. -
Select what documents to copy. For details, see Filtering Archive and Copy Contents.
-
To select documents in one or more collections, set
-collection_filterto a comma-separated list of collection URIs. -
To select documents in one or more database directories, set
-directory_filterto 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_filterunset.
-
-
If you want to exclude some or all source document metadata:
-
Set
-copy_collectionstofalseto exclude document collections metadata. -
Set
-copy_permissionstofalseto exclude document permissions metadata. -
Set
-copy_propertiestofalseto exclude document properties. -
Set
-copy_qualitytofalseto exclude document quality metadata. -
Set
-copy_metadatatofalseto exclude document key-value metadata.
-
-
If you want to add or override document metadata in the destination database:
-
Set
-output_collectionsto add destination documents to a collection. -
Set
-output_permissionsto add permissions to destination documents. -
Set
-output_qualityto set the quality of destination documents.
-
-
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.