Sonarqube migration

Hello,

I’m currently facing an issue while migrating my SonarQube postgrsql database, installed with Helm along with a sonarqube itslef, from a local container within GKE to a Google Cloud SQL PostgreSQL instance. Here’s what I’ve done so far:

  1. Created a PostgreSQL instance in Google Cloud Platform.
  2. Utilized pg_dump to extract the data from the existing PostgreSQL pod in GKE.
  3. Connected SonarQube to the newly created Google Cloud SQL database.
  4. Initially attempted to restore the dump directly, but encountered an error indicating that tables already existed. Subsequently, I cleared the database, retaining only the schema.
  5. Tried restoring the data using pg_restore, however, the restoration process seems to be incomplete. Although the data appears to be restored into my database, I’m unable to view it through the GUI.

I’d appreciate any guidance or insights on resolving this issue. Thank you in advance for your assistance.

Best regards,
Lunara

Hi Lunara,

Welcome to the community!

I think your problem is here. When you connect SonarQube to an empty schema, it’s going to create its tables & indexes.

Shut down SonarQube, clean out the schema and then try restoring your backup.

Make sure to delete $SONARQUBE-HOME/data/es8 before you start SonarQube back up to force the Elasticsearch indices to rebuild based on your newly restored DB backup.

 
HTH,
Ann

Hi, Ann!

Thank you, it worked. Now I have another issue. I had to disable the public IP of my Google PostgreSQL instance and I am having trouble connecting SonarQube to my PostgreSQL database with only the private IP.

Hi,

You’ll need to talk to your DBAs and/or network folks for that.

 
Ann

Thank you for your reply. Will do.

1 Like

This new question should be posted in a new thread but I’m going to reply anyway: look into using the private endpoint feature of whatever cloud provider you’re using which looks like GCP.
GCP: Private Service Connect
AWS: PrivateLink
Azure: Private Link

1 Like