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 database from 2.21 to 2.22 error

Upgrade database from 2.21 to 2.22 error

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 24.7k 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.
  • H
    H
    Luiz A. Camilo
    wrote on last edited by
    #1

    I was trying to upgrade to the newest version, and when upgrading the database, I get an error ...

    C:\NetXMS\bin>nxdbmgr upgrade -t
    NetXMS Database Manager Version 0.2.22

    Configuration file OK
    Upgrading database...
    Upgrading from version 80 to 81
    >>> SELECT item_id,schedule FROM dci_schedules
    >>> DELETE FROM dci_schedules
    >>> ALTER TABLE dci_schedules ADD schedule_id integer not null
    SQL query failed (General SQL Server error: Check messages from the SQL Server.)
    :
    ALTER TABLE dci_schedules ADD schedule_id integer not null
    Rolling back last stage due to upgrade errors...
    Database upgrade failed

    When trying to execute the same command from Query analyzer, I get this error back :

    ALTER TABLE only allows columns to be added that can contain nulls or have a DEFAULT definition specified. Column 'schedule_id' cannot be added to table 'dci_schedules' because it does not allow nulls and does not specify a DEFAULT definition.

    I need ideas ...

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

      Looks like a bug in handling MS SQL on upgrade (it works fine on my test system, but I have MS SQL 2005). Try to do an upgrade with attached nxdbmgr.exe.

      Best regards,
      Victor


      nxdbmgr.exe

      1 Reply Last reply
      0
      • H
        H
        Luiz A. Camilo
        wrote on last edited by
        #3

        I tryed again and used the executable that you provided me, and got an error again ... on another step ...

        C:\NetXMS\bin>nxdbmgr upgrade -t
        NetXMS Database Manager Version 0.2.23-rc1

        Configuration file OK
        Upgrading database...
        Upgrading from version 80 to 81
        >>> SELECT item_id,schedule FROM dci_schedules
        >>> DROP TABLE dci_schedules
        >>> CREATE TABLE dci_schedules (schedule_id integer not null,item_id integer not
         null,schedule varchar(255) not null,PRIMARY KEY(item_id,schedule_id))
        >>> ALTER TABLE address_lists ADD PRIMARY KEY (list_type,community_id,addr_type,
        addr1,addr2)
        SQL query failed (General SQL Server error: Check messages from the SQL Server.)
        :
        ALTER TABLE address_lists ADD PRIMARY KEY (list_type,community_id,addr_type,addr
        1,addr2)
        Rolling back last stage due to upgrade errors...
        Database upgrade failed

        When executing the command from query analyzer, the error is bellow .

        Server: Msg 8111, Level 16, State 1, Line 1
        Cannot define PRIMARY KEY constraint on nullable column in table 'address_lists'.
        Server: Msg 1750, Level 16, State 1, Line 1
        Could not create constraint. See previous errors.

        Can you give me the full upgrade script that you´re using on this executable ?
        I can try to work on it .. , as seems that I´m the only one having problems to upgrade ...

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

          Hello!

          It's not a plain SQL script. Commands may vary between databases, so it's a set of static and dynamically created SQL queries encoded into nxdbmgr code.

          I change the upgrade code to re-create tables instead of adding constraints, hopefully it will work.

          Attached is a latest version of nxdbmgr.exe.

          Best regards,
          Victor


          nxdbmgr.exe

          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