Daisy documentation
7.2.6 Using the import tool programaticallyBook Index7.3.2 Configuration

7.3 Export tool

The export tools exports data from a Daisy repository to a directory or zip file conforming to the Daisy import/export format.

For a basic usage scenario, see the introduction.

7.3.1 Specifying the set of documents to export

The documents to export are specified in an XML file which is passed to the export tool using the -f option.

The format of this file is as follows:

<?xml version="1.0"?>
    <query>select id where true</query>
    <document id="841-DSY" branch="main" language="default"/>

Both the query and document elements can be used as many times as desired. The branch and language attributes on the document element are optional.

Only the documents explicitely included via the query or document elements will be part of the export. So for example images included in these documents will not be automatically added.

When using queries, if you also want to export which documents are retired, then you need to include the retired documents too, via a query option:

<?xml version="1.0"?>
    <query>select id where true option include_retired = 'true'</query>
</documents> Specifying extra schema types, namespaces and collections to export

By default, the export tool will export the subset of the repository schema used by the documents in the export. The same is true for namespaces and collections. If you want to force certain of these items to be part of the export, even when they are not used by the exported documents, you can also list them in the export set file, by using the following elements:


These elements can be mixed between the document and query elements.

It is allowed, but optional, to use the root element exportSet instead of documents.


<?xml version="1.0"?>
    <query>select id where true</query>
    <document id="841-DSY" branch="main" language="default"/>
7.2.6 Using the import tool programatically7.3.2 Configuration