Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-2071

Item Import with zip not working


    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.3, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 3.0, 3.1, 3.2, 4.0, 4.1
    • Fix Version/s: 5.0
    • Component/s: DSpace API
    • Attachments:
    • Comments:
    • Documentation Status:


      Using the command line Item Importer with ZIP file DS-204 doesn't appear to work correctly, crashing on ZIP'ed content, that is valid SimpleArchiveFormat.

      I had tried to use the item importer with ZIP with content that I created with SAFBuilder, and also with content that DSpace had created, using Item Export (from the UI), or Export Collection (from the UI). The issue that I'm having with the item importer with zip, is that it is expecting the input to not contain a subdirectory, where as, all of these ZIP's create a middle subdirectory.

      See stacktrace, the input was valid SimpleArchiveFormat, zipped up. https://gist.github.com/peterdietz/d8bee7d31fc4262efce7

      Might have worked in the old-way: item_export-123.zip, which extracts to:

      • item_0/(content, dublin_core.xml, file0.pdf)
      • item_1/(content, dublin_core.xml, file1.pdf)

      However, most ZIP's appear to unzip looking like:

      • item_export-123/item_0/(content, dublin_core.xml, file0.pdf)
      • item_export-123/item_1/(content, dublin_core.xml, file1.pdf)

      So, to accept this format, you need the item import --zip to bump the sourceDirectory with that sub directory.

      I have a fix for this, which I will attach shortly, and would appreciate testing before and after.

      P.S. To use the Item Importer with ZIP, you do:
      /dspace/bin/dspace import -a -e first@domain.com -c 123456789/123 -s /path/to/directory/ -z file.zip -m /path/to/import.map

      Where the --source is set to the directory the zip lives in, and --zip is set to the filename of the zip, exclusive of any path info.


          Issue Links



              • Assignee:
                peterdietz Peter Dietz
                peterdietz Peter Dietz
              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: