fcrepo-exts / fcrepo-import-export

Apache License 2.0
15 stars 19 forks source link

Use Available BagIt Manifests During Import #137

Closed mikejritter closed 4 years ago

mikejritter commented 4 years ago

Resolves: https://jira.lyrasis.org/browse/FCREPO-3208

Updates Importer to use a preferred manifest based on all available in a BagIt Bag


To test:

  1. Start a clean fedora instance
  2. Create a binary resource in the new repository
  3. Create a bag-config.yml with the following properites
    bag-info.txt:
    Source-Organization: fcrepo-import-export
    Organization-Address: localhost
    External-Description: Sample bag export for fcrepo-3208
  4. Run the exporter using the default bag profile and a directory name fcrepo-3208
    java -jar target/fcrepo-import-export-0.4.0-SNAPSHOT.jar --mode export --resource http://localhost:8080/fcrepo/rest --dir fcrepo-3208 --binaries --bag-profile default --bag-config bag-config.yml --user fedoraAdmin:secret3
  5. Create a sha256 manifest for the newly exported bag
    cd fcrepo-3208 
    find data -type f -print0 | xargs -0 -I {} sha256sum {} > manifest-sha256.txt                                                                                                                                               
  6. Start a fresh repository
  7. Run the import tool, with debug logging enabled to see the checksums used on import
    java -Dfcrepo.log.importexport=DEBUG -jar target/fcrepo-import-export-0.4.0-SNAPSHOT.jar --mode import --resource http://localhost:8080/fcrepo/rest --dir fcrepo-3208 --binaries --bag-profile default --bag-config bag-config.yml -u fedoraAdmin:secret3
  8. Verify that the resource is in the repository and has a sha256 digest
    curl -u fedoraAdmin:secret3 http://localhost:8080/fcrepo/rest/86feb268-750e-4cde-9dcb-25e8197be1b6/fcr:metadata
dbernstein commented 4 years ago

@mikejritter : it would be helpful if you could add a recipe for running a manual test of this functionality as well. Like "1. fire up fedora 2. PUT resource A. 3. export bag ..." with command line calls for each step to facilitate testing. Thanks and nice work!