How to migrate Postgres database to new kubernetes cluster?

  • I am migrating the SonarQube server to new Azure Kubernetes Cluster and while doing that it is required to migrate the database.
  • SonarQube is deployed using helm - using helm version 10.2.1+800
  • I want to move database of Postgres to new new cluster.
  • I tried to restore backup to new Postgres pod but it was not successful.

any help will be appriciated. Thanks.


Welcome to the community!

What part was not successful? Can you provide details?



I took dump of the sonarDB from the old postgresql pod using following command (successful).

pg_dump -U sonarUser -h <Postgres-service-IP> -F t sonarDB <dump-name.tar>

then I copied the <dump-name.tar> to a pod running in parallel to the new postgrsql pod and tried following command (unsuccessful)

pg_restore -h <service-IP> -p 5432 -U sonarUser -d sonarDB <dump-filename.tar>


So it was the restoration of the DB backup that failed?

That’s out of our scope. You should ask the Postgres folks.


Is there any working solution to transfer DB for sonarqube? or how can I move project from one server to another?


The project move feature is avalable if the destination instance is Enterprise Edition($$) or above.