Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-7108

Unsuccessful database migration for Proxies

XMLWordPrintable

      According to https://www.zabbix.com/documentation/2.0/manual/installation/upgrade_notes#upgrade_notes_for_proxies we tried to perform a upgrade of our zabbix proxies.
      (Upgraded procedure for server runs for two hours and we do not want to lose the data collected while upgraded in the schema of the main server)

      While performing a upgrade at the proxy we get this:

      --------------
      SET @graphthemeid = (SELECT MAX(graphthemeid) FROM graph_theme)
      --------------
      
      --------------
      INSERT INTO graph_theme (graphthemeid, description, theme, backgroundcolor, graphcolor, graphbordercolor, gridcolor, maingridcolor, gridbordercolor, textcolor, highlightcolor, leftpercentilecolor, rightpercentilecolor, nonworktimecolor, gridview, legendview)
      VALUES
      (@graphthemeid + 1, 'Dark orange', 'darkorange', '333333', '0A0A0A', '888888', '222222', '4F4F4F', 'EFEFEF', 'DFDFDF', 'FF5500', 'FF5500', 'FF1111', '1F1F1F', 1, 1),
      (@graphthemeid + 2, 'Classic', 'classic', 'F0F0F0', 'FFFFFF', '333333', 'CCCCCC', 'AAAAAA', '000000', '222222', 'AA4444', '11CC11', 'CC1111', 'E0E0E0', 1, 1)
      --------------
      
      ERROR 1062 (23000) at line 223: Duplicate entry '0' for key 'PRIMARY'
      

      After adding the following hack to the database the upgrade is sucessful:

      # diff -u patch.sql patch-fixed.sql
      --- patch.sql	2013-10-07 12:40:18.340144674 +0200
      +++ patch-fixed.sql	2013-10-07 12:40:08.292000626 +0200
      @@ -220,6 +220,7 @@
       
       -- Insert new graph theme
       SET @graphthemeid = (SELECT MAX(graphthemeid) FROM graph_theme);
      +SET @graphthemeid =(SELECT IFNULL(@graphthemeid,0));
       INSERT INTO graph_theme (graphthemeid, description, theme, backgroundcolor, graphcolor, graphbordercolor, gridcolor, maingridcolor, gridbordercolor, textcolor, highlightcolor, leftpercentilecolor, rightpercentilecolor, nonworktimecolor, gridview, legendview)
       VALUES
       (@graphthemeid + 1, 'Dark orange', 'darkorange', '333333', '0A0A0A', '888888', '222222', '4F4F4F', 'EFEFEF', 'DFDFDF', 'FF5500', 'FF5500', 'FF1111', '1F1F1F', 1, 1),
      

            Unassigned Unassigned
            scoopex Marc Schoechlin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: