Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Upgrade to 6.0.0 - Database upgrade fails

Upgrade to 6.0.0 - Database upgrade fails

Scheduled Pinned Locked Moved Support
30 Posts 8 Posters 72.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    D
    dreamscape
    wrote on last edited by
    #4

    Hi Victor,

    Talked to you yesterday on Telegram and you directed me to this post, I've try this now but it failing to upgrade, see attached, any ideas please?

    Thanks.

    C:\NetXMS\bin>nxdbmgr check
    NetXMS Database Manager Version 6.0.0 Build 6.0-444-gb145606172

    Checking database (excluding collected data):
    Your database has format version 60.7, this tool is compiled for version 60.30.
    Use "upgrade" command to upgrade your database first.
    Database check aborted

    C:\NetXMS\bin>nxdbmgr upgrade
    NetXMS Database Manager Version 6.0.0 Build 6.0-444-gb145606172

    Upgrading database...
    Upgrading from version 60.7 to 60.8
    Converting table idata_100
    SQL query failed ([Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Cannot define PRIMARY KEY constraint on nullable column in table 'idata_100'.):
    ALTER TABLE idata_100 ADD CONSTRAINT pk_idata_100 PRIMARY KEY (item_id,idata_timestamp)
    Converting table tdata_100
    SQL query failed ([Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Cannot define PRIMARY KEY constraint on nullable column in table 'tdata_100'.):
    ....
    .....
    ALTER TABLE tdata_446 ADD CONSTRAINT pk_tdata_446 PRIMARY KEY (item_id,tdata_timestamp)
    Converting table idata_450
    SQL query failed ([Microsoft][ODBC Driver 18 for SQL Server][SQL Server]The transaction log for database 'NETXMS' is full due to 'ACTIVE_TRANSACTION' and the holdup lsn is (106450:128624:1).):
    UPDATE idata_450 SET idata_timestamp = idata_timestamp * 1000
    Rolling back last stage due to upgrade errors...
    Database upgrade failed

    C:\NetXMS\bin>


    Netxms upgrade.txt

    1 Reply Last reply
    0
    • C
      C
      ChrisSR
      wrote on last edited by
      #5

      Unfortunately I hit the same yesterday as Dreamscape. I tried marking the transaction log as unlimited size growth, but then I ran out of disk space (I have over 100GB free). I copied all the lines I saw and filtered out just the SQL commands and ran them manually, and on "UPDATE idata_1088 SET idata_timestamp = idata_timestamp * 1000" I get an error of "Arithmetic overflow error converting expression to data type int."

      Ignoring that last error, running the upgrade command again gives me:

      PS C:\netxms\bin> .\nxdbmgr.exe upgrade
      NetXMS Database Manager Version 6.0.0 Build 6.0-444-gb145606172

      INFO: Server module WEBAPI skipped
      Upgrading database...
      Upgrading from version 60.7 to 60.8
      SQL query failed ([Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The object 'PK__idata__410D428BF41FA2F0' is dependent on column 'idata_timestamp'.):
      ALTER TABLE idata ALTER COLUMN idata_timestamp bigint
      Rolling back last stage due to upgrade errors...
      Database upgrade failed

      1 Reply Last reply
      0
      • V
        V
        Victor Kirhenshtein
        wrote on last edited by
        #6

        I'm looking into it. We expect to have patch release 6.0.1 with improved DB upgrade on Monday.

        1 Reply Last reply
        0
        • S
          S
          SmEed
          wrote on last edited by
          #7

          Hello Victor.

          Unfortunately, the same problem here.

          Best Regards!
          Leo

          1 Reply Last reply
          0
          • T
            T
            twparker
            wrote on last edited by
            #8

            Hello,

            I am running into a similar issue on a Ubuntu installation where the database has taken multiple days to upgrade showing that it is converting idata and tdata tables, but never completing.

            Thanks in advance!

            1 Reply Last reply
            0
            • V
              V
              Victor Kirhenshtein
              wrote on last edited by
              #9

              Just published version 6.0.1 that should address database upgrade issue. Now it does not convert data immediately, but do this in background while server is running, in chunks by 24 hors, so you should gradually get your collected data back, starting from most recent.

              1 Reply Last reply
              0
              • S
                S
                SmEed
                wrote on last edited by
                #10

                It looks good. Thanks a lot and best regards from KTM. 😉

                1 Reply Last reply
                0
                • D
                  D
                  dreamscape
                  wrote on last edited by
                  #11

                  Thanks for the update, I'm still having issues with my one though.....

                  I restored the db back to the version 5.2.8 before i updated to 6.0.0

                  I've then run the new version 6.0.1 but the core service will not start, log file says:

                  2026.02.10 08:47:19.444 *E* [db] Your database has format version 52.23, but server is compiled for version 60.32

                  If i then try 'nxdbmgr check' i get:

                  C:\NetXMS\bin>nxdbmgr check
                  NetXMS Database Manager Version 6.0.1 Build 6.0-469-g5e68d5db1d

                  Error loading configuration file

                  Any ideas please?

                  1 Reply Last reply
                  0
                  • F
                    F
                    Filipp Sudanov
                    wrote on last edited by
                    #12

                    @dreamscape said in Upgrade to 6.0.0 - Database upgrade fails:

                    C:\NetXMS\bin>nxdbmgr check
                    NetXMS Database Manager Version 6.0.1 Build 6.0-469-g5e68d5db1d

                    Error loading configuration file

                    Make sure you run this in cmd session started with administrator rights - looks like there's access right issue to the server config file.

                    Message Your database has format version 52.23, but server is compiled for version 60.32 means that nxdbmgr upgraded did not happen (first part of format version is basically netxms version, so 52.23 means that database format is for 5.2.x).

                    nxdbmgr check will tell that db version is old, so try running nxdbmgr upgrade

                    1 Reply Last reply
                    0
                    • D
                      D
                      dreamscape
                      wrote on last edited by
                      #13

                      Thanks for the quick reply, yes, school boy error, it was admin cmd access.

                      currently sat at:

                      2026.02.10 11:35:45.590 *I* [dc.v5migrate      ] Migrating recent data from v5 tables (106 idata, 3 tdata)

                      1 Reply Last reply
                      0
                      • F
                        F
                        Filipp Sudanov
                        wrote on last edited by
                        #14

                        yes, that's background migration, server reads collected data both from non-migrated and migrated tables, so everything should work even during migration.
                        Would be interesting to know how long it takes on your system and how big it is (sh st output - number of nodes, dci count, size of the DB)

                        1 Reply Last reply
                        0
                        • D
                          D
                          dreamscape
                          wrote on last edited by
                          #15

                          Finished in about 15 minutes, db is around 8GB, not sure how many nodes

                          2026.02.10 11:35:45.590 *I* [dc.v5migrate      ] Migrating recent data from v5 tables (106 idata, 3 tdata)
                          2026.02.10 11:50:21.154 *I* [dc.v5migrate      ] Recent v5 data migration completed (109 tables migrated)

                          1 Reply Last reply
                          0
                          • T
                            T
                            twparker
                            wrote on last edited by
                            #16

                            I can see that the database upgrade is happening in the background, but the netxms-server service won't start.

                            "Your database has format version 60.7, but server is compiled for version 60.32"

                            1 Reply Last reply
                            0
                            • F
                              F
                              Filipp Sudanov
                              wrote on last edited by
                              #17

                              @twparker said in Upgrade to 6.0.0 - Database upgrade fails:

                              I can see that the database upgrade is happening in the background, but the netxms-server service won't start.
                              "Your database has format version 60.7, but server is compiled for version 60.32"

                              Are you still in upgrade to 6.0.0, or you've restarted upgrade to 6.0.1?

                              ...happening in the background - is it nxdbmgr background-upgrade running? If so, you need for it to finish and then run nxdbmgr upgrade again - it will upgrade schema further. This step could be a background one in 5.2, but when upgrading to 6.0 we need it to complete prior to subsequent db upgrade steps.

                              1 Reply Last reply
                              0
                              • T
                                T
                                twparker
                                wrote on last edited by
                                #18

                                I saw the database upgrade start when I used apt get upgrade. I thought that the server could then be started while that was running, but I suppose not.

                                1 Reply Last reply
                                0
                                • D
                                  D
                                  dlauwers
                                  wrote on last edited by
                                  #19

                                  Hi,

                                  Did all the updates/upgrades to be on 6.01, rebooted, bus till

                                  NetXMS Database Manager Version 6.0.1 Build 6.0-469-g5e68d5db1d

                                  Upgrading database...
                                  Upgrading from version 60.7 to 60.8
                                  SQL query failed (25P02 ERROR:  current transaction is aborted, commands ignored until end of transaction block):
                                  CREATE TABLE tdata_16066 (item_id integer not null,tdata_timestamp bigint not null,tdata_value text null, PRIMARY KEY(item_id,tdata_timestamp))
                                  Rolling back last stage due to upgrade errors...
                                  Database upgrade failed

                                  On Debian 13
                                  PostgreSQL 17.7

                                  Any fixes or workarrounds ?

                                  Thanks

                                  1 Reply Last reply
                                  0
                                  • T
                                    T
                                    twparker
                                    wrote on last edited by
                                    #20

                                    I am receiving similar errors, but I believe I caused my own problems by running the commands that Victor posted earlier.

                                    DROP TABLE idata;
                                    CREATE TABLE idata
                                    (
                                      item_id integer not null,
                                      idata_timestamp integer not null,
                                      idata_value varchar(255) null,
                                      raw_value varchar(255) null
                                    );
                                    DROP TABLE tdata;
                                    CREATE TABLE tdata
                                    (
                                      item_id integer not null,
                                      tdata_timestamp integer not null,
                                      tdata_value varchar(max) null
                                    );

                                    Is my database irrevocably damaged?

                                    1 Reply Last reply
                                    0
                                    • F
                                      F
                                      Filipp Sudanov
                                      wrote on last edited by
                                      #21

                                      dlauwers, twparker
                                      can you run
                                      nxdbmgr -t upgrade

                                      This is to see what exactly it's doing there

                                      1 Reply Last reply
                                      0
                                      • T
                                        T
                                        twparker
                                        wrote on last edited by
                                        #22

                                        Getting a lot of text - here's a snippet

                                        DROP TABLE tdata_8505
                                        >>> RELEASE SAVEPOINT nxdbmgr_1771000353984
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataTableCreationCommand_0'
                                        >>> CREATE TABLE tdata_8505 (item_id integer not null,tdata_timestamp bigint not null,tdata_value text null, PRIMARY KEY(item_id,tdata_timestamp))
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataTableCreationCommand_1'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataTableCreationCommand_2'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataTableCreationCommand_3'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataTableCreationCommand_4'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataTableCreationCommand_5'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataTableCreationCommand_6'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataTableCreationCommand_7'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataTableCreationCommand_8'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataTableCreationCommand_9'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataIndexCreationCommand_0'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataIndexCreationCommand_1'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataIndexCreationCommand_2'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataIndexCreationCommand_3'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataIndexCreationCommand_4'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataIndexCreationCommand_5'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataIndexCreationCommand_6'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataIndexCreationCommand_7'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataIndexCreationCommand_8'
                                        >>> SELECT var_value FROM metadata WHERE var_name='TDataIndexCreationCommand_9'
                                        >>> SELECT COUNT(*) FROM idata_74790

                                        1 Reply Last reply
                                        0
                                        • T
                                          T
                                          twparker
                                          wrote on last edited by
                                          #23

                                          This appears more relevant

                                          >>> RELEASE SAVEPOINT nxdbmgr_1771000399839
                                          >>> SELECT var_value FROM metadata WHERE var_name='IDataTableCreationCommand'
                                          >>> CREATE TABLE idata_46970 (item_id integer not null,idata_timestamp bigint not null,idata_value varchar(255) null,raw_value varchar(255) null, PRIMARY KEY(item_id,idata_timestamp))
                                          SQL query failed (25P02 ERROR:  current transaction is aborted, commands ignored until end of transaction block):
                                          CREATE TABLE idata_46970 (item_id integer not null,idata_timestamp bigint not null,idata_value varchar(255) null,raw_value varchar(255) null, PRIMARY KEY(item_id,idata_timestamp))
                                          Rolling back last stage due to upgrade errors...
                                          Database upgrade failed
                                          >>> SELECT var_value FROM metadata WHERE var_name='PendingOnlineUpgrades'
                                          
                                          1 Reply Last reply
                                          0

                                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                          With your input, this post could be even better 💗

                                          Register Login
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          Powered by NodeBB Contributors
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups