7 Import/export
7.1 Import/export introduction
The export and import tools allow to copy (synchronize, replicate) documents
between Daisy repositories that have different
It is required that the repositories have different namespaces in order to keep the identity of the documents. For one-time transfer of documents from one repository to another, a tool could be made which recreates the documents in the target repository without preserving their IDs, which would then also require adjusting links in the content of documents. However, the import/export tools documented here do not cover this use-case.
An export not only contains documents but also schema, variant and namespace information.
The export tool can export all documents or subsets of documents (expressed using queries or a manual enumeration). Both upon export and import, manipulation of the content is possible. There are some built-in possibilities, e.g. to drop fields and parts from a document upon export or import, and for ultimate flexibility you can implement custom logic in a Java class. The import tool is smart enough to not update documents if there are no changes, so that no unncessary update events are caused.
The export and import tools are command-line applications, though the code is designed such that adding other user interfaces, or integration in for example the Daisy Wiki, should be possible.
Note that version history or time/user of the last modification is not
exported/imported, the import tool simply uses the normal Daisy APIs to
create/update content in the target repository. As such, the export/import tools
are not a replacement for

7.1.1 Applications
Export/import can be used for various purposes:
- Distributing a set of documents (for example, product documentation) to the Daisy repositories of clients, who can meanwhile also create their own content in Daisy that links to your documents. You can deliver a fresh export to them from time to time.
- Replicating content from an internal Daisy to an externally-visible Daisy. The export/import here serves as more controlled way to put documents live, and can also be used to decouple the load on the external Daisy from the internal one. In addition, you can export to multiple Daisy servers for load-balancing.
- Initializing a repository with some initial content. This is useful when doing Daisy-based projects, where you may want to upload some default data (navigation trees, home pages and other special pages). In this scenario, you will typically create the export data 'manually'.
Previous