Replicate SonarQube prod server data in SonarQube dev server

Recently we built a new SonarQube dev server which is exactly the same version of SonarQube prod server(9.9 enterprise edition.). then restored SQ prod database to SQ dev server to make it exact copy of prod server. Now we are able to see all the projects information in SQ dev server as well.(the information is stale)
Is there a way we can make my dev server an exact copy of SQ prod server(the same data should present all the time or -mirror image)
one thought we are planning to implement is take backup of prod database every night and restore to SQ dev database. But we don’t want to change configuration or user data(only tables related to projects).
Is there a better way to achieve this or any documentation would be great.

Hi,

SonarQube shows you what’s in the database you’ve pointed it to. Replicating data between DB copies is beyond the scope of SonarQube itself. This looks like a conversation you need to have with your DBAs. Off-hand, a nightly job to copy the data and then update the relevant configs (SMTP &etc) is probably the best way to go here.

Could you share why you want to do this?

 
Thx,
Ann

Thanks Ann.
One of our teams wants to do API call on SonarQube data. We don’t want to give put more pressure on the SQ prod server and can’t give more access to the SQ prod server. So wanted to build SQ dev server as its replica and can give access to this server.

1 Like

In order to work with our DBA team, can you please let us know what are all the tables(database) that are related to projects that needs to be backed up to restore every night to SonarQube dev server?
Note: We don’t want to disturb user information, system configurations and license information

Hi,

We generally treat the DB like a black box. You should back up / restore all of it.

 
Ann

If we do the whole backup and restore from prod to dev. It is replacing the license information, server ID and configuration settings as well. We only want to replicate the projects data.

Hi,

I can’t guide you on DB internals.

 
Ann