I exported a collection to file system with the following statement:
mlcp.sh export -mode local -host some.url -port 8000 \
-username user -password password -output_file_path abcd -database some-database \
-collection_filter abcd -copy_collections true -ssl true \
-copy_metadata true -copy_properties true
but when I imported the collection to another database, the imported documents show no collection and the URI got changed to file path. The following is the statement that I used for import:
mlcp.sh import -mode local -host some-url -port 8000 \
-username user -password password -input_file_path ./abcd -database some-database \
-copy_collections true -ssl true \
-copy_metadata true -copy_properties true
What should I do so that the imported documents will retain their collection and URIs?
You can set the output_type
to document
or archive
.
-output_type string
The type of output to produce. Accepted values: document, archive. Default:
document
.
When you export the docs with output_type
of document
it only writes the document content and does not export the additional information maintained within the database.
When you set the output_type
to export to an archive, it will retain the collections, permissions, metadata, properties, and quality for those documents.
-output_type archive
and then you can import content from that archive:
-input_compressed
to true
.-input_file_type
to archive
.