Failed to upgrade database schema

Unimus support forum
Post Reply
PatricF
Posts: 2
Joined: Thu May 08, 2025 6:42 pm

Thu May 08, 2025 7:08 pm

So I was moving my very old MySQL 5.7 database to a newer MariaDB 11.6. I'm running Unimus with Docker.
I took a backup of the database and imported it to the MariaDB instance, changed the settings for Unimus so it points to the new MariaDB and started it up. I get this error message:

Code: Select all

unimus  | 18:40:47.309 [main] DEBUG software.netcore.starter.AvailableEntropyCheck - Adding application entropy check listener into context.
unimus  |    ___   ___          _
unimus  |   /  /  /  / ____    (_) ____ ___    __  __  _____
unimus  |  /  /  /  / / __ \  / / / __ `__ \  / / / / / ___/
unimus  | /  /__/  / / / / / / / / / / / / / / /_/ / (__  )
unimus  | \___,___/ /_/ /_/ /_/ /_/ /_/ /_/  \__,_/ /____/
unimus  |
unimus  | :: ? 2016-2025 NetCore j.s.a. :: version 2.6.2 ::
unimus  |
unimus  | 2025-05-08 18:40:49.294  INFO 11 --- [           main] software.netcore.bootstrap.UnimusServer  : Starting UnimusServer v2.6.2 using Java 17.0.15 on 284aa08cb053 with PID 11 (/opt/unimus.jar started by root in /)
unimus  | 2025-05-08 18:40:49.296  INFO 11 --- [           main] software.netcore.bootstrap.UnimusServer  : The following 7 profiles are active: "unix", "unimus-unix", "jar", "unimus", "core", "LOCAL", "PUBLIC"
unimus  | 2025-05-08 18:41:16.538  INFO 11 --- [           main] n.u._.infrastructure.fqdn.FqdnResolver   : FQDN successfully resolved to '284aa08cb053'
unimus  | 2025-05-08 18:41:27.702  INFO 11 --- [           main] software.netcore.bootstrap.UnimusServer  : Started UnimusServer in 40.297 seconds (JVM running for 41.96)
unimus  | 2025-05-08 18:41:27.719  INFO 11 --- [  multicaster-3] s.netcore.starter.AppStartTimeMonitor    : Application started in: 30.717 seconds
unimus  | 2025-05-08 18:41:28.642  INFO 11 --- [cTaskExecutor-1] s.b.b.s.LoggingPathAccessibilityBootStep : Checking logging subsystem
unimus  | 2025-05-08 18:41:28.656  INFO 11 --- [cTaskExecutor-1] .s.b.b.s.DatabaseConnectionCheckBootStep : Testing database connection
unimus  | 2025-05-08 18:41:28.924  INFO 11 --- [cTaskExecutor-1] .s.b.b.s.DatabaseConnectionCheckBootStep : Database connection test passed
unimus  | 2025-05-08 18:41:28.924  INFO 11 --- [cTaskExecutor-1] n.u.s.b.b.step.DatabaseUpdateBootStep    : Connecting to database (MARIADB, jdbc:mariadb://10.100.1.38:3306/unimus?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC)
unimus  | 2025-05-08 18:41:28.925  INFO 11 --- [cTaskExecutor-1] n.u.s.b.b.step.DatabaseUpdateBootStep    : Updating database schema, please see web UI for progress
unimus  | 2025-05-08 18:41:43.496  WARN 11 --- [cTaskExecutor-1] n.u.d.d.LiquibaseChangeExecListenerImpl  : [runFailed] Changelog = 'db/changelog/mariadb/db.changelog-master-mariadb.xml'. ChangeSet = '2.6.0-0'. Reason = 'liquibase.exception.MigrationFailedException: Migration failed for change set db/changelog/mariadb/db.changelog-2.6.0-stable-mariadb.xml::2.6.0-0::DominikNagy:
unimus  |      Reason: liquibase.exception.DatabaseException: (conn=131069155) Duplicate column name 'dual_factor_enabled' [Failed SQL: (1060) ALTER TABLE unimus.system_account ADD dual_factor_enabled BIT(1) DEFAULT 0 NOT NULL, ADD dual_factor_secret VARCHAR(255) NULL, ADD dual_factor_scratch_notes VARCHAR(255) NULL, ADD dual_factor_remember_me_secret VARCHAR(64) NULL]'
unimus  | 2025-05-08 18:41:43.515 ERROR 11 --- [cTaskExecutor-1] n.u.s.b.b.step.DatabaseUpdateBootStep    : Failed to update database schema. Reason = 'liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set db/changelog/mariadb/db.changelog-2.6.0-stable-mariadb.xml::2.6.0-0::DominikNagy:
unimus  |      Reason: liquibase.exception.DatabaseException: (conn=131069155) Duplicate column name 'dual_factor_enabled' [Failed SQL: (1060) ALTER TABLE unimus.system_account ADD dual_factor_enabled BIT(1) DEFAULT 0 NOT NULL, ADD dual_factor_secret VARCHAR(255) NULL, ADD dual_factor_scratch_notes VARCHAR(255) NULL, ADD dual_factor_remember_me_secret VARCHAR(64) NULL]'.
I changed back to the old MySQL server and still get the same error. I rolled back from a backup from yesterday and I still get the same message. I rolled back to 2.6.1 and 2.6.0 and still get the same message. I can't wrap my head around this. I don't understand why I get the same message no matter which version or backup I use.

Can anyone explain to me what's wrong here?
PatricF
Posts: 2
Joined: Thu May 08, 2025 6:42 pm

Wed May 14, 2025 11:16 am

So I figured out why I couldn't migrate back to MySQL.
When I changed database.host to my MariaDB in unimus.properties it changed database.type by itself to MARIADB so when I tried to switch back to MySQL I hadn't noticed that it was changed.
I changed it back to MYSQL and I could get it working on the old database again.

For all the applications I've migrated I have never had any problem with going from MySQL to MariaDB.
Unimus however seems to do stuff differently.

So my question now is, how do I migrate from MySQL to MariaDB?
Laco
Posts: 15
Joined: Thu Sep 12, 2024 10:28 am

Wed May 14, 2025 1:44 pm

In this case, we recommend creating a Support ticket through the Unimus Portal. Our team will be happy to assist you from there.
Post Reply