Convert from MySQL MyISAM to InnoDB Storage Engine

Still need help?

The Atlassian Community is here for you.

Ask the community

This article requires fixes

This article has been Flagged for fixing. Use caution when using it and fix it if you have Publisher rights.

For Atlassian eyes only

This article is Not Validated and cannot be shared with customers.

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

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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

At one point in time, you may have accidentally set up your databases using the MyISAM storage engine. Although MyISAM is fast, it lacks transactions and foreign key constraints, thus increasing the likelihood of database-based corruption.

To change to InnoDB

  1. Backup everything, and make a copy without create table information

    mysqldump -uroot dbname> dbbackup.sql
    mysqldump -uroot dbname --no-create-info > db_no_create.sql
    
  2. Download a fresh copy of the same version of Confluence
  3. Create a new database (create database foo)
  4. Set up Confluence against foo, taking care to ensure that you've got the engine and all other settings set correctly

    With the introduction of Active Objects, some tables are not populated immediately upon creating a Confluence instance. Active Objects database tables are generated lazily, meaning they won't be created until a feature that requires them is made. For example, the AO187CCC_SIDEBAR_LINK table won't be created until a space is made. Some Active Object tables are also created by plugins (such as Team Calendars for Confluence), and these will need to be installed to generate the necessary tables in the new database.

  5. Once you're done with setup, shutdown Confluence
  6. Make a backup, without data

    mysqldump -uroot foo --no-data> db_ddl.sql
    
  7. Make a 3rd database, restore the db_ddl.sql, then the db_no_create_.sql

    mysql -uroot newdb < db_ddl.sql
    mysql -uroot newdb < db_no_create.sql
    
  8. Edit confluence_home/confluence.cfg.xml, change the hibernate.connection.url to reference your new database. Ensure that your the connection string is of the following form:

    mysql://DBHOST/DBNAME?autoReconnect=true&characterEncoding=utf8&useUnicode=true&sessionVariables=storage_engine=InnoDB
Last modified on Dec 20, 2024

Was this helpful?

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