Upgrade to 2.0.8

Started by andriusg, January 05, 2017, 04:01:32 PM

Previous topic - Next topic

andriusg

Hello,
later i have netxms 1.2.17x64 netxms server and today maked upgrade to 2.0.8. On 1.2.17 everything worked.
Atfer upgrade i try to upgrade database and get this error . in logs i see, what driver works fine.

C:\NetXMS\bin>nxdbmgr upgrade
NetXMS Database Manager Version 2.0.8 Build 8078 (2.0.8-RELEASE) (UNICODE)

Upgrading database...
Upgrading from version 345 to 346
Rolling back last stage due to upgrade errors...
Database upgrade failed

How to solve this problem ?

Alex Kirhenshtein

Please provide more information:

1) database type and version
2) run "nxdbmgr -t upgrade" and post failed queries

andriusg

1. database type MSSQL server, version 9.00.5069.00.
2. C:\NetXMS\bin>nxdbmgr -t upgrade
NetXMS Database Manager Version 2.0.8 Build 8078 (2.0.8-RELEASE) (UNICODE)

Upgrading database...
Upgrading from version 345 to 346
>>> SELECT name FROM sysobjects WHERE xtype='PK' AND parent_obj=OBJECT_ID('clust
er_sync_subnets')
Rolling back last stage due to upgrade errors...
Database upgrade failed

Alex Kirhenshtein


Victor Kirhenshtein

Hi,

could you please run this query manually (for example in SQL Server Management Studio) and post detailed error message?

Best regards,
Victor

andriusg

manual query result is in attachment.
in server i logged as domain administrator . here is my netxms server configuration file
# NetXMS Server configuration file
# Created by NetXMS Server configuration wizard at Thu Jan 05 15:36:26 2017
#

LogFile = C:\NetXMS\New Text Document.txt
DBDriver = mssql.ddr
DBServer = HPDL580
DBName = NetXMSn
DBLogin = *
LogFailedSQLQueries = yes

Victor Kirhenshtein

Please check that cluster_sync_subnets table has primary key. If not, try to create primary key (using columns cluster_id and subnet_addr) and re-run DB migration.

Best regards,
Victor

andriusg

In cluster_sync_subnets table columns cluster_id and subnet_addr doesnt have primary key. I set this items primary key.

I try run nxdbmgr -t upgrade. Here is output
C:\NetXMS\bin>nxdbmgr -t upgrade
NetXMS Database Manager Version 2.0.8 Build 8078 (2.0.8-RELEASE) (UNICODE)

Upgrading database...
Upgrading from version 345 to 346
>>> SELECT name FROM sysobjects WHERE xtype='PK' AND parent_obj=OBJECT_ID('clust
er_sync_subnets')
>>> ALTER TABLE cluster_sync_subnets DROP CONSTRAINT PK_cluster_sync_subnets
>>> SELECT name FROM sysobjects WHERE xtype='PK' AND parent_obj=OBJECT_ID('addre
ss_lists')
Rolling back last stage due to upgrade errors...
Database upgrade failed

Victor Kirhenshtein

It seems there is same problem with address_lists table. Try to set PK using columns list_type,community_id,addr_type,addr1,addr2. Also check vpn_connector_networks table - if it doesn't have PK, set it on columns vpn_id,ip_addr.

Best regards,
Victor

andriusg

Thanks for help.
Database upgraded succeful.