Bulk delete / purge Confluence page history / versions

So, the question is:
When I delete page versions from the history, do they really / automatically get purged or do i need to do something else? (Some DB SQL command maybe?)

For others desperate / left alone by Atlassian out there:

Sadly the Bob Swift CLI add-on that can selectively delete page versions has problems with our authentication and before I wait another year for our IT to solve that:

I found a really ugly, but straight-forward kludge:
iMacros browser extension (I used the FF one) three-liner (if you already are on the respective history page):

TAB T=1
TAG POS=2 TYPE=A ATTR=TXT:Delete
TAG POS=1 TYPE=BUTTON ATTR=TXT:Delete

Set the Loop Max and Manage > Settings > Timeout sufficiently high.

No worries, the script will err when there is no Delete button any more, so the current one will be preserved.

No problem to adapt that to leave some versions,...

Atlassian, please answer the question above!!!
Thanks
G.

3 answers

1 accepted

I'm not from atlassian but I can reply that one smile. When you delete a page version from page history section that information is also removed from the database together with all the child table references. As a prof of concept check the below test and outputs I've made against Confluence 5.8.4:

  1. Lest' create a page called "test page" and add an attachment (know how.txt) on the creation of that page.
  2. Now let's modify the page more two times.
  3. Now in the page history session we have 3 versions for our test page.
  4. After that we will run below queries:

    img.jpg

  5. In above image you can see 3 lines representing each version of your page plus one additional line representing the attachment we added.

  6. Now let's go to page history and remove the two first versions of the page and run those queries again:
    img2.jpg
  7. See that the previous two lines where removed? Also the line representing the attachment will remain as the attachment is still present in the latest page of our test. 

Hope this give you a better input on how Confluence works on the database level.

Thanks and Regards,
Lavitz - the guy that uses Confluence on Windows as a Hobby!

Sounds reasonable, Lambert. Thanks for jumping in! What the SQL DB does with the records marked for deletion is a whole other story, but there are recipes to reclaim the space. IAC there will be much less trash when I copy the space next time. Did you try SQL to delete history? Confluence as a hobby? Can´t say what I think. Thanks again G.

You are more than welcome :D. Never deleted the history manually as there's might be other tasks or attachments to delete depending on the content of the page (kinda risky). Yep, sometimes confluence is a pain in the @#$, but I do have some fun as well when checking the database structure.

Doug:
This year I used the Bob Swift CLI to remove the page versions, which saved hours of time. I too had the authentication problem, but we got around it by installing the CLI Client on the Confluence box and used ssh to run the commands.

Thanks, Doug, that was exactly the answer I was looking for!!!
Sadly I couldn´t find a way to convert your comment to an answer, so I did it with the quote.
If you can accomplish this with yours, please do!

I cross-linked this on the BobSwift issue I had opened for that.

Thanks again
G.

Glad I could help.

I used iMacros last year to reduce a large amount of page versions. This macro code will allow deleting the oldest version to then be able to loop for a set number of times that would then leave the X most recent page versions. It was my goal to leave pages with at least 10 page versions and a minimum of a week of history.

TAG POS=1 TYPE=TD ATTR=TXT:"v. 1"
TAG POS=R1 TYPE=A ATTR=TXT:"Delete" 
TAG POS=1 TYPE=BUTTON ATTR=TXT:Delete

This year I used the Bob Swift CLI to remove the page versions, which saved hours of time. I too had the authentication problem, but we got around it by installing the CLI Client on the Confluence box and used ssh to run the commands.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Sarah Goff-Dupont
Published 4 hours ago in Confluence

Think you know shares vs. @mentions in Confluence? Take this collab quiz.

To anyone who doubts that Atlassians are a little too obsessed with collaboration, and tools related thereto, let me describe a recent discussion we had (which took place on our internal Confluence, ...

54 views 2 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you