Skip to main content

Using MarkLogic Content Pump (mlcp)

Loading Content and Metadata from an Archive

Follow this procedure to import content and metadata from a database archive created by the mlcp export command. A database archive is stored in one or more compressed files that contain documents and metadata.

  1. Set -input_file_path:

    • To load a single archive file, set -input_file_path to that file.

    • To load multiple archive files, set -input_file_path to a directory containing the compressed archive files.

  2. Set -document_type to mixed, or leave it unset since mixed is the default setting.

  3. Set -input_compressed to true.

  4. Set -input_file_type to archive.

  5. If the input archive was created without any metadata, set -archive_metadata_optional to true. If this is not set, an exception is thrown if the archive contains no metadata.

  6. If you want to exclude some or all of the document metadata in the archive:

    • 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 key-value metadata.

An archive is assumed to contain metadata. However, it is possible to create archives without metadata by setting all the metadata copying options (-copy_collections, -copy_permissions, etc.) to false during export. If an archive does not contain metadata, you must set -archive_metadata_optional to tell mlcp to proceed in the absence of metadata.

Note

When you import properties from an archive, you should disable the “maintain last modified” configuration option on the destination database during the import. Otherwise, you can get an XDMP-SPECIALPROP error if the import operation tries to update the last modified property. To disable this setting, use the Admin Interface or the library function admin:set-maintain-last-modified.

The following example command loads the database archive in /space/archive_dir:

# Windows users, see Modifying the Example Commands for Windows
$ mlcp.sh import -host localhost -port 8000 -username user \
    -password password -mode local -input_file_type archive \
    -input_file_path /space/archive_dir