{"id":715,"date":"2013-11-03T16:12:49","date_gmt":"2013-11-03T15:12:49","guid":{"rendered":"http:\/\/qualilogy.com\/en\/?p=715"},"modified":"2013-11-03T17:19:52","modified_gmt":"2013-11-03T16:19:52","slug":"sonarqube-upgrade-prerequisites","status":"publish","type":"post","link":"http:\/\/qualilogy.com\/en\/sonarqube-upgrade-prerequisites\/","title":{"rendered":"SonarQube upgrade &#8211; Prerequisites"},"content":{"rendered":"<p><a href=\"http:\/\/500px.com\/Vicken\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-1249\" alt=\"SonarUpgradeImg\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/10\/SonarUpgradeImg.jpg\" width=\"351\" height=\"351\" \/><\/a><\/p>\n<p>We have seen previously how to <a href=\"http:\/\/qualilogy.com\/en\/migrate-sonarqube-tomcat-to-windows-service\/\" target=\"_blank\">migrate SonarQube from Tomcat to a Windows service<\/a> and how to <a href=\"http:\/\/qualilogy.com\/en\/sonarqube-windows-jenkins-tomcat\/\" target=\"_blank\">use SonarQube as a Windows service with Jenkins under Tomcat<\/a>,<\/p>\n<p><span id=\"result_box\" lang=\"en\"><span class=\"hps\">I did use<\/span> <span class=\"hps\">the same<\/span> <span class=\"hps\">release 3.5.1<\/span> <span class=\"hps\">to perform this<\/span> <span class=\"hps\">migration from<\/span> <span class=\"hps\">Tomcat<\/span> <span class=\"hps\">to a<\/span> <span class=\"hps\">Windows service<\/span><span>, and as<\/span> <span class=\"hps\">it is<\/span> <span class=\"hps\">already<\/span> <span class=\"hps\">old<\/span><span>, this will be<\/span> <span class=\"hps\">an opportunity to make<\/span> <span class=\"hps\">an upgrade<\/span> <span class=\"hps\">of Sonarqube and<\/span> <span class=\"hps\">update our<\/span> <span class=\"hps\">environment<\/span> <span class=\"hps\">with<\/span> <span class=\"hps\">new versions of\u00a0<\/span><span class=\"hps\">plugins.<\/span><br \/>\n<\/span><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span class=\"hps\">I will document this operation in<\/span> <span class=\"hps\">two articles<\/span><span>, including<\/span> <span class=\"hps\">this first<\/span> one <span class=\"hps\">to present<\/span> <span class=\"hps\">the steps<\/span> to prepare <span class=\"hps\">our<\/span> <span class=\"hps\">upgrade.<\/span> <span class=\"hps\">This will also be<\/span> <span class=\"hps\">the opportunity to see<\/span> how to do <span class=\"hps\">an Oracle<\/span> <span class=\"hps\">backup<\/span><span>.<\/span><\/span><!--more--><\/p>\n<h1>Task list<\/h1>\n<p><span id=\"result_box\" lang=\"en\"><span title=\"Dans un premier temps, je vais d'abord planifier les diff\u00e9rentes actions \u00e0 r\u00e9aliser.\">At first, I will start planning the different actions to perform. <\/span><span title=\"Non pas que cette op\u00e9ration soit compliqu\u00e9e, mais c'est l'occasion d'effectuer un \u00e9tat des lieux de notre environnement, et en particulier des \u00e9volutions au niveau des plugins.\">Not that this operation is complicated , but it is an opportunity to make an inventory of our environment, and especially the plugins evolutions. <\/span><span title=\"Un upgrade ne consiste pas uniquement \u00e0 installer une nouvelle version de SonarQube mais \u00e9galement \u00e0 mettre \u00e0 jour nos plugins.\">An upgrade is not just an installation of a new version of SonarQube but also an update of our plugins. <\/span><span title=\"Et j'aime bien savoir quelles sont les \u00e9volutions disponibles, s'il existe de nouvelles r\u00e8gles \u00e0 tester, une nouvelle fonctionnalit\u00e9 \u00e0 mettre en oeuvre, etc.\">And I like to know what changes are available, if there are new rules to test, a new feature to implement, etc.<br \/>\n<\/span><\/span><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span title=\"Enfin, lister les plugins \u00e0 upgrader permet de garder une certaine tra\u00e7abilit\u00e9 de notre environnement, et je vous conseille de faire de m\u00eame, notamment si vous utilisez SonarQube dans un cadre professionnel.\">Also, to list the plugins to upgrade allows us to keep some trace of the evolutions of your environment, and I suggest you do the same, especially if you use SonarQube in a professional way, in your company. <\/span><span title=\"Une nouvelle r\u00e8gle ou la modification d'une r\u00e8gle existante dans vos analyses de code peut amener une hausse subite de d\u00e9fauts dans le tableau de bord SonarQube, sans que les d\u00e9veloppeurs comprennent la cause de cette d\u00e9gradation soudaine de la qualit\u00e9 de leur application.\">A new rule or the modification of an existing rule in your code analysis can trigger a surge of defects in the SonarQube dashboard, and your developers might not understand the cause of this sudden deterioration in the quality of their application.<\/span><\/span><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span title=\"La premi\u00e8re r\u00e9action est alors de mettre en doute la validit\u00e9 de vos analyses, et dans ce cas, mieux vaut \u00eatre pr\u00eat \u00e0 r\u00e9pondre qu'une nouvelle version de plugin a introduit une nouvelle r\u00e8gle \u00e0 l'origine de ces nouveaux d\u00e9fauts.\">Their first reaction could be to question the validity of your analysis, and in this case, you better be ready to explain which new version of a plugin has introduced which new rule at the origin of these new defects. Always good to k<\/span><span title=\"Garder un document avec les modifications apport\u00e9es \u00e0 votre environnement d'analyse permet de justifier ces \u00e9volutions.\">eep a document to trace the changes in your environment.<\/span><\/span><\/p>\n<h2>Update Center<\/h2>\n<p>I keep all the mails from the SonarQube mailing list, that announce new release of the software or of a plugin, mais there is a simpler way to know which of the plugins you have installed are up-to-date or not: the Update Center.<\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/10\/SonarQubeLogin.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-1265\" alt=\"SonarQube Login\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/10\/SonarQubeLogin.jpg\" width=\"277\" height=\"210\" \/><\/a>First, we will connect into SonarQube as an Admin, from the SonarQube dashboard.<\/p>\n<p>Then, we go in the Update Center page from the menu:<\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/10\/SonarQubeLogin2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-1266\" alt=\"SonarQubeLogin2\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/10\/SonarQubeLogin2.jpg\" width=\"190\" height=\"138\" \/><\/a><\/p>\n<p>&#8216;Settings&#8217; and then the sub-menu &#8216;Configuration&#8217;.<\/p>\n<p>From this configuration page, we choose the menu &#8216;Update Center&#8217; in order to display the corresponding screen, with different tabs that show us:<\/p>\n<ul>\n<li>The installed plugins.<\/li>\n<li>The plugins not installed but available.<\/li>\n<li>The plugins for which a new version is available.<\/li>\n<li>Any new version of SonarQube.<\/li>\n<\/ul>\n<p>And furthermore, the list of actions to realize the upgrade of SonarQube, in the tab &#8216;System Updates&#8217; :<\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/10\/SonarQubeUpgrade1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1269\" alt=\"SonarQubeUpgrade1\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/10\/SonarQubeUpgrade1.jpg\" width=\"696\" height=\"484\" \/><\/a><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span class=\"hps\">The update<\/span> <span class=\"hps\">of my environment<\/span> <span class=\"hps\">Sonar<\/span> <span class=\"hps\">will therefore<\/span> <span class=\"hps\">be:<\/span><br \/>\n<span class=\"hps\">1<\/span><span>.<\/span> <span class=\"hps\">Remove<\/span> <span class=\"hps\">obsolete<\/span> <span class=\"hps\">plugins<\/span><span>.<\/span><br \/>\n<span class=\"hps\">2<\/span><span>.<\/span> <span class=\"hps\">Upgrade<\/span> <span class=\"hps\">version<\/span> <span class=\"hps\">of<\/span> <span class=\"hps\">existing<\/span> <span class=\"hps\">plugins.<\/span><br \/>\n<span class=\"hps\">3<\/span><span>.<\/span> <span class=\"hps\">Upgrade<\/span> <span class=\"hps\">version<\/span> <span class=\"hps\">SonarQube<\/span><span>.<\/span><br \/>\n<span class=\"hps\">4<\/span><span>.<\/span> <span class=\"hps\">Upgrade<\/span> <span class=\"hps\">(post<\/span><span>-upgrade<\/span> <span class=\"hps\">SonarQube<\/span><span>)<\/span> <span class=\"hps\">existing<\/span> <span class=\"hps\">plugins<\/span> <span class=\"hps\">or<\/span> <span class=\"hps\">add new<\/span> <span class=\"hps\">plugins.<\/span><\/span><\/p>\n<p><span class=\"hps\">I will also recommand that you<\/span> <span class=\"hps\">check <\/span><a title=\"Proc\u00e9dure d'upgrade SonarQube\" href=\"http:\/\/docs.codehaus.org\/display\/SONAR\/Upgrading\" target=\"_blank\">the upgrade procedure<\/a> on the SonarSource website and to consult the Release Notes (at the bottom of the same page).<\/p>\n<p><span id=\"result_box\" lang=\"en\"><span class=\"hps\">And as<\/span> <span class=\"hps\">recommanded<\/span><span>,<\/span> we will first <span class=\"hps\">do a backup<\/span> <span class=\"hps\">of<\/span> <span class=\"hps\">our current environment<\/span><span>,<\/span> <span class=\"hps\">and especially <\/span>of <span class=\"hps\">our Sonar user in the<\/span> <span class=\"hps\">Oracle database<\/span><span>.<\/span><\/span><\/p>\n<h2>Oracle backup<\/h2>\n<p><span id=\"result_box\" lang=\"en\"><span title=\"Un backup Oracle se fait tout simplement depuis une fen\u00e8tre DOS, avec une commande d'EXPort des donn\u00e9es de la base.\">You can do an Oracle backup from a simple DOS window with a command to EXPort the data from the database. <\/span><span title=\"Un restore d'un sch\u00e9ma (ou de la base enti\u00e8re) s'effectuera avec une commande d'IMPort.\">To restore a schema (or the entire database) will be realized with the IMPort command.<br \/>\n<\/span><\/span><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span title=\"Attention cependant : ces commandes ont chang\u00e9 avec la version 10g d'Oracle.\">But beware: these commands have changed with the Oracle 10g release. <\/span><span title=\"Il est encore possible d'utiliser les anciennes commandes EXP \/ IMP pour effectuer un backup \/ restore, mais il faut savoir que cette commande EXP ne gardera que les donn\u00e9es ...\">It is still possible to use these old EXP \/ IMP clauses to perform backup \/ restore, but be aware that this does not keep the data from &#8230; <\/span><span title=\"des tables avec des donn\u00e9es.\">tables without data. <\/span><span title=\"En d'autres termes, seules les tables contenant des enregistrements seront sauvegard\u00e9es.\">In other words, only tables containing records will be saved. <\/span><span title=\"Et si vous restaurez un sch\u00e9ma Sonar depuis un dump efffectu\u00e9 avec la commande EXP, SonarQube rencontrera une erreur puisque certaines tables (vides) seront ainsi manquantes.\">And if you restore a Sonar schema from a dump realized with the EXP command, SonarQube will show an error, since some empty tables will probably be missing.<br \/>\n<\/span><\/span><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span title=\"Les commandes \u00e0 utiliser afin d'\u00e9viter ce probl\u00e8me sont EXPDP et IMPDP.\">The commands to use to avoid this problem are EXPDP and IMPDP. <\/span><span title=\"DP pour Data Pump (oui je sais, moi aussi le nom me fait sourire).\">DP means Data Pump (yes I know, this funny name makes me always laugh). <\/span><span title=\"Attention \u00e0 nouveau : les dumps g\u00e9n\u00e9r\u00e9s ne sont plus au m\u00eame format.\">Beware again: dumps are not generated in the same format, so<\/span><span title=\"En d'autres termes, vous ne pouvez pas restaurer avec la commande IMPDP un dump cr\u00e9\u00e9 avec la commande EXP.\"> you can not restore with the IMPDP command a dump created with the EXP command.<br \/>\n<\/span><\/span><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span title=\"Derni\u00e8re chose : la syntaxe de ces commandes reste assez proche, sauf pour l'emplacement du fichier de dump.\">Last thing: the syntax of these commands is quite similar, except for the location of the dump file . <\/span><span title=\"Comme nous pouvons le voir dans l'illustration suivante, nous allons indiquer en param\u00e8tres de la commande EXPDP :\">As we can see in the following illustration, we will indicate the following parameters:<\/span><\/span><\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/10\/OracleEXPDP2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1272\" alt=\"OracleEXPDP2\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/10\/OracleEXPDP2.jpg\" width=\"685\" height=\"289\" \/><\/a><\/p>\n<ul>\n<li>The name of Oracle user corresponding to the Sonar schema Sonar, with its password, and the indication of the dabase, with the syntax <em>schema\/password@dbname<\/em>, <strong>sonar\/sonar@JPORA11<\/strong> in my case.<\/li>\n<li>The name of the dump file, result of the backup.<\/li>\n<li>The name of the log file, to verify that the backup is correct.<\/li>\n<\/ul>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/10\/OracleEXPDP3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1274\" alt=\"OracleEXPDP3\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/10\/OracleEXPDP3.jpg\" width=\"684\" height=\"193\" \/><\/a><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span class=\"hps\">The log<\/span> <span class=\"hps\">will also give you<\/span> <span class=\"hps\">a list of the &#8216;<\/span><span class=\"hps\">exported<\/span><span class=\"hps atn\">&#8216; tables<\/span><span>, which<\/span> <span class=\"hps\">will allow you to<\/span> <span class=\"hps\">verify that the tables<\/span> <span class=\"hps\">with<\/span> <span class=\"hps\">&#8216;0 records<\/span><span>&#8216;<\/span> <span class=\"hps\">are present<\/span> <span class=\"hps\">in the<\/span> <span class=\"hps\">backup<\/span><span>.<\/span><br \/>\n<\/span><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span class=\"hps\">Now<\/span><span>,<\/span> <span class=\"hps\">and<\/span> <span class=\"hps\">unlike the old<\/span> <span class=\"hps\">EXP<\/span> <span class=\"hps\">command<\/span><span>, the dump<\/span> <span class=\"hps\">is not<\/span> <span class=\"hps\">in<\/span> <span class=\"hps\">the directory from which<\/span> <span class=\"hps\">we started the<\/span> <span class=\"hps\">export,<\/span> <span class=\"hps\">but<\/span> located <span class=\"hps\">by default in a<\/span> <span class=\"hps atn\">directory &#8216;<\/span><span>DPDUMP<\/span><span>&#8216;<\/span> <span class=\"hps\">under the installation<\/span> <span class=\"hps\">directory<\/span> <span class=\"hps\">of<\/span> <span class=\"hps\">our database<\/span> <span class=\"hps\">under<\/span> <span class=\"hps\">the installation directory<\/span> <span class=\"hps\">of<\/span> <span class=\"hps\">Oracle.<\/span> <span class=\"hps\">I<\/span> <span class=\"hps\">would have preferred to<\/span> <span class=\"hps\">decide where to<\/span> <span class=\"hps\">save\u00a0<\/span> <span class=\"hps\">the<\/span> <span class=\"hps\">backup<\/span> <span class=\"hps\">but hey,<\/span> <span class=\"hps\">once we<\/span> <span class=\"hps\">know<\/span> <span class=\"hps\">where to get<\/span> <span class=\"hps\">it &#8230;<\/span> <span class=\"hps\">It is possible to<\/span> <span class=\"hps\">set a different<\/span> <span class=\"hps\">default directory,<\/span> <span class=\"hps\">but<\/span> <span class=\"hps\">you need to write<\/span> <span class=\"hps\">a<\/span> <span class=\"hps\">SQL<\/span> <span class=\"hps\">script to change<\/span> <span class=\"hps\">this setting,<\/span> <span class=\"hps\">or<\/span> <span class=\"hps\">manually enter<\/span> <span class=\"hps\">the corresponding<\/span> <span class=\"hps\">SQL commands.<\/span> <span class=\"hps\">A little complicated.<\/span><br \/>\n<\/span><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span class=\"hps\">Good.<\/span> <span class=\"hps\">We&#8217;re done<\/span> <span class=\"hps\">with<\/span> <span class=\"hps\">the<\/span> <span class=\"hps\">actions<\/span> prior <span class=\"hps\">to<\/span> the <span class=\"hps\">SonarQube upgrade<\/span><span>.<\/span> This w<span class=\"hps\">e will see in<\/span> <span class=\"hps\">our next post<\/span><span>.<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have seen previously how to migrate SonarQube from Tomcat to a Windows service and how to use SonarQube as a Windows service with Jenkins under Tomcat, I did use the same release 3.5.1 to perform this migration from Tomcat to a Windows service, and as it is already old, this will be an opportunity [&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-715","post","type-post","status-publish","format-standard","hentry","category-sonar-installation"],"_links":{"self":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/715"}],"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=715"}],"version-history":[{"count":10,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/715\/revisions"}],"predecessor-version":[{"id":717,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/715\/revisions\/717"}],"wp:attachment":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/media?parent=715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/categories?post=715"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/tags?post=715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}