Assistance Needed with Migrating SonarQube Database to AWS RDS PostgreSQL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2024 11:49 AM
Hi ServiceNow Community,
I am currently working on upgrading my SonarQube setup and migrating its database to a new environment. Here’s the configuration I'm dealing with:
- Current SonarQube Version: 7.9 (Community Edition)
- Current Database: Internal PostgreSQL 12
- Target Database: AWS RDS PostgreSQL 13
- New SonarQube Instance: 9.9 (Community Edition)
Objective:
I need to migrate the existing data from the aws internal PostgreSQL 12 database (currently used by SonarQube 7.9) to an AWS RDS PostgreSQL 13 instance. After the migration, my goal is to connect this newly restored database to a new SonarQube 9.9 instance.
Steps I Have Taken:
Data Export Using pg_dump:
I used pg_dump to export the data from the internal PostgreSQL 12 database.Restore Data to AWS RDS PostgreSQL 13:
I restored the pg_dump output to the AWS RDS PostgreSQL 13 instance.Configure SonarQube 9.9 to Use the Restored Database:
I updated the sonar.properties file in the SonarQube 9.9 instance to point to the AWS RDS PostgreSQL 13 database.Start the New SonarQube 9.9 Instance:
I attempted to start the SonarQube 9.9 instance after making the necessary configurations.
Issues Faced:
- Schema Mismatch Error: The SonarQube 9.9 instance is not starting due to a schema mismatch error.
- Unable to See Data: The data from the old database is not visible in the new SonarQube instance.
Questions:
- Are there any compatibility issues or specific steps I might have missed when migrating from SonarQube 7.9 with PostgreSQL 12 to SonarQube 9.9 with PostgreSQL 13?
- What are the recommended procedures to resolve the schema mismatch error?
- Are there best practices for using pg_dump and restoring SonarQube databases, especially when upgrading across different versions?
- Would the SonarQube DB Copy Tool be suitable for this scenario? If so, is the DB Copy Tool free or does it require a paid license?
- I came across a reference to "Determining the server upgrade path" in the SonarQube Docs. Could someone explain the process for this step or provide guidance on how to approach it?
Any advice or insights from those who have managed similar migrations or have experience with SonarQube upgrades would be greatly appreciated!
Thank you for your help!
Best regards,
Martin Luther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 07:03 AM
Hey Martin!
- To upgrade from SonarQube v7.9 LTS to v9.9 LTS, you're going to have to upgrade to v8.9 LTS first. This is documented here (migration path). Trying to upgrade directly from v7.9 LTS to v9.9 LTS will result in a failed startup.
- A basic pg_dump and pg_restore should be all that is necessary (no DB Copy tool needed). Don't forget pg_upgrade if you're upgrading to a new major version of Postgres
- As noted in the thread you raised on the Sonar Community, you may need to trash and repopulate your Elasticsearch indices (/data/es8 folder of your SQ instance)