NetXMS Support Forum

English Support => General Support => Topic started by: StanHubble on January 18, 2019, 12:30:14 AM

Title: Update from 2.2.11 to 2.2.12 - "nxdbmgr upgrade" fails
Post by: StanHubble on January 18, 2019, 12:30:14 AM
NetXMS Database Manager Version 2.2.12 Build 9516 (2.2.12) (UNICODE)

Upgrading database...
Upgrading from version 22.41 to 22.42
SQL query failed ([Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot define PRIMARY KEY constraint on nullable
column in table 'address_lists'.):
ALTER TABLE address_lists ADD CONSTRAINT pk_address_lists PRIMARY KEY (list_type,community_id,zone_uin,addr_type,addr1,addr2)
Rolling back last stage due to upgrade errors...
Database upgrade failed


I started from 2.2.10 and got this error on a direct upgrade to 2.2.12 so i reverted back to 2.2.10,
did a ".\nxdbmgr check" --> clean.
upgraded to 2.2.11
then another ".\nxdbmgr check" --> clean.
and tried another upgrade to 2.2.12 with the same error.

The first run through i let the windows installer update the schema but things ended up in the same conditions. subsequent tries I deselected the update schema option, but nxdbmgr upgrade fails with the same condition.

at this point i have reverted back to 2.2.10 , any ideas?

server -> win2012r2
dbserver -> win2012r2 with
Microsoft SQL Server Management Studio      12.0.5207.0
Microsoft Analysis Services Client Tools      12.0.5207.0
Microsoft Data Access Components (MDAC)      6.3.9600.17415
Microsoft MSXML                  3.0 6.0
Microsoft Internet Explorer               9.11.9600.19236
Microsoft .NET Framework               4.0.30319.42000
Operating System                  6.3.9600
Title: Re: Update from 2.2.11 to 2.2.12 - "nxdbmgr upgrade" fails
Post by: Victor Kirhenshtein on January 18, 2019, 12:57:43 PM
Please try to replace nxdbmgr.exe with attached one and run database upgrade again.

Best regards,
Victor
Title: Re: Update from 2.2.11 to 2.2.12 - "nxdbmgr upgrade" fails
Post by: StanHubble on January 18, 2019, 06:07:25 PM
Thanks alot Victor!!
it worked without a hitch.

PS C:\ProgramData\NetXMS\bin> .\nxdbmgr.exe upgrade
NetXMS Database Manager Version 2.2.12 Build 9516 (2.2.12-2-gf93e98c349) (UNICODE)

Upgrading database...
Upgrading from version 22.40 to 22.41
Upgrading from version 22.41 to 22.42
Database upgrade succeeded
PS C:\ProgramData\NetXMS\bin> .\nxdbmgr.exe check
NetXMS Database Manager Version 2.2.12 Build 9516 (2.2.12-2-gf93e98c349) (UNICODE)

Checking database (excluding collected data):
* Zone object properties                                               [PASSED]
* Node object properties                                               [PASSED]
* Node to subnet bindings                                              [PASSED]
* Interface object properties                                          [PASSED]
* Interface bindings                                                   [PASSED]
* Network service object properties                                    [PASSED]
* Network service bindings                                             [PASSED]
* Cluster object properties                                            [PASSED]
* Cluster member nodes                                                 [PASSED]
* Template to node mapping                                             [PASSED]
* Object properties                                                    [PASSED]
* Container membership                                                 [PASSED]
* Event processing policy                                              [PASSED]
* Network map links                                                    [PASSED]
* Data tables                                                          [PASSED]
* Raw DCI values table                                                 [PASSED]
* DCI thresholds                                                       [PASSED]
* Table DCI thresholds                                                 [PASSED]
Database doesn't contain any errors
Database check completed
Title: Re: Update from 2.2.11 to 2.2.12 - "nxdbmgr upgrade" fails
Post by: Junoonguy on May 13, 2019, 11:15:33 AM
Hello Alex / Victor,

Whenever i use upgrade command on, "Database is locked"

C:\NetXMS\bin>.\nxdbmgr.exe upgrade

Upgrading database...
Database is locked

Please help,
Thanks in advance
Title: Re: Update from 2.2.11 to 2.2.12 - "nxdbmgr upgrade" fails
Post by: Victor Kirhenshtein on May 13, 2019, 02:36:06 PM
Hi,

make sure that netxmsd is not running, then run

nxdbmgr unlock

to remove database lock.

Best regards,
Victor
Title: Re: Update from 2.2.11 to 2.2.12 - "nxdbmgr upgrade" fails
Post by: Junoonguy on May 16, 2019, 01:08:46 PM
Thanks Victor, its unlock now

Regards,
Junoonguy