-
Notifications
You must be signed in to change notification settings - Fork 10
Cookbook: Importing your packages into Islandora
MIK doesn't import content into Islandora, it just prepares the content so that it can be imported into Islandora. This recipe provides an overview of typical workflows for importing the packages generated by MIK into Islandora. To import the packages you've generated using MIK, you will need to use one of the three main Islandora batch ingest modules, Islandora Batch, Islandora Newspaper Batch, or Islandora Book Batch.
All three modules offer two options: 1) add the packages generated by MIK into one or more .zip files for uploading into Islandora using the web interface, or 2) using the Drupal command-line interface ("drush") on the server your Islandora is running on to import your packages.
It doesn't matter what program you use to create your zip files. But the following is important: each Drupal instance will set a limit on the size of files that you can upload. This means that your zip files need to be smaller than this limit. Ask your Islandora site's system administrator what the largest zip file you can upload is. You will need to take this into account when creating zip files for importing objects as described below.
Each of the three batch modules has its own way of letting you upload a zip file containing one or more objects.
Use this module for importing objects that contain a single file, such as one PDF, one image file, or one audio file. The zip file must contain one content file (.pdf, .tif, etc.) plus one MODS or DC XML file per object, and the content file and the .xml file for the same object must share the same file name; only the extensions will differ. But you don't need to worry about that because MIK creates the correct content file/XML pairs. What you need to worry about is that the zip file you create contains no subdirectories. For example, here is the contents of a zip file containing six objects generated by MIK:
2-1999-08-25.tif
2-1999-08-25.xml
3-1988-01-13.tif
3-1988-01-13.xml
3-2004-03-29.tif
3-2004-03-29.xml
5-9115-00-00.tif
5-9115-00-00.xml
5-9272-00-00.tif
5-9272-00-00.xml
6-2000-01-31.tif
6-2000-01-31.xml
MIK writes files into the directory identified in the [WRITER]
's output_directory
option in our .ini file. When you create your zip file for importing the objects into Islandora, make sure that your zip file contains only the output files and no subdirectories. Also note that you should move or delete all log files that MIK puts in the output directory before creating your zip file.
That's it - your zip file must contain no subdirectories or MIK log files.
Once you have your zip file, you can upload it by going to your collection in Islandora, then go to the 'Manage' tab, and then to the Collection subtab, where you will find "Batch Import Objects" link. This is where you upload your zip file.
Islandora Book Batch requires that a batch of books is broken up into separate directories, such that each directory that represents a book is at the top level zip file. Book pages are in their own subdirectories inside of each book directory.
As with single-file objects, MIK writes book files into the directory identified in the [WRITER]
's output_directory
option. The important thing to remember with books is when you create your zip file for importing the objects into Islandora, make sure that your zip file contains the directories for each book, and that the book-level directories are at the "top" of the zip file (that is, they should not be within a parent directory themselves). The structure of the directory MIK created is correct, all you have to do is zip up all the content beneath it. Also be sure to remove all log files generated by MIK before zipping up the contents of its output:
first_book/
MODS.xml
1/
MODS.xml
OBJ.tiff
JP2.jp2
OCR.txt
TN.jpg
2/
MODS.xml
OBJ.tiff
JP2.jp2
OCR.txt
TN.jpg
[etc.]
second_book/
MODS.xml
1/
MODS.xml
OBJ.tiff
JP2.jp2
OCR.txt
TN.jpg
2/
MODS.xml
OBJ.tiff
JP2.jp2
OCR.txt
TN.jpg
[etc.]
Once you have your zip file, you can upload it by going to your collection in Islandora, then go to the 'Manage' tab, and then to the Collection subtab, where you will find "Book Batch" link. This is where you upload your zip file containing your books.
Preparing newspaper issues for importing is similar to preparing the zip file for books. All you have to do is zip up the content of MIK's output directory after removing any log files that are in it. Each issue will be in its own subdirectory, and your zip file should not contain any directories other than those that contain each of the issues:
issue_/
MODS.xml
1/
MODS.xml
OBJ.tiff
JP2.jp2
OCR.txt
TN.jpg
2/
MODS.xml
OBJ.tiff
JP2.jp2
OCR.txt
TN.jpg
issue_2/
MODS.xml
1/
MODS.xml
OBJ.tiff
JP2.jp2
OCR.txt
TN.jpg
2/
MODS.xml
OBJ.tiff
JP2.jp2
OCR.txt
TN.jpg
Once you have your zip file containing issues for a specific newspaper, you can upload it into that newspaper object by going to the newspaper object in Islandora, and then going to its 'Manage' tab, where you will find the "Newspaper Batch" link. This is where you upload the zip file containing your newspaper issues. Remember that newspaper issues are imported into newspaper objects, not collections.
Using the batch importer modules' drush commands is your only option when your content is too large to upload via the web interface as a zip file. Importing via drush is also convenient during large migrations from other repository platforms.
Each of the three batch import modules document their Drush commands in their respective READMEs, so we won't repeat that information here.
For all three import modules, the structure of the content in MIK's output directory is identical to the structure of the input required by these modules' Drush commands when used with the --type=directory
option. The only difference will be the presence of log files that MIK creates. It is important to make sure that you remove any log files generated by MIK within its output directory before running drush.
Content on the Move to Islandora Kit wiki is licensed under a Creative Commons Attribution 4.0 International License.