Migration from embedded HSQL database to MySQL

John McAlpin December 23, 2020

I have a completely functional Confluence Server system with quite a bit of data and attachments.  I would like Confluence to point to a local MySQL database (already installed and configured) rather than the current HSQL database.  The articles that I've found talk about setting this during initial installation.  How can I point Confluence to MySQL now that I've been up and running a year or so?

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 23, 2020

You can edit the confluence.cfg.xml file in the home directory to swap over, but a lot of the stuff in it is quite obscure and it would be a very good idea to work from an example copy.

An easy cheat would be to run an install of a new system (on the same version) and configure it for your new MySQL database, let it get to the point where you can log in, then stop it and then you'll be able to do a direct comparison on a MySQL vs H2 config files and pretty much copy and paste all the settings into the existing ones.

John McAlpin December 23, 2020

This is really beating me up.  I found a good xml from a previous Confluence/MySQL installation and tried numerous permutations on the XML without success.

Below are the differences I detected in "/var/atlassian/application-data/confluence/confluence.cfg.xml". Other than the id, licenses and keys of course. It just won't start. I go back to the original XML and it's fine (on H2).

Remove...

<setupType>install</setupType>
<buildNumber>8505</buildNumber>
<property name="hibernate.connection.driver_class">org.h2.Driver</property>
<property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.H2V4200Dialect</property>

Add...

<setupType>custom</setupType>
<buildNumber>8506</buildNumber>
<property name="hibernate.c3p0.preferredTestQuery">select 1</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://127.0.0.1:3306/Confluence</property>
<property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.MySQLDialect</property>

Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 27, 2020

For a MySQL setup a driver must be downloaded separately and put into filesystem.
Maybe this is already the obstacle.

Is there anything visible from logs as for the details when you say "it just don't start"?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.10.0
TAGS
AUG Leaders

Atlassian Community Events