DB upgrade from dspace 5 to dspace 7 not working

117 views
Skip to first unread message

Sven Koesling

unread,
Sep 1, 2023, 8:38:10 AM9/1/23
to DSpace Technical Support
Hi,

I installed DSpace 7.5 on a new server and am now trying to migrate the database comming from dspace 5 (postgresql 9). After db_restore flyway always throws an error:

[dspace@dev_server DSpace-Backend]$ bin/dspace database info
Caught exception:
java.lang.IllegalArgumentException: No enum constant org.flywaydb.core.api.MigrationType.INIT
at java.base/java.lang.Enum.valueOf(Enum.java:273)
at org.flywaydb.core.api.MigrationType.valueOf(MigrationType.java:21)
at org.flywaydb.core.api.MigrationType.fromString(MigrationType.java:112)
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory$2.mapRow(JdbcTableSchemaHistory.java:212)
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory$2.mapRow(JdbcTableSchemaHistory.java:197)
at org.flywaydb.core.internal.jdbc.JdbcTemplate.query(JdbcTemplate.java:344)
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.refreshCache(JdbcTableSchemaHistory.java:197)
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.allAppliedMigrations(JdbcTableSchemaHistory.java:187)
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.removeFailedMigrations(JdbcTableSchemaHistory.java:247)
at org.flywaydb.core.internal.command.DbRepair$1.call(DbRepair.java:121)
at org.flywaydb.core.internal.command.DbRepair$1.call(DbRepair.java:117)
at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:55)
at org.flywaydb.core.internal.command.DbRepair.repair(DbRepair.java:117)
at org.flywaydb.core.Flyway$7.execute(Flyway.java:339)
at org.flywaydb.core.Flyway$7.execute(Flyway.java:335)
at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:214)
at org.flywaydb.core.Flyway.repair(Flyway.java:335)
at org.dspace.storage.rdbms.FlywayUpgradeUtils.upgradeFlywayTable(FlywayUpgradeUtils.java:114)
at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:114)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:277)
at org.dspace.app.launcher.ScriptLauncher.handleScript(ScriptLauncher.java:133)
at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:98)


I tried several migration ways:
1. restore to pg 9.6.24, upgrade to pg13, dump dspace db, restore to dev-Server
  a) keep existing tables
  b) delete and create all tables, views etc.
2. restore to pg 9.6.24, upgrade to pg13, dump only dspace-db`s data, restore to dev-Server
3. directly restore the original dump to dev-server.

I tried all six ways with `psql -f etc/postgres/update-sequences.sql` and without. I created pg_crypto (dspace=# CREATE EXTENSION pgcrypto;).

Does anybody have a hint for me, who to track this down?

Thanks in advance,
Sven

DSpace Technical Support

unread,
Sep 1, 2023, 11:00:26 AM9/1/23
to DSpace Technical Support
Hi Sven,

We have a migration guide here which should walk you through the proper steps when moving data from one server (or an old Postgres) to another (or a new Postgres).  I know this guide has worked for many others (as we've received small improvements from community members over time), so hopefully it'll help you out as well.


If it continues to fail, you may also want to check your dspace.log immediately *after* running "./dspace database info" to see if more details are shown there regarding the error message.  Sometimes dspace.log will provide important details like the exact database table or column which it's having problems with.

Tim

Sven Koesling

unread,
Sep 4, 2023, 1:53:52 AM9/4/23
to DSpace Technical Support
Hi Tim,

thanks a lot and sorry - I should have mentioned that I started my journey by exactly following the migration guide. And thanks for the hint with the dspace.log. I don't know why I didn't check this before asking...

The sun is rising and it's a good day for a fresh start.

Sven
Reply all
Reply to author
Forward
0 new messages