NetXMS Support Forum

English Support => General Support => Topic started by: andriusg on January 05, 2017, 04:01:32 PM

Title: Upgrade to 2.0.8
Post by: andriusg on January 05, 2017, 04:01:32 PM
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 ?
Title: Re: Upgrade to 2.0.8
Post by: Alex Kirhenshtein on January 05, 2017, 04:37:41 PM
Please provide more information:

1) database type and version
2) run "nxdbmgr -t upgrade" and post failed queries
Title: Re: Upgrade to 2.0.8
Post by: andriusg on January 05, 2017, 04:45:36 PM
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
Title: Re: Upgrade to 2.0.8
Post by: Alex Kirhenshtein on January 05, 2017, 05:15:26 PM
I've created ticked for dev team: https://dev.raden.solutions/issues/1389
Title: Re: Upgrade to 2.0.8
Post by: Victor Kirhenshtein on January 05, 2017, 07:16:47 PM
Hi,

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

Best regards,
Victor
Title: Re: Upgrade to 2.0.8
Post by: andriusg on January 05, 2017, 07:37:01 PM
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
Title: Re: Upgrade to 2.0.8
Post by: Victor Kirhenshtein on January 05, 2017, 07:43:50 PM
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
Title: Re: Upgrade to 2.0.8
Post by: andriusg on January 06, 2017, 08:47:07 AM
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
Title: Re: Upgrade to 2.0.8
Post by: Victor Kirhenshtein on January 06, 2017, 09:47:21 AM
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
Title: Re: Upgrade to 2.0.8
Post by: andriusg on January 06, 2017, 10:02:46 AM
Thanks for help.
Database upgraded succeful.