Proper approach to manipulate Confluence Database

I'm working on a project that imports contents into Confluence. Since Confluence does not have masquerade feature(well, that's what JIRA ticket from couple of years ago suggested and there's still no update on the ticket.) , I manipulate Confluence Database directly by issuing SQL statements to restore original content creation date, original content creator, likes, and last modified date. To see the changes, I need to flush Confluence Cache and rebuild index. It is not an issue at this point as I'm working on test site. But, soon I'll be working on production site and I'm concern that this may corrupt the database. What should I do to prevent corrupting database?

2 answers

1 accepted

2 votes
  • Test your SQL to death on a test machine
  • Backup Confluence before running it on production
  • Have Confluence offline when you run the SQL
  • Restart and trigger a re-index

Your main problems are the caches and index, taking Confluence offline while you run SQL is the only way you can avoid damage to the database.  Ideally, avoid SQL like the plague, it's a last resort for working with Confluence (or JIRA)

Good points. Thanks!

0 vote

The relevant CONF issue for impersonating users: https://jira.atlassian.com/browse/CONF-6786

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
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

380 views 21 10
Join discussion

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