How to recover or identify a lost shared draft after disabling collaborative editing in Confluence
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Purpose
If you've disabled collaborative editing and would like to recover your shared drafts, you can run the following to access them through your browser:
Solution
- Connect to your Confluence database
Run the following:
SELECT draft.contentid, s.spacename, draft.title, b.body FROM content draft JOIN spaces s on draft.spaceid = s.spaceid JOIN bodycontent b on b.contentid = draft.contentid JOIN content page on page.contentid = draft.prevver WHERE draft.contenttype = 'PAGE' AND draft.content_status = 'draft' AND draft.lastmoddate > page.lastmoddate;
- From the list, identify the title of the page you'd like to recover
- Copy the content from the body column
This content will be the XHTML or storage format that Confluence uses to store this information. If you'd like to restore this to a page in your instance, this can be done by installing the Confluence Source Editor plugin. You can then edit an existing page, click on the <> icon in the top right, and paste the XHTML code into the page.