Versions Compared

Key

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

...


The Camel Serializer Module is currently a proof of concept but has documentation and code. It works by listening for events about newly created resources, or edits to existing resources. As such, the re-indexer Camel component must be invoked to export resources that were created before it started listening, unless they are edited while the camel serializer Camel Serializer is turned on.

Exporting Resources Using the Export Tool

The command line tool is part of the Import Export Utility. This tool can export an entire repository, or a subset, and is intended as a method for creating a complete backup of a single Fedora container and all its descendant resources. From there, it can be imported back into the same Fedora repository, a different Fedora Repository, or into another external system.

Installing the import-export

...

utility

Fedora 4

The import/export utility is designed to work against the Fedora 4 REST API. Therefore, you first must have a running Fedora repository.

...

The import/export utility maybe be installed in one of two ways:

  1. Download executable jar (TBD)
  2. Build from source

Preparing sample data

...

Move to the directory where you downloaded the code. For Vagrant installs, this will be under /opt/fcrepo-import-export; otherwise, it will located in the directory where you cloned the GitHub repository when you build the tool from source. From there, you will need to locate the compiled jar file. If you build it from source, it will be in the GitHub repo at fcrepo-import-export/target/fcrepo-import-export-0.3.0.1-SNAPSHOT.jar.

To see all the available command line options:

Code Block
languagebashtext
java -jar fcrepo-import-export/target/fcrepo-import-export-0.3.0.1-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
languagebashtext
java -jar fcrepo-import-export/target/fcrepo-import-export-0.3.0.1-SNAPSHOT.jar --mode export --resource http://localhost:8080/rest/albums --descDirdir /tmp/descriptionstest --binDir /tmp/binaries


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

Logging

To change the import-export logging level (default is INFO), set the fcrepo.log.importexport system property when running the command:

  • 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

If you do not want backups of the binaries, omit the --binDir binaries option.  You cannot export binaries without the rdf metadata description. If you include the --binDir option, you must also include the --descDir option as well.

Authentication

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:

...

Exported resources may be imported back into the repository from which they came, or into the same path of another repository instance. This feature is currently under development and documentation will be made available in forthcoming releases.

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