Ad Widget

Collapse

Refactor template without loosing data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghoz
    Senior Member
    • May 2011
    • 204

    #1

    Refactor template without loosing data

    Hi, I just tried moving a few items from a template to another one, and i lost all my historical data ...

    Is there a recommended way to do that ?
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Unlink one template, but just unlink (no unlink and clear!) and then link your host to another template. Existing items will be reattached to the new template automatically.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • ghoz
      Senior Member
      • May 2011
      • 204

      #3
      Thank you...

      So in my case I have a "catch em all template" that i want to split in 2,
      I have to
      * unlink the template without clearing data
      * refactor the huge template in two templates
      * re link , and it should work, right ?

      I dont have a testbed as i'm already working on a prototype... beter be sure :-)

      for reference, what I did was
      * copy the items from the big template to the new template
      * remove the items from the template <= bad move
      * link to the new template <= nodata ... duh...

      anyway I only lost last day of data, I exercised my sql-fu a bit to partialy restore the data from yesterday's backup...

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        It should work. Note that these operations may take a while depending on the number of hosts linked to your templates. Please consider having a test environment some day.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • ghoz
          Senior Member
          • May 2011
          • 204

          #5
          sure will do ...
          but for now it's not yet in production, but it's already of great use...

          Comment

          Working...