Upgrade sonar 8 to 9 and postgres 10 to 14

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    version 8.0
  • how is SonarQube deployed: zip, Docker, Helm
    ZIP
  • what are you trying to achieve
    Upgrade 8 to 9 and postgres from 10 to 11
  • what have you tried so far to achieve this

install sonar 9.6.1 and postgres 14.7 with JDK17
If i run this without postgres but with H2 it’s fine
but when i use sonar.properties

sonar.jdbc.username=sonar
sonar.jdbc.password=*******
sonar.jdbc.url=jdbc:postgresql://localhost:5432/sonar (schema = public)

Manual i can connect with the DB

postgres@sonar0101e3 ~]$ psql -d postgresql://localhost:5432/sonar -U sonar
psql (14.7)
Type "help" for help.

sonar=# \c
You are now connected to database "sonar" as user "sonar".

This is the Error:

2023.05.08 15:18:50 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 9.6.1.59531 / 7398ee51f5da9a64ea123c98c5225aa5c41f700c
2023.05.08 15:18:50 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://localhost:5432/sonar
2023.05.08 15:18:51 INFO  web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /export/sonarqube-9.6.1
2023.05.08 15:18:51 INFO  web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2023.05.08 15:18:51 INFO  web[][o.s.c.e.CoreExtensionsLoader] Loaded core extensions: enterprise-edition, ce-workers, developer-scanner, developer-server, governance, license, securityreport, monitoring
2023.05.08 15:18:51 WARN  web[][o.s.c.a.AnnotationConfigApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@5ffd2b27-org.sonar.server.platform.DatabaseServerCompatibility': Initialization of bean failed; nested exception is Current version is too old. Please upgrade to Long Term Support version firstly.
2023.05.08 15:18:51 ERROR web[][o.s.s.p.PlatformImpl] Web server startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@5ffd2b27-org.sonar.server.platform.DatabaseServerCompatibility': Initialization of bean failed; nested exception is Current version is too old. Please upgrade to Long Term Support version firstly.

Thanks in advance for your support

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hi,

Here’s the root cause:

You’ve said you’re trying to upgrade from 8.0 to… 9.0(?).

You can’t do that.

From 8.0, you must upgrade to the next LTS version in the series: 8.9. From there you can upgrade to 9.0. Or (much) better yet, go straight to the current LTS, 9.9.1, since there’s no reason to upgrade to a version as old as 9.0. The docs explain the versioning and migration path.

Why did it work with H2? Because with no pre-existing DB, there’s nothing to migrate from, so you can’t run into the “version too old” error.

 
HTH,
Ann

Hi Ann,

Thanks for your answer we did that.
Yesterday we tried again and it migrate :slightly_smiling_face:

I will download the 9.9.1 and take your advice

Thank you.

Regards,
Velasco

1 Like