How to determine Orphaned Personal and Global Spaces
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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) which have been created by Deleted Users.
Technical Background
Users that are no longer in Confluence due to user deletion will still have their content and Spaces preserved in Confluence.
A deleted users will be technically a row in the database where a row exists in 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
- MySQL and PostGres SQL syntax
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
- MySQL and PostGres SQL syntax
select * from spaces s join user_mapping u on s.creator = u.username where SPACESTATUS='CURRENT' and s.spacetype='personal'