which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
how is SonarQube deployed: zip, Docker, Helm
what are you trying to achieve
what have you tried so far to achieve this
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
Hi there,
I’m attempting to run the DB Copy Tool with both the source and destination running on Developer Edition v10.6 (92116) in a container on-premises. The target was recently downgraded from Enterprise Edition to Developer but remains on version 10.6 (92116) in the cloud (also in a container).
However, I’m encountering the following version error:
21:00:36 INFO **************** CONFIGURATION VERIFICATIONS ****************
21:00:36 INFO Database SOURCE has been reached at : ***
21:00:37 INFO Database DESTINATION has been reached at : *****
Exception in thread “main” com.sonar.dbcopy.utils.toolconfig.SqlDbCopyException: Problem when verifying version database. Please build your destination database with SonarQube at the same SonarQube source version.
at com.sonar.dbcopy.prepare.VersionVerifier.lastVersionId(VersionVerifier.java:49)
at com.sonar.dbcopy.StartApp.main(StartApp.java:81)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name ‘schema_migrations’.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:265)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1676)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:907)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:802)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7627)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:3916)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:268)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:242)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:724)
at com.sonar.dbcopy.prepare.VersionVerifier.lastVersionId(VersionVerifier.java:37)
I would appreciate any insights or assistance you can provide.
Thank you for your help!
Best regards,
Bammy-A
I have been following the provided documentation on the SonarQube DB Copy Tool (SonarQube database copy tool) for migrating the database.
However, my SonarQube instance is running in a containerized environment(AKS) within a pipeline, so I cannot use the traditional /bin/linux-x86-64/sonar.sh start command. Instead, I am accessing the container and trying to populate the sonar.properties file with the necessary JDBC parameters under the conf directory.
The issue I am encountering is that after restarting the container, the changes to the sonar.properties file are not retained, and the JDBC parameters are missing. Hence the SonarQube schema is not created when I check logs/web.log, as I am unable to persist these configuration changes.
Could you please assist me with a solution to ensure that the JDBC configuration persists across container restarts?
@Colin, Thanks for your response. I have the source SonarQube database running Oracle 19c Enterprise Edition (Release 19.0.0.0.0) on-prem, and the target database is Microsoft SQL Azure (RTM) version 12.0.2000.8. Both instances are currently running SonarQube 10.7.0 Developer Edition
Could the issue be related to incompatibility between these two databases? The error message I’m encountering states:
21:00:36 INFO **************** CONFIGURATION VERIFICATIONS ****************
21:00:36 INFO Database SOURCE has been reached at: ***
21:00:37 INFO Database DESTINATION has been reached at: *****
Exception in thread "main" com.sonar.dbcopy.utils.toolconfig.SqlDbCopyException: Problem when verifying version database. Please build your destination database with SonarQube at the same SonarQube source version.
Could this version mismatch be the cause of the issue? If so, what database version would be the most compatible, or how can I ensure that the databases will work together, given that the Microsoft SQL Azure (RTM) version 12.0.2000.8 is what has been suggested to work with.
Thanks for asking me to check this. I have queried both databases using the following SQL command:
SELECT MAX(version) FROM schema_migrations;
The result from the Azure SQL Database returned 2, while the result from the Oracle Database returned 95.
Given these differences, could you help me understand what might be causing the mismatch?
I then proceeded to export the schema_migeration table from oracle db into the azuresql where now I am able to confirm that they both have the same version 95. Also, went further to run the base command with the parameter but got an error
Exception in thread “main” com.sonar.dbcopy.utils.toolconfig.SqlDbCopyException: Problem when verifying version database. Please build your destination database with SonarQube at the same SonarQube source version.
at com.sonar.dbcopy.prepare.VersionVerifier.lastVersionId(VersionVerifier.java:49)
at com.sonar.dbcopy.StartApp.main(StartApp.java:81)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name ‘schema_migrations’.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:265)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1676)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:907)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:802)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7627)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:3916)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:268)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:242)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:724)
at com.sonar.dbcopy.prepare.VersionVerifier.lastVersionId(VersionVerifier.java:37)
I would appreciate any guidance on how to resolve this issue or any steps I should take next.