Migrate From PostgreSQL to SQL Server

Currently using SonarQube 7.9.5 Community edition, of which was installed by a contractor and I know NOTHING about the software or the database on which it is dependent.
I have talked our Middleware team to update SonarQube to the latest (Community) edition, and at the same time, I want to point it to SQL Server.

I am trying to find out the best way to migrate the existing data in the PostgreSQL database to the SQL Server database.

I do realize that there is a Tool for those that have SonarSource, but we do not have that option. Are there any directions that will allow me to migrate the data manually?

Is this just a matter of unloading the data from the tables on PostgreSQL and loading them into the correlating table in SQL Server, or is there more to it than that?

Any help or a shove in the right direction would be appreciated.

Ed Spencer

Hi Ed,

Is this just a matter of unloading the data from the tables on PostgreSQL and loading them into the correlating table in SQL Server, or is there more to it than that?

Yes, if you’re able to recreate both the schema and data in SQL Server, it will work. Replicating the schema in a different database might not be straightforward because there are differences between certain data types and constraints. The schema needs to match what SonarQube would create in an empty database, otherwise you can have errors when running it or later when trying to upgrade it in the future.

To avoid having to move the schema, you could try the following. I haven’t tried it - I’m not sure if it works, so definitely create a backup.

  1. Install SonarQube 8.9 and point it to your Postgresql DB. This will make SonarQube migrate its schema and data to v8.9
  2. Point SonarQube 8.9 to an empty SQL Server. SonarQube will create the schema and insert default data
  3. Truncate all tables in SQL Server
  4. Move data from one DB to the other. For this you’ll have to use 3rd party tool(s).

Thanks. I will look into this as an option.

~WRD0000.jpg