{"id":758,"date":"2013-12-01T15:00:46","date_gmt":"2013-12-01T14:00:46","guid":{"rendered":"http:\/\/qualilogy.com\/en\/?p=758"},"modified":"2013-12-01T16:30:56","modified_gmt":"2013-12-01T15:30:56","slug":"sonarqube-upgrade-4-0","status":"publish","type":"post","link":"http:\/\/qualilogy.com\/en\/sonarqube-upgrade-4-0\/","title":{"rendered":"SonarQube Upgrade 4.0"},"content":{"rendered":"<p><a href=\"http:\/\/500px.com\/Vicken\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-1341\" alt=\"SonarUpgrade4.0\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarUpgrade4.0.jpg\" width=\"271\" height=\"350\" \/><\/a> The <a title=\"Sonar Upgrade\" href=\"http:\/\/qualilogy.com\/en\/sonarqube-upgrade2\/\" target=\"_blank\">last post about SonarQube<\/a> described an update of version. Unfortunately, I was a bit late between the time I did the upgrade and when I wrote the post, so that in the meantimes, a new version of SonarQube has been available.<\/p>\n<p>This is a version 4.0 (so, a major one), that I did install this weekend. And as I did some errors, this is an opportunity to update this post <a title=\"Sonar Upgrade\" href=\"http:\/\/qualilogy.com\/en\/sonarqube-upgrade2\/\" target=\"_blank\">SonarQube upgrade<\/a> and to document these error messages and how I solved them.<\/p>\n<p>I will not detail all the steps of upgrade as in the previous article, but simply specify the errors encountered. <!--more--><\/p>\n<h2>SonarQube 4.0<\/h2>\n<h3>Preliminary steps<\/h3>\n<p>These steps are:<\/p>\n<ul>\n<li>First, verify that SonarQube is not enabled. If this is the case, stop the Sonar service.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1345\" alt=\"SonarServiceStop\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarServiceStop.jpg\" width=\"459\" height=\"99\" \/><\/p>\n<ul>\n<li>Do a backup of your SonarQube current environment. We already have seen how to do a <a title=\"Backup Oracle\" href=\"http:\/\/qualilogy.com\/en\/sonarqube-upgrade-prerequisites\/\" target=\"_blank\">backup of your Oracle database<\/a>.<\/li>\n<li>Uninstall the existing Sonar service. We can delete it with the\u00a0 \u2018UninstallNTService.bat\u2019 that you can find in the folder corresponding to our operating system, in the directory \u2018..\\bin\u2019 of the current release of SonarQube.<\/li>\n<\/ul>\n<p>Note: I did try this uninstall with any other \u2018UninstallNTService.bat\u2019 file, from another version or from a 32 or 64 bits release and it works.<\/p>\n<p>I will then download the version 4.0 ofSonarQube, from this <a href=\"http:\/\/www.sonarqube.org\/downloads\/\" target=\"_blank\">page on SonarSource<\/a>.<\/p>\n<h3>SonarQube 4.0 installation<\/h3>\n<p>Then I proceed as usual:<\/p>\n<ol>\n<li>Unzip of the SonarQube 4.0 release in its own directory.<\/li>\n<li>Copy of the .jar files of the installed plugins (from the previous version) into the corresponding folder in the new version: \u2018..\\sonar-4.0\\extensions\\plugins\u2019.<\/li>\n<li>Copy of the Oracle database driver \u2018ojdbc6.jar\u2019 into the new folder \u2018..\\sonar-4,0\\extensions\\jdbc-driver\\oracle\u2019 (as I use an Oracle database).<\/li>\n<li>Copy of the files &#8216;sonar.properties\u2019 (with the environment parameters) and \u2018wrapper.conf\u2019 into the new directory \u2018..\\sonar-4.0\\conf\u2019. <strong>Beware: if you are following this post step by step, don&#8217;t do this one as it is erroneous (see hereunder).<\/strong>.<\/li>\n<li>Install the new Windows service Sonar in its 4.0 version, with the file \u2018InstallNTService.bat\u2019 that you will find under the directory \u2018sonar-4,0\\bin\\&#8217; and in the sub-directory corresponding to your OS.<\/li>\n<\/ol>\n<p>Once we have finished with these operations, we can start the Sonar Service &#8230; except that it returns the following error message:<br \/>\n<a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarStartError.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1348\" alt=\"SonarStartError\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarStartError.jpg\" width=\"447\" height=\"184\" \/><\/a><\/p>\n<p>And the file &#8216;sonar.log&#8217; displays this error: <strong>WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: Do not copy-paste the configuration files (conf directory) from the old version. Update the content of the new files instead.<\/strong><\/p>\n<p>As always, I did consult the Releases Notes page, but I did not take care to the <a href=\"http:\/\/docs.codehaus.org\/display\/SONAR\/Upgrading\" target=\"_blank\">upgrade page<\/a> that has been modified: it now explains that you must not copy anymore the configuration files, but update them instead. So the previous step 4 was not correct.<\/p>\n<p>In fact, I did not modify the file &#8216;wrapper.conf&#8217; but only the &#8216;sonar.properties&#8217; file with the indication of the Oracle database. Once our configuration is done, we can lauch the upgrade procedure from the \u2018setup\u2019 page &#8216;http:\/\/localhost:9000\/setup&#8217;.<\/p>\n<p>SonarQube must do an upgrade of the database:<\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarDBUpgrade.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1350\" alt=\"SonarDBUpgrade\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarDBUpgrade.jpg\" width=\"485\" height=\"168\" \/><\/a><\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarDBUpgrade2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-1351\" alt=\"SonarDBUpgrade2\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarDBUpgrade2.jpg\" width=\"352\" height=\"82\" \/><\/a>I click the &#8216;Upgrade&#8217; button to start this update. But it ends with the following error message which I believe that it is caused by of an old version of the &#8216;Sqale&#8217; plugin. <a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarDBSqaleError.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1352\" alt=\"SonarDBSqaleError\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarDBSqaleError.jpg\" width=\"568\" height=\"98\" \/><\/a><\/p>\n<h3>Update of the Sqale plugin<\/h3>\n<p>So, I will look to the page related to <a href=\"http:\/\/www.sonarsource.com\/products\/plugins\/governance\/sqale\/downloads\/\" target=\"_blank\">this plugin on the SonarSource website<\/a> :<\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SqaleDownload.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1357\" alt=\"SqaleDownload\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SqaleDownload.jpg\" width=\"698\" height=\"271\" \/><\/a><\/p>\n<p>We can find a new version of this plugin, that works specifically with the version 4.0 of SonarQube.<\/p>\n<p>So I will:<\/p>\n<ol>\n<li>Download this plugin into the directory \u2018..\\sonar-4.0\\extensions\\plugins\u2019.<\/li>\n<li>Stop \/ Start the new Windows service Sonar.<\/li>\n<li>Launch again the setup of SonarQube : &#8216;http:\/\/localhost:9000\/setup&#8217;<\/li>\n<\/ol>\n<p>Yes! The upgrade has been done correctly.<\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarDBUPdateOk.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1358\" alt=\"SonarDBUPdateOk\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarDBUPdateOk.jpg\" width=\"463\" height=\"98\" \/><\/a><\/p>\n<h3>Update of other plugins<\/h3>\n<p>The previous example showed us that sometimes it may be necessary to install a new version of a plugin before installing a new version of SonarQube. This is why it is recommended to do these updates through the Update Center, as we saw inl the post <a title=\"Sonar Upgrade\" href=\"http:\/\/qualilogy.com\/en\/sonarqube-upgrade2\/\" target=\"_blank\">SonarQube upgrade<\/a>,<\/p>\n<p>So I will follow the same procedure:<\/p>\n<ol>\n<li>Connect as a Sonar admin<\/li>\n<li>Go to the Update Center and activate the upgrade of the plugins that require an update:<\/li>\n<\/ol>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarUpdateCenter.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1359\" alt=\"SonarUpdateCenter\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarUpdateCenter.jpg\" width=\"438\" height=\"365\" \/><\/a><\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarPluginsUpdate2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-1361\" alt=\"SonarPluginsUpdate2\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/SonarPluginsUpdate2.jpg\" width=\"357\" height=\"251\" \/><\/a>SonarQube lists the plugins whose version will be updated.<\/p>\n<p>Note that the upgrade from Java 1.4 to Java 1.5 results in an update of different plugins (findbugs, pmd, etc).<\/p>\n<p>Once we have activated the upgrade of all the plugins that need to be upddated, we can Re-start the Windows service Sonar and get back to SonarQube.<\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/PluginUpdatesOk.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-1370\" alt=\"PluginUpdatesOk\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/11\/PluginUpdatesOk.jpg\" width=\"357\" height=\"93\" \/><\/a>If you connect again in the Update Center, you can see that your SonarQube installation is up-to-date with the release 4.0 and that all the plugins are now in their most recent version.<\/p>\n<p>Et voil\u00e0 ! We can now discover what is new in this 4.0 version and these new plugins. See you soon for a new post.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The last post about SonarQube described an update of version. Unfortunately, I was a bit late between the time I did the upgrade and when I wrote the post, so that in the meantimes, a new version of SonarQube has been available. This is a version 4.0 (so, a major one), that I did install [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-758","post","type-post","status-publish","format-standard","hentry","category-sonar-installation"],"_links":{"self":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/758"}],"collection":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/comments?post=758"}],"version-history":[{"count":10,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/758\/revisions"}],"predecessor-version":[{"id":761,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/758\/revisions\/761"}],"wp:attachment":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/media?parent=758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/categories?post=758"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/tags?post=758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}