...
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 import/export utility maybe be installed in one of two ways:
- Download executable jar (TBD)
- 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 | ||
---|---|---|
| ||
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.
...
Code Block | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
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
|