There was some item changes in my production Zabbix that ended up with a few duplicated items.
I have the old item which has history and trends up to 2021-01-04 when it was disabled.
The new item has data since 2020-12-29 and is enabled.
I wish to maintain only the new item and merge the history and trends from the old item to the new item.
Checking the WEBUI, I was able to find the ItemID from both items.
Old itemid = 107252
New itemid = 136235
So, I thought of copying old items history and trends to the new item but I'm not really sure how to do it safely. And... I'm not very confident with databases.
I saw this MySQL Update suggesting something like this:
But it is kind of old.
Since the old item data overlaps with the new item, is that an issue?
Should I disable the new item before updating it?
Updating only "history" and "trends" table is enough?
I have the old item which has history and trends up to 2021-01-04 when it was disabled.
The new item has data since 2020-12-29 and is enabled.
I wish to maintain only the new item and merge the history and trends from the old item to the new item.
Checking the WEBUI, I was able to find the ItemID from both items.
Old itemid = 107252
New itemid = 136235
So, I thought of copying old items history and trends to the new item but I'm not really sure how to do it safely. And... I'm not very confident with databases.

I saw this MySQL Update suggesting something like this:
Code:
UPDATE history SET itemid = <itemid new_host> WHERE itemid = <itemid old_host>; UPDATE trends SET itemid = <itemid new_host> WHERE itemid = <itemid old_host>;
Since the old item data overlaps with the new item, is that an issue?
Should I disable the new item before updating it?
Updating only "history" and "trends" table is enough?
Comment