Page tree
Skip to end of metadata
Go to start of metadata

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, that can be done by a Confluence administrator in the general Confluence administration at the section "PocketQuery".

Content of this page

Security

Export and import of single entities can be done by any PocketQuery administrator or editor, but are limited to the entity types the user is allowed 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 asteriks. This also happens if you export datasources by themselves. For this reason you will have to reenter 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.

Export

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 be included. Choosing "yes" will create an export that contains not only the query, but also the template, converter and datasource it uses. (For PocketQuery editors the datasource will be left out.)

Example

Here is an example export including the related entities for the query shown in the first picture:

example-export.xml
<object-stream>
  <list>
    <Database>
      <type>0</type>
      <name>WorldDB</name>
      <url>jdbc:mysql://localhost:3306/world</url>
      <user>root</user>
      <password>**********</password>
      <driver>com.mysql.jdbc.Driver</driver>
      <testurl></testurl>
      <applicationlinkid></applicationlinkid>
      <consumerkey></consumerkey>
      <consumersecret></consumersecret>
      <token></token>
      <tokensecret></tokensecret>
      <signaturemethod></signaturemethod>
      <requestparameters></requestparameters>
      <requestheaders></requestheaders>
    </Database>
  </list>
  <list>
    <Query>
      <name>My-Query</name>
      <statement>SELECT 1;</statement>
      <database>WorldDB</database>
      <template>My-Template</template>
      <spaces></spaces>
      <indexed>false</indexed>
      <paramtypes class="tree-map">
        <no-comparator/>
      </paramtypes>
      <cacheduration></cacheduration>
      <jsonpath></jsonpath>
      <converter>My-Converter</converter>
    </Query>
  </list>
  <list>
  </list>
  <list>
  </list>
</object-stream>


Import

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.

Override Mode

If you are trying to import an entity that already exists, as default there will be a number attached to the name of your imported entity. E.g. 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 "Override mode".

Keep in mind that overridden entities can not be restored.

Troubleshooting

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. (I.e. you are 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.





  • No labels