I want to delete the the pages in the spaces which is save in draft. So is any SQL query or any other script for removing draft pages in confluence?
Hi Siddheshwar,
You can easily deduct the SQL you need from the SQL on that page.
You'll need to do the following :
select
*
into
temp_conf
from
CONTENT
where
CONTENTTYPE=
'DRAFT' (maybe change this to how it works in you DB)
DELETE
FROM
BODYCONTENT
where
CONTENTID
IN
(
select
CONTENTID
from
temp_conf);
DELETE
from
ATTACHMENTS
where
PAGEID
in
(
select
CONTENTID
from
temp_conf);
DELETE
from
CONTENT
where
CONTENTID
in
(
select
CONTENTID
from
temp_conf);
Keep in mind that doing stuff in your database is not something you should consider doing lightly and is completely at your own risk.
Best regards,
Peter
I would say if you are going to delete the data then backup your instance and create a test environment out of it. Then do it in the test environment and validate that you didn't mess anything up. Once you are confident in the process then apply to production.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Yes I have taken the backup first and test it in dummy database. With the help of above SQL query I can delete the Draft from my confluence.
Thanks for the help...:)
Best Regards,
Siddheshwar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure which version of Confluence this is for. With 5.4.4 the above fails if any draft has an attachment. So I extended the initial query with _and CONTENTID not in (select PAGEID from ATTACHMENTS)_
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Siddheshwar
The information in this knowledge base article should help you out : https://confluence.atlassian.com/display/CONFKB/Removing+Orphaned+Draft
Best regards,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi peter,
I have already tried these steps, but this is only for the Orphaned Pages. But I want all the pages or spaces to be remove from the Draft.
Thanks,
Siddheshwar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.