Basic Steps
To copy one database to another with mclp:
Set
-input_host
,-input_port
,-input_username
, and-input_password
to identify the source MarkLogic Server instance and user.Set
-output_host
,-output_port
,-output_username
, and-output_password
to 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_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.
If you want to exclude some or all source document metadata:
Set
-copy_collections
tofalse
to exclude document collections metadata.Set
-copy_permissions
tofalse
to exclude document permissions metadata.Set
-copy_properties
tofalse
to exclude document properties.Set
-copy_quality
tofalse
to exclude document quality metadata.Set
-copy_metadata
tofalse
to exclude document key-value metadata.
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.
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.