How to use SQL Queries to Track Page Modifications by Date in Confluence

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs 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

Summary

As an admin, you may want to get a list of all articles within a space that have or haven't been modified recently. This export will return the title, page id, content type, and last modification date for all content in a specified space during a specified time period.

Environment

⚠️ These queries were written using PostgreSQL and MySQL. Depending on your database type, you may need to modify these queries in order to use them.

There currently isn't a way to export this information directly from the Confluence via the UI.

Solution

This info can be found by querying the database. Update the date and username in the queries below with the target date and run these against the database.

Find content that has been modified since a certain date in a specific space:

MySQL

1 2 3 SELECT content.title, content.pageid, content.contenttype, content.lastmoddate, spaces.spacename FROM content join spaces on content.spaceid=spaces.spaceid WHERE(content.lastmoddate) > '2019-05-10';

Oracle

1 2 3 SELECT content.title, content.pageid, content.contenttype, content.lastmoddate, spaces.spacename FROM content join spaces on content.spaceid=spaces.spaceid WHERE content.lastmoddate > TO_DATE('2019-05-10','YYYY-MM-DD')

This query will only return content that has a modification date after May 10th, 2019.

Find content that has not been modified since a certain date in a specific space:

MySQL

1 2 3 SELECT content.title, content.pageid, content.contenttype, content.lastmoddate, spaces.spacename FROM content join spaces on content.spaceid=spaces.spaceid WHERE(content.lastmoddate) <= '2019-05-10';

Oracle

1 2 3 SELECT content.title, content.pageid, content.contenttype, content.lastmoddate, spaces.spacename FROM content join spaces on content.spaceid=spaces.spaceid WHERE(content.lastmoddate) <= TO_DATE('2019-05-10','YYYY-MM-DD');

This query will only return content that has not been modified since May 10th, 2019.

Find a List of pages created by a specific user after a certain date in a specific space:

MySQL

1 2 3 4 5 SELECT c.title as "PAGE TITLE" , u.username, c.creationdate, s.spacename from content c inner join user_mapping u on c.creator=u.user_key inner join spaces s on c.spaceid=s.spaceid where c.creationdate>'2020-08-01' and c.contenttype='PAGE' and c.content_status='current' and u.username='admin'

Oracle

1 2 3 4 5 SELECT c.title as "PAGE TITLE" , u.username, c.creationdate, s.spacename from content c inner join user_mapping u on c.creator=u.user_key inner join spaces s on c.spaceid=s.spaceid where c.creationdate> TO_DATE('2020-08-01','YYYY-MM-DD') and c.contenttype='PAGE' and c.content_status='current' and u.username='admin'

Find a List of pages modified by a specific user after a certain date in a specific space:

MySQL

1 2 3 4 5 SELECT c.title as "PAGE TITLE" , u.username, c.lastmoddate, s.spacename from content c inner join user_mapping u on c.creator=u.user_key inner join spaces s on c.spaceid=s.spaceid where c.lastmoddate>'2020-08-01' and c.contenttype='PAGE' and c.content_status='current' and u.username='admin'

Oracle

1 2 3 4 5 SELECT c.title as "PAGE TITLE" , u.username, c.lastmoddate, s.spacename from content c inner join user_mapping u on c.creator=u.user_key inner join spaces s on c.spaceid=s.spaceid where c.lastmoddate>TO_DATE('2020-08-01','YYYY-MM-DD') and c.contenttype='PAGE' and c.content_status='current' and u.username='admin'

Find a List of Spaces created by a specific user after a certain date:

MySQL

1 2 3 4 SELECT c.spacename , u.username, c.creationdate from spaces c inner join user_mapping u on c.creator=u.user_key where c.creationdate>'2020-08-01' and c.spacestatus='CURRENT' and u.username='admin'

Oracle

1 2 3 4 SELECT c.spacename , u.username, c.creationdate from spaces c inner join user_mapping u on c.creator=u.user_key where c.creationdate>TO_DATE('2020-08-01','YYYY-MM-DD') and c.spacestatus='CURRENT' and u.username='admin'

Find a List of Spaces modified by a specific user after a certain date:

MySQL

1 2 3 4 SELECT c.spacename , u.username, c.lastmoddate from spaces c inner join user_mapping u on c.creator=u.user_key where c.lastmoddate>'2020-08-01' and c.spacestatus='CURRENT' and u.username='admin'

Oracle

1 2 3 4 SELECT c.spacename , u.username, c.lastmoddate from spaces c inner join user_mapping u on c.creator=u.user_key where c.lastmoddate>TO_DATE('2020-08-01','YYYY-MM-DD') and c.spacestatus='CURRENT' and u.username='admin'

This info can be found by querying the database. Update the date and username in the queries below with the target date and run these against the database.

Find content that has been modified since a certain date in a specific space:

MySQL

1 2 3 SELECT content.title, content.pageid, content.contenttype, content.lastmoddate, spaces.spacename FROM content join spaces on content.spaceid=spaces.spaceid WHERE(content.lastmoddate) > '2019-05-10';

Oracle

1 2 3 SELECT content.title, content.pageid, content.contenttype, content.lastmoddate, spaces.spacename FROM content join spaces on content.spaceid=spaces.spaceid WHERE content.lastmoddate > TO_DATE('2019-05-10','YYYY-MM-DD')

This query will only return content that has a modification date after May 10th, 2019.

Find content that has not been modified since a certain date in a specific space:

MySQL

1 2 3 SELECT content.title, content.pageid, content.contenttype, content.lastmoddate, spaces.spacename FROM content join spaces on content.spaceid=spaces.spaceid WHERE(content.lastmoddate) <= '2019-05-10';

Oracle

1 2 3 SELECT content.title, content.pageid, content.contenttype, content.lastmoddate, spaces.spacename FROM content join spaces on content.spaceid=spaces.spaceid WHERE(content.lastmoddate) <= TO_DATE('2019-05-10','YYYY-MM-DD');

This query will only return content that has not been modified since May 10th, 2019.

Find a List of pages created by a specific user after a certain date in a specific space:

MySQL

1 2 3 4 5 SELECT c.title as "PAGE TITLE" , u.username, c.creationdate, s.spacename from content c inner join user_mapping u on c.creator=u.user_key inner join spaces s on c.spaceid=s.spaceid where c.creationdate>'2020-08-01' and c.contenttype='PAGE' and c.content_status='current' and u.username='admin'

Oracle

1 2 3 4 5 SELECT c.title as "PAGE TITLE" , u.username, c.creationdate, s.spacename from content c inner join user_mapping u on c.creator=u.user_key inner join spaces s on c.spaceid=s.spaceid where c.creationdate> TO_DATE('2020-08-01','YYYY-MM-DD') and c.contenttype='PAGE' and c.content_status='current' and u.username='admin'

Find a List of pages modified by a specific user after a certain date in a specific space:

MySQL

1 2 3 4 5 SELECT c.title as "PAGE TITLE" , u.username, c.lastmoddate, s.spacename from content c inner join user_mapping u on c.creator=u.user_key inner join spaces s on c.spaceid=s.spaceid where c.lastmoddate>'2020-08-01' and c.contenttype='PAGE' and c.content_status='current' and u.username='admin'

Oracle

1 2 3 4 5 SELECT c.title as "PAGE TITLE" , u.username, c.lastmoddate, s.spacename from content c inner join user_mapping u on c.creator=u.user_key inner join spaces s on c.spaceid=s.spaceid where c.lastmoddate>TO_DATE('2020-08-01','YYYY-MM-DD') and c.contenttype='PAGE' and c.content_status='current' and u.username='admin'

Find a List of Spaces created by a specific user after a certain date:

MySQL

1 2 3 4 SELECT c.spacename , u.username, c.creationdate from spaces c inner join user_mapping u on c.creator=u.user_key where c.creationdate>'2020-08-01' and c.spacestatus='CURRENT' and u.username='admin'

Oracle

1 2 3 4 SELECT c.spacename , u.username, c.creationdate from spaces c inner join user_mapping u on c.creator=u.user_key where c.creationdate>TO_DATE('2020-08-01','YYYY-MM-DD') and c.spacestatus='CURRENT' and u.username='admin'

Find a List of Spaces with their latest modified date:

Oracle

1 2 3 4 SELECT spaces.spacename, MAX(content.lastmoddate) FROM content, spaces WHERE content.spaceid = spaces.spaceid GROUP BY spaces.spacename;

⚠️ Depending on what type of database you are running, you may need to format this query differently.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.