Issue in upgrading to sonarqube 7.9.3 lts

Hi All ,
I was using Sonarqube 6.1 and wanted to upgrade to latest lts .
So I upgraded to Sonarqube 6.7.7 lts first and migration is successful ,I have migrated by sql server too here .
Now I am trying to upgrade to server 7.9.3 lts . After Installing the server , I am not able to browse ‘sonarqubeurl/setup’ t o complete the migration . I am getting the attached error though the same db is working fine in ver 6.7.lts .
Can anyone please help on how to correct this issue .
Thanks in Advance !
Here’s the logs from web.log file :

 2020.06.21 20:50:12 INFO  web[][o.s.p.ProcessEntryPoint] Starting web
2020.06.21 20:50:12 INFO  web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2020.06.21 20:50:13 INFO  web[][o.e.p.PluginsService] no modules loaded
2020.06.21 20:50:13 INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2020.06.21 20:50:13 INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2020.06.21 20:50:13 INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.06.21 20:50:15 INFO  web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2020.06.21 20:50:15 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 7.9.3.33349 / ded65927f38a2b43427165f32243223c10bd415c
2020.06.21 20:50:15 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:sqlserver://dbserver:50002;databaseName=sonar
2020.06.21 20:50:16 INFO  web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: C:\sonarqube-7.9.3_community\sonarqube-7.9.3
2020.06.21 20:50:16 INFO  web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2020.06.21 20:50:16 ERROR web[][o.s.s.p.Platform] Web server startup failed
java.lang.IllegalStateException: Can not check that table schema_migrations exists
	at org.sonar.db.DatabaseUtils.wrapSqlException(DatabaseUtils.java:352)
	at org.sonar.db.DatabaseUtils.doTableExists(DatabaseUtils.java:309)
	at org.sonar.db.DatabaseUtils.tableExists(DatabaseUtils.java:290)
	at org.sonar.server.platform.db.migration.history.MigrationHistoryTableImpl.start(MigrationHistoryTableImpl.java:44)
	at java.base/java.util.Optional.ifPresent(Optional.java:183)
	at org.sonar.server.platform.platformlevel.PlatformLevel2.start(PlatformLevel2.java:107)
	at org.sonar.server.platform.Platform.start(Platform.java:211)
	at org.sonar.server.platform.Platform.startLevel2Container(Platform.java:177)
	at org.sonar.server.platform.Platform.init(Platform.java:87)
	at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:43)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4817)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5283)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The database name component of the object qualifier must be the name of the current database.
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1621)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:592)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:522)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2935)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:248)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:223)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQueryInternal(SQLServerPreparedStatement.java:458)
	at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getResultSetFromStoredProc(SQLServerDatabaseMetaData.java:345)
	at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getResultSetWithProvidedColumnNames(SQLServerDatabaseMetaData.java:357)
	at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getTables(SQLServerDatabaseMetaData.java:540)
	at org.apache.commons.dbcp2.DelegatingDatabaseMetaData.getTables(DelegatingDatabaseMetaData.java:902)
	at org.apache.commons.dbcp2.DelegatingDatabaseMetaData.getTables(DelegatingDatabaseMetaData.java:902)
	at org.sonar.db.DatabaseUtils.doTableExists(DatabaseUtils.java:300)
	... 17 common frames omitted
2020.06.21 20:50:17 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2020.06.21 20:50:17 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process

Here’s the logs from sonar.log file :

2020.06.21 20:50:00 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube-7.9.3_community\sonarqube-7.9.3\temp
2020.06.21 20:50:00 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.06.21 20:50:00 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [C:\sonarqube-7.9.3_community\sonarqube-7.9.3\elasticsearch]: C:\Program Files\Java\jdk-11.0.7\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=C:\sonarqube-7.9.3_community\sonarqube-7.9.3\temp -XX:ErrorFile=../logs/es_hs_err_pid%p.log -Des.enforce.bootstrap.checks=true -Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\sonarqube-7.9.3_community\sonarqube-7.9.3\elasticsearch -Des.path.conf=C:\sonarqube-7.9.3_community\sonarqube-7.9.3\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
2020.06.21 20:50:00 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020.06.21 20:50:01 INFO  app[][o.e.p.PluginsService] no modules loaded
2020.06.21 20:50:01 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.06.21 20:50:11 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2020.06.21 20:50:11 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [C:\sonarqube-7.9.3_community\sonarqube-7.9.3]: C:\Program Files\Java\jdk-11.0.7\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=C:\sonarqube-7.9.3_community\sonarqube-7.9.3\temp --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/common/*;C:\sonarqube-7.9.3_community\sonarqube-7.9.3\lib\jdbc\mssql\mssql-jdbc-7.2.2.jre11.jar org.sonar.server.app.WebServer C:\sonarqube-7.9.3_community\sonarqube-7.9.3\temp\sq-process1129916133121424868properties
2020.06.21 20:50:18 INFO  app[][o.s.a.SchedulerImpl] Process[web] is stopped
2020.06.21 20:50:18 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2020.06.21 20:50:18 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
SonarQube removed.

Hi @Rehan ,

can you check the database name? it looks like it might be the wrong database name in the sonar.properties

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The database name component of the object qualifier must be the name of the current database.

i am not an expert in MSSQL but a short google search showed that you can get the right database name using this query on the database

SELECT name, database_id, create_date FROM sys.databases;   

hope that helps to narrow down the issue

Hi Tobias ,
I am running the same db details in version 6.7 , and it’s running fine .
The issue is occurring only with version 7.9 .
I have crossed checked , db name is correct .

Regards,
Rehan

Hi Rehan,

and the names are 100% the same? since the 7.5 release the database name is case sensitive and this would result in the error message that you are facing.
You can read more about it in the release notes

Thanks Tobias ! , Case Sensitiveness was the issue ., It worked when I matched the exact cases.