Export and import of contexts¶
The following described operations can only be performed by the admin user.
Export¶
An export of a portfolio can be downloaded with the following HTTP request:
GET {base}/{context-id}/export[?metadataOnly&rdfFormat=mimeType]
The parameters metadataOnly
and rdfFormat
are optional.
If metadataOnly
is provided, only named graphs with metadata and cached external metadata will be exported, this means no entry or other structural information. This is intended to be used for contexts which should be imported into third-party repositories.
If rdfFormat
is provided with a valid and supported MIME type, like e.g. application/rdf+xml
, then the given RDF format is used in the exported file. If an invalid or no MIME type is given, Trig is used as the default format. Please note that !EntryStore makes use of named graphs and not all RDF formats have support for this.
The message body of the reply is a ZIP file containing the following files:
- triples.rdf - All triples of the context, i.e. entries, metadata, external metadata, etc. The triples are exported including the named graph information, which makes it a quadruple export
- resources folder - All locally stored binary resources
- export.properties - contains all relevant values for the import
The triples also include some statements with information about the export itself:
- The date and time when the export has been performed
- The base URI of the repository from which the context was exported
- The URI of the context itself
- Information about which users have been included as creators, contributors or via the ACL
Import¶
Precautions¶
All already existing entries in the destination context/portfolio will be deleted upon import.
Check the file export.properties
inside the ZIP file and create all users mentioned in the "containedUsers" property in the target system. This is needed to rewrite all ACL rules and creator/contributor information. The created users should have the same alias as on the original system.
The value of the containedUsers property looks like this:
containedUsers=1:testuser,5:anotheruser,_admin:admin,10:tenthuser
The values for each user are separated by commas, the information for each user consists of the user ID and the user's alias, separated by a colon. In the case of the first user, the ID is 1 and the alias testuser. If there is no colon followed by an alias in the list then there was no alias provided for that user - it might be a group as this does not require an alias.
Make sure that all user aliases mentioned in the containedUsers property do exist on the target system. You can check this in the administration interface.
HTTP Request¶
An exported ZIP file can be imported with the following HTTP request:
POST {base-uri}/{context-id}/import