How to determine Orphaned Personal and Global Spaces
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
This knowledge Base will provide instructions on how to get a list of all the Spaces(Personal/Global) created by Deleted Users.
Technical Background
Users who are no longer in Confluence due to user deletion will still have their content and Spaces preserved in Confluence.
A deleted user will technically be a row in the database, where a row exists in the user_mapping table, but the user_mapping.username does not map to a row in cwd_user.user_name.
Solution
The users who have been deleted from Confluence, will have the Creator column same as the username column in User_Mapping table.
To fetch the list of all Spaces which have been created by Deleted users, we can run the below query
1 2 3
select * from spaces s join user_mapping u on s.creator = u.username where SPACESTATUS='CURRENT'
To fetch the list of all Personal Spaces which have been created by Deleted users, we can run the below query
1 2 3 4
select * from spaces s join user_mapping u on s.creator = u.username where SPACESTATUS='CURRENT' and s.spacetype='personal'
Was this helpful?