Where are favorite pages stored in the database?

I'm trying to run a sql query on what pages people have favorited.

Where does this information live in the Confluence database?

4 answers

3 votes

Hey,

Just to update this topic in case anyone have the same question, I created a query for this:

SELECT s.spacename, um.username
FROM spaces s INNER JOIN content_label cl ON s.spacedescid = cl.contentid
INNER JOIN user_mapping um ON cl.owner = um.user_key
INNER JOIN label l ON cl.labelid = l.labelid AND l.name = 'favourite';

Hope it helps :)

Best regards,

Eduardo Mallmann

Atlassian Support

I figured out the answer for myself.

Favorite pages are treated as labels. You can apply the "favourite" label (not the spelling) to a page. So you can see what pages have been favorited by looking up the favourite labelid in the label table, then joining it to the content_label table to figure out what content has the labelid applied to it.

In order to get a table showing you the title of the page and who favorited it, you'd have to join the content table to the join above.

Hi,

The above query fetches the spaces. Could you please help me in pointing out the pages along with the spaces marked as favorite from database?

 

Regards,

Arya

Also, is there a way to get information on favorites from Confluence Home directory?

 

Regards,

Arya

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...

372 views 20 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