Bulk fix spaces from database with deprecated themes

Still need help?

The Atlassian Community is here for you.

Ask the community

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,

  1. Shutdown Confluence
  2. Please backup your database before performing any modification to your database

  3. 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';
    
  4. Restart Confluence

  5. Clear the browser cache.


Last modified on Aug 24, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.