Bulk fix spaces from database with deprecated themes
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
Problem
Confluence has recently been updated and certain Spaces are rendering incorrectly.
Cause
More recent versions of Confluence may deprecate older themes. Spaces that are configured with this theme will be migrated automatically to a new theme during the upgrade process. In some scenarios, the spaces may not be migrated and can fixed by following this guide.
Resolutions
In this guide, we are using the Documentation Theme as an example of a deprecated theme (if you are trying to find another theme, please replace the LIKE section to the respective theme). For the Left Navigation Theme, replace the LIKE section with:
'%<string>com.atlassian.confluence.themes.leftnavigation:leftnavigation</string>%'
The following SQL query will list all spaces with the theme:
SELECT s.spacename, s.spacekey FROM spaces s
WHERE s.spacekey in (SELECT bandanacontext
FROM BANDANA
WHERE bandanavalue
LIKE '%<string>com.atlassian.confluence.plugins.doctheme:documentation</string>%' AND bandanakey = 'atlassian.confluence.theme.settings');
In order to change all spaces that use the Documentation Theme to the Default Theme,
- Shutdown Confluence
-
Please backup your database before performing any modification to your database
Use the following SQL query
UPDATE BANDANA SET bandanavalue ='<map> <entry> <string>theme.key</string> <string></string> </entry> </map>' WHERE bandanavalue LIKE '%<string>com.atlassian.confluence.plugins.doctheme:documentation</string>%' AND bandanakey = 'atlassian.confluence.theme.settings';
Restart Confluence
- Clear the browser cache.