[ZBXNEXT-1470] Cannot import zabbix 2.0.* images into DB with other images Created: 2012 Oct 15  Updated: 2012 Dec 19  Resolved: 2012 Oct 15

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Frontend (F), Installation (I)
Affects Version/s: 2.0.2, 2.0.3
Fix Version/s: None

Type: Change Request Priority: Minor
Reporter: sergio cricca Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: images, import
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mysql, but suspect other SQL server too
frontend


Attachments: File images_fixed.sql     File images_table_create.sql    
Issue Links:
Duplicate

 Description   

If I have a Zabbix environment with old/custom images uploaded already, I cannot import images.sql because it tries to overwrite old imageid

I fixed this, by setting imageid column with AUTO_INCREMENT as follows (image_table_create.sql):

mysql> describe images;
----------------------------------------------------------+

Field Type Null Key Default Extra

----------------------------------------------------------+

imageid bigint(20) unsigned NO PRI NULL auto_increment
imagetype int(11) NO MUL 0  
name varchar(64) NO   0  
image longblob NO   NULL  

----------------------------------------------------------+
4 rows in set (0.00 sec)

mysql>

and images.sql should have not imageid definitions, like this line (images_fixed.sql):

INSERT INTO `images` (`imagetype`,`name`,`image`) VALUES (1,'Cloud_(128)',0x89504E470D0A1A [..........]);



 Comments   
Comment by richlv [ 2012 Oct 15 ]

inserting another sql is not supported. also, your procedure most likely broken manual image upload.

if you want to insert new images, generate and xml file and import it

Generated at Tue Apr 23 14:11:13 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.