marklogic / marklogic/marklogic-contentpump

Mlcp exports binary documents with XML content of other documents

Open
#83 3 comments 1 reaction 1 assignee View on GitHub

@abika5 is already working on this.

Since Sep 27, 2021.

bug major mlcp verify
Dominant language
Java
Stars
37
Forks
32
Avg merge
1h 3m
Merged PRs (30d)
12

Description

Situation

I am using mlcp to export all documents of a database to the local filesystem. In the end, I have the correct number of local files, but some files that should be binaries actually contain XML content from other documents. The XML documents themselves are okay.

Steps to reproduce the issue

  1. Unzip the content of import.zip into a local folder C:\Temp\mlcp\import :
    files
  2. Use mlcp to import the files into an empty database:
    mlcp.bat import -host localhost -port 8070 -username **** -password **** -mode local -input_file_path C:\Temp\mlcp\import -output_uri_replace "/C:/Temp/mlcp/import,''"
  3. Observe content of database in Query Console:
    in_ml
    For comparison with later results and to make sure everything is still okay after the import I used XQuery to determine the size of all documents:
    for $doc in fn:doc() let $uri := fn:document-uri($doc) let $size := if (fn:exists($doc/binary())) then xdmp:binary-size($doc/binary()) else xdmp:binary-size(xdmp:unquote(xdmp:quote($doc),(),"format-binary")/binary()) order by $uri ascending return $uri || " -> " || $size
    size_in_ml
    Everything looks good so far.
  4. Use mlcp to export all documents to the local filesystem:
    mlcp.bat export -host localhost -port 8070 -username **** -password **** -mode local -output_file_path C:\Temp\mlcp\export
  5. Compare import and export directory:
    comparison
    The XML documents and 5 out of 8 binary documents are okay. The problem is, that image-003.gif and image-008.gif now have to same content as doc-A.xml and image-007.gif has the same content as doc-B.xml.

My system environment

  • Windows 10 Pro (1709)
  • MarkLogic Server 9.0-5.1
  • mlcp 9.0.6
  • java 1.8.0_172

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.