I am trying to migrate the H2 database to an external PostgreSQL instance. DB-migrator executes without any errors and I can see the tables created in the target PostgreSQL database under schema ‘public’.
I also created /opt/sonatype/sonatype-work/nexus3/etc/fabric/nexus-store.properties
file with the following content:
username=nexus
password=password
jdbcUrl=jdbc\:postgresql\://host/nexus
And added the following line to /opt/sonatype/sonatype-work/nexus3/etc/nexus.properties
nexus.datastore.enabled=true
After starting nexus, it still uses the H2 database and does not detect the PostgreSQL configuration. From nexus.log you can find these logs:
2025-03-09 21:44:17,897+0330 INFO [FelixStartLevel] *SYSTEM org.sonatype.nexus.extender.NexusLifecycleManager - Start STORAGE
2025-03-09 21:44:17,908+0330 INFO [FelixStartLevel] *SYSTEM org.sonatype.nexus.datastore.DataStoreConfigurationDefaultSource - Loaded 'nexus' data store configuration defaults (Embedded H2)
2025-03-09 21:44:17,939+0330 INFO [FelixStartLevel] *SYSTEM com.zaxxer.hikari.HikariDataSource - nexus - Starting...
2025-03-09 21:44:18,167+0330 INFO [FelixStartLevel] *SYSTEM com.zaxxer.hikari.HikariDataSource - nexus - Start completed.
2025-03-09 21:44:18,168+0330 INFO [FelixStartLevel] *SYSTEM org.sonatype.nexus.datastore.mybatis.MyBatisDataStore - nexus - Loading MyBatis configuration from /opt/sonatype/nexus/etc/fabric/mybatis.xml
2025-03-09 21:44:18,234+0330 INFO [FelixStartLevel] *SYSTEM org.sonatype.nexus.datastore.mybatis.MyBatisDataStore - nexus - MyBatis databaseId: H2
Also tried setting database configuration via VM options but to no avail.
Nexus version: 3.75.1-01
DB migrator: 3.75.1-01
What am I doing wrong?