Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To see all the available command line options:

Code Block
languagetext
java -jar fcrepo-import-export/target/fcrepo-import-export-0.3.0-SNAPSHOT.jar -h

Note: You will see "Error parsing args: Unrecognized option: -h" but this is bug and will be addressed in forthcoming releases.

To export all the RDF and binary resources in your sample container:

Code Block
languagetext
java -jar fcrepo-import-export/target/fcrepo-import-export-0.3.0-SNAPSHOT.jar --mode export --resource http://localhost:8080/rest/albums --dir /tmp/test --binaries


You should now have RDF resources and binaries exported to /tmp/test.

...

  • Note, available logging levels are: TRACE, DEBUG, INFO, WARN, and ERROR
Code Block
languagetext
java -Dfcrepo.log.importexport=WARN -jar fcrepo-import-export/target/fcrepo-import-export-0.3.0-SNAPSHOT.jar --mode export --resource http://localhost:8080/rest/albums --dir /tmp/test --binaries


Options

Exporting only RDF

...

Pass the -u option to provide a username and password for Fedora basic authentication.
If you are using the Vagrant installation, it will have Fedora Auth enabled and you will need to add the following to your command:

Code Block
languagebash
-u fedoraAdmin:secret3 

Format Options

Pass -x option to use a different file extension on the exported rdf, or -l to change the rdf language used. For example if you want json-ld instead of turtle, use:

Code Block
languagebash
-x .json -l application/ld+json

The full list of available serializations is:

...

The following command will import the previous export into the same location of the same repository.

Code Block
languagetext
java -jar fcrepo-import-export/target/fcrepo-import-export-0.3.0-SNAPSHOT.jar --mode import --resource http://localhost:8080/rest/albums --dir /tmp/test --binaries

To import into a different repository and/or path,  use the map flag to ensure that the base URIs of the resources are properly translated in the new repository.

The following command will import the previous export into the same location of the same repository.  In other words,  the import would complete the migration of data from http://localhost:8080/rest/albums to http://localhost:8686/rest/albums.

Code Block
languagetext
java -jar fcrepo-import-export/target/fcrepo-import-export-0.3.0-SNAPSHOT.jar --mode import --resource http://localhost:8686/rest/albums --dir /tmp/test --binaries --map http://localhost:8080/rest/albums,http://localhost:8686/rest/albums