Sonar Database View Specific Project

263 views
Skip to first unread message

soma.sr...@gmail.com

unread,
Oct 6, 2016, 12:39:40 PM10/6/16
to SonarQube
Hello can someone tell me about where in sonar database tables  all my project's group id and artifact id stored i have to change the group id of a specific project it would be great if you can help me with the sql query 

Freddy Mallet

unread,
Oct 7, 2016, 6:07:59 AM10/7/16
to soma.sr...@gmail.com, SonarQube
Any direct updates to the DB can only lead to some unexpected behaviors.

Please go to your project > Administration > Update Key through the SQ UI to update this key.

Cheers
Freddy

update_key.png

On Thu, Oct 6, 2016 at 6:39 PM <soma.sr...@gmail.com> wrote:
Hello can someone tell me about where in sonar database tables  all my project's group id and artifact id stored i have to change the group id of a specific project it would be great if you can help me with the sql query 

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/756ba09c-f23d-49be-a436-5fb82f5d801f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Freddy MALLET | SonarSource
Product Director & Co-Founder
http://sonarsource.com

soma srikanth

unread,
Oct 7, 2016, 9:53:01 AM10/7/16
to SonarQube, soma.sr...@gmail.com
Hey Mallet thanks for responding let me explain my situation clearly we have project publishing on sonar from sometime back we changed the project group id of that project now when the analysis done sonar assumes that as new project cause of change in group id now we don't want to loose the old historic data after doing some research they suggested me to use the following query in order to migrate old sonar data of this project to  new project so i used following query 
set sql_safe_updates=0;
update projects
set kee = replace(kee,'nl.foo','nl.bar') after i execute this i'm able change my old group id to new group id 
when i ran the sonar job it gives me following error Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project project name: Fail to execute request [code=500, url=sonar host url Response code: 500 -> [Help 1] can i resolve this by deleting the project the project which used to have old group id ?

Freddy Mallet

unread,
Oct 7, 2016, 10:46:10 AM10/7/16
to soma srikanth, SonarQube
Hello Soma,

I understand your concern but the DB is not an API so I'm not going to advise anything because this might take a while to fix all the potential side effects. 

There is only one way to recover :
  • Deactivating the analysis of your project
  • Deleting the SQ project having the new kee
  • Updating the kee of the old SQ project through the SonarQube UI
  • And reactivating the analysis of your project
From there is you start facing some side effects due to some direct updates you already did on the DB, I can't help you fixing them.

cheers
Freddy


For more options, visit https://groups.google.com/d/optout.

soma srikanth

unread,
Oct 7, 2016, 11:38:11 AM10/7/16
to Freddy Mallet, SonarQube
Gotcha, I'm on it how about i revert the changes in the db as well like earlirt i used sql replace (nl.foo,nl.bar) right ? now i do sql replace (nl.bar,nl.foo) ? does it going to make any difference ?

Freddy

To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages