NetXMS Support Forum

English Support => General Support => Topic started by: Egert143 on July 20, 2020, 09:49:40 AM

Title: Migrating fails
Post by: Egert143 on July 20, 2020, 09:49:40 AM
Hello

Any tips how to solve following error message, i get it when trying to migrate from MSSQL to Postgresql?

Migrating table snmp_ports
SQL query failed (23505 ERROR:  duplicate key value violates unique constraint "
snmp_ports_pkey"
DETAIL:  Key (id)=(1) already exists.):
INSERT INTO snmp_ports (id,port,zone) VALUES (?,?,?)
Failed input record:
   id = "1"
   port = "161"
   zone = "0"
Database migration failed.
Title: Re: Migrating fails
Post by: Victor Kirhenshtein on July 22, 2020, 12:34:36 PM
Hi,

looks like wrong primary key was set during PostgreSQL DB init. What NetXMS version you are using?

Best regards,
Victor
Title: Re: Migrating fails
Post by: Egert143 on July 22, 2020, 01:28:55 PM
Hello

Version is latest. I got it fixed by removing records from snmp_ports tabel. There were two records, both with id 1. After migration completed i re added settings with netxms.

Egert
Title: Re: Migrating fails
Post by: Victor Kirhenshtein on July 29, 2020, 02:36:32 PM
It was caused by a bug in DB init script (wrong primary key). We have fixed it, fix will be included into next patch release.

Best regards,
Victor