Migrating Database server (postgres) with pg_dump/pg_restore issues

*Hi there :wave:

We are planning to migrate

  • our current SonarQube instance, deployed on an EC2 instance with a RDS PostgreSQL database to a new instance,
  • To a new instance running on Kubernetes, with an in-cluster PostgreSQL instance (managed by the Crunchy Postgres Operator

The current versions of our used Sonar stack is:

  • Sonar 10.1.*, deployed with Zip
  • PG 15.*

The new version would be:

  • Sonar 10.6.*, deployed with Helm
  • PG 16.3

:white_check_mark: So far, I deployed the new instance without any issues. I see in the administration panel that Sonar is connected to the PG instance.

Then I tried to migrate the database:

  • pg_dump the RDS instance from the EC2
  • pg_restore the data to the PostgreSQL instant running on Kubernetes.

The restore seems to have worked successfully. According to the metrics we have, the target database instance has grown to the size of the previous RDS one.

However, after restarting the statefulSet of Sonar on Kuberntes and logging in as Admin, I can not see any Projects from the previous instance. It is like its empty and no restoration has proceeded :thinking:

→ :question: Did I miss something?

PS: The current and used Sonar instance has a Developer Edition license. I am still waiting for a new license for our new Sonar instance. Could that be the reason?

:pray: Thanks to anyone who cares to answer my questions.

PS(2): I already read the following topics:

Hi,

Try forcing an ElasticSearch reindex.

 
HTH,
Ann

Hi G Ann Campbell :wave:

Thanks for your suggestion :pray:

It turns out that I needed to perform a Database migration :sweat_smile: …


So the proper migration path was:

Et voilĂ  !

The thing that confused me was that I deployed the PG instance + SonarQube at once with Helm, then tried to restore the dump from the previous Sonar instance.

This did not work since SonarQube had already initiated the DB with the proper schema and did not find the restored data that were not “proper” for the new Sonar version :upside_down_face:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.