This page is about the import and export of single entities in the PocketQuery administration. If you want to export all of your entities at once for backup or migration, this can be done by a Confluence administrator, as described here: The PocketQuery Administration
Export and import of single entities can be done by any PocketQuery administrator or editor, but is limited to the entity types the user is permitted to maintain. A PocketQuery editor cannot import or export a datasource.
For security reasons, the password or datasources will be censored by replacing each letter with an asterisk. This also happens if you export datasources by themselves. For this reason you will have to re-enter the passwords to your datasources manually after importing them.
Selective exports are designed to only reveal as much information as visible in the PocketQuery administration. But please be aware that exports may still contain sensitive information, especially if datasources are included.
You can export entities by clicking on "Export" when viewing them. Once you clicked the button you will automatically download an XML file containing your entity.
Related Entities of Queries
Notice that when you export queries you will be asked whether you want the related entities to be included. Choosing “Yes“ will create an export that contains not only the query, but also the referenced template, converter, and datasource. (For PocketQuery editors the datasource will be omitted.)
Here is an example export including the related entities for the query shown in the first picture:
<object-stream> <list> <Database> <type>0</type> <url>jdbc:postgresql://worlddb/world-db</url> <user></user> <password></password> <driver>org.postgresql.Driver</driver> <resourcename>java:comp/env/</resourcename> <testurl></testurl> <applicationlinkid></applicationlinkid> <consumerkey></consumerkey> <consumersecret></consumersecret> <token></token> <tokensecret></tokensecret> <signaturemethod></signaturemethod> <requestparameters></requestparameters> <requestheaders></requestheaders> <authurl></authurl> <clientid></clientid> <clientsecret></clientsecret> <accesstoken></accesstoken> <refreshtoken></refreshtoken> <name>577f8c9a-f542-4615-b494-27c73e57c7d3</name> <displayname>World 3</displayname> </Database> </list> <list> <Query> <statement>SELECT * FROM COUNTRY</statement> <database>577f8c9a-f542-4615-b494-27c73e57c7d3</database> <template></template> <spaces></spaces> <indexed>false</indexed> <paramtypes class="tree-map"> <no-comparator/> </paramtypes> <cacheduration></cacheduration> <jsonpath></jsonpath> <converter></converter> <name>WorldDB</name> <displayname>WorldDB</displayname> </Query> </list> <list/> <list/> </object-stream>
To import your entities, switch to the “Import” tab in the PocketQuery administration. Choose the file you want to import and click the “Import” button.
If your import is successful you will be greeted by a message and are now able to use your imported entities.
If you are trying to import an entity that already exists, a number will be attached to the name of your imported entity by default. For example, if you are trying to import a template with the name “my-template” but there already is a template with this name, the newly imported template will be saved as “my-template-2”. If you instead want to override the existing entity, you can enable “Overwrite mode”.
Keep in mind that overwritten entities can not be restored.
The following errors can occur while importing entities and will cancel the import:
Your file is broken or contains invalid XML.
Your import contains a datasource but you are not permitted to maintain datasources. (e.g. you are “only” a PocketQuery editor.)
You are trying to import a query that uses a template, converter or datasource that does not exist (and is not included in the export).
The entity you are trying to import is not valid. Maybe its name contains prohibited symbols or a required attribute is missing.