Hi
I’m trying to upgrade an existing GN version 3.0.3 SQL server database to 3.12.6.
The issues I describe below are the migration files in folder "\WEB-INF\classes\setup\sql\migrate".
In an attempt to see exactly what is the source of my issues, I remove all and then adding back the versioned folders one by one incrementally (every time starting with an original 3.0.3 database)
The “migrate-default.sql” files in each version gets applied, but the *.java files give me issues - almost as if a none-SQL syntax is being used.
The first java file that trigger two errors is “*/v343/AdvancedSearchFormMigration.java”. (Log file below)
Any help/advice would be much appreciated.
Regards, Gert
2024-05-23 16:07:50,386 ERROR [geonetwork.databasemigration] - Invalid column name ‘true’.
com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name ‘true’.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:662)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
at org.fao.geonet.lib.DbLib.runSQL(DbLib.java:166)
at org.fao.geonet.lib.DbLib.insertData(DbLib.java:88)
at org.fao.geonet.DatabaseMigration.doMigration(DatabaseMigration.java:226)
at org.fao.geonet.DatabaseMigration.migrateDatabase(DatabaseMigration.java:148)
at org.fao.geonet.DatabaseMigration.postProcessAfterInitialization(DatabaseMigration.java:120)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:422)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:775)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
at jeeves.config.springutil.JeevesContextLoaderListener.contextInitialized(JeevesContextLoaderListener.java:87)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4441)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4899)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:710)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:687)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:661)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1016)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1903)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2024-05-23 16:07:50,855 ERROR [geonetwork.databasemigration] - The data types text and varchar are incompatible in the equal to operator.
com.microsoft.sqlserver.jdbc.SQLServerException: The data types text and varchar are incompatible in the equal to operator.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:662)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
at org.fao.geonet.lib.DbLib.runSQL(DbLib.java:166)
at org.fao.geonet.lib.DbLib.insertData(DbLib.java:88)
at org.fao.geonet.DatabaseMigration.doMigration(DatabaseMigration.java:226)
at org.fao.geonet.DatabaseMigration.migrateDatabase(DatabaseMigration.java:148)
at org.fao.geonet.DatabaseMigration.postProcessAfterInitialization(DatabaseMigration.java:120)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:422)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:775)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
at jeeves.config.springutil.JeevesContextLoaderListener.contextInitialized(JeevesContextLoaderListener.java:87)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4441)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4899)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:710)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:687)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:661)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1016)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1903)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)