Convert from MySQL MyISAM to InnoDB Storage Engine

Still need help?

The Atlassian Community is here for you.

Ask the community

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 Nov 2, 2018

Was this helpful?

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