How to export Confluence Questions data

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

This guide is for informational purposes and is not eligible for support as part of the Atlassian Support Offerings.  If you have any questions about the information on this page, please reach out to our Atlassian Community for help.

Summary

Currently, the only way to migrate Confluence Questions data between two Confluence DC / Server instances is with a full Site Backup and Restore. Confluence Questions data is not included in Space Export.

There is an Enhancement Request to introduce this feature opened here  CONFSERVER-51723 - Getting issue details... STATUS

In certain situations, there might be a need to export or preserve Confluence Questions data, this KB offers a few options.

Solution

Rest API

 Note: The Confluence Questions that comes with REST API functionality is only from version 2.3.0 and above. If you are on an older version you will need to upgrade first.

  1. Export all questions refer here 

    GET http://<confluence>/rest/questions/1.0/question?limit=700
  2. Export all answers refer here.
    (info) This is per answerID

    GET http://<confluence>/rest/questions/1.0/answer/{answerId}

Database 

This process requires the use of direct database manipulation and is not part of Confluence's intended functionality. As such, this process is not covered under the Atlassian Support Offerings and the information on this page is provided as-is. It should be thoroughly tested in a development or staging environment before implementing any changes in your production instance.

Another option to retrieve this data would be to use SQL to query this information stored in the Confluence database.

The Q&A stores data in following tables:
- AO_B1DBB9_ACCEPTANCE
- AO_B1DBB9_BOUNTY
- AO_B1DBB9_VOTE
- CONTENT
- BODYCONTENT

All questions can be found using this query:

SELECT * FROM %YOURCONFLUENCEDBNAME%.CONTENT
where PLUGINKEY in
('com.atlassian.confluence.plugins.confluence-questions:question');

All answers can be fetched using this query:

SELECT * FROM %YOURCONFLUENCEDBNAME%.BODYCONTENT b
where b.CONTENTID in (
SELECT a.CONTENTID FROM %YOURCONFLUENCEDBNAME%.CONTENT a
where a.PLUGINKEY in
('com.atlassian.confluence.plugins.confluence-questions:answer'));

You can also export all information into CSV by following this KB:

How to export Confluence Questions Content to CSV Through the Database





Last modified on Oct 19, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.