Migrating SQLLite to MSSQL

Started by Carl Green, February 12, 2018, 01:51:13 PM

Previous topic - Next topic

Carl Green

Hi

I am following this guide https://wiki.netxms.org/wiki/How_to_migrate_to_another_database

The SQL Lite database is 11MB and migrating over to MSSQL 2017 instance, started the migration but it got stuck at "Migrating table config" with no progress or error indicating when it will complete.  Here is my output:

C:\NetXMS\bin>nxdbmgr migrate c:\netxms\etc\netxmsd_old.conf
NetXMS Database Manager Version 2.1.2 Build 9015 (2.1.2) (UNICODE)

Source:
        DB Name: C:\NetXMS\database\netxms_db
        DB Server: 127.0.0.1
        DB Login: netxms
Current:
        DB Name: netxmsdb
        DB Server: SERVER\SQLEXPRESS
        DB Login: netxms

Confirm database migration? (Y/N) Y
Database driver sqlite.ddr loaded
Connected to source database


WARNING!!!
This operation will clear all configuration and collected data from destination database before migration.
Are you sure? (Y/N) Y
Database successfully cleared
Migrating table config


Anything I am missing?

Thanks

Carl

Carl Green

in a bit of a mess now, opted to upgrade to the new version: netxms-2.2.3-x64 which bailed out on the /SILENT setup and asked me to rerun the sql connection wizard and then corrupted my conf file with a path to the SQLLite database of
DBName = C:\NetXMS\database\C:\NetXMS\database\netxms_db

I fixed the path back to and tried to start the NetXMS Core service but it won't start.
DBName = C:\NetXMS\database\netxms_db

Tried to do the nxdbmgr upgrade but this results in the error of:
C:\NetXMS\bin>nxdbmgr upgrade
NetXMS Database Manager Version 2.2.3 Build 9505 (2.2.3) (UNICODE)

Upgrading database...
Upgrading from version 21.4 to 21.5
Unable to set not null constraint.
Rolling back last stage due to upgrade errors...
Database upgrade failed

Help!!!

Thanks

Carl




Carl Green

C:\NetXMS\bin>netxmsd -D 9

Using configuration file "C:\NetXMS\etc\netxmsd.conf"
2018.02.12 12:18:46.315 LIB directory set to C:\NetXMS\lib
2018.02.12 12:18:46.324 SQLite version 3.22.0
2018.02.12 12:18:46.325 Database driver "sqlite.ddr" loaded and initialized successfully
2018.02.12 12:18:46.326 [db.conn            ] DBConnect: server=127.0.0.1 db=C:\NetXMS\database\netxms_db login=netxms schema=
2018.02.12 12:18:46.329 [db.conn            ] New DB connection opened: handle=0000016862CD6E00
2018.02.12 12:18:46.330 Successfully connected to database C:\NetXMS\database\[email protected]
2018.02.12 12:18:46.355 [db.query           ] Successful sync query: "SELECT var_value FROM metadata WHERE var_name='SchemaVersion'" [24 ms]
2018.02.12 12:18:46.357 [db.query           ] Successful sync query: "SELECT var_value FROM metadata WHERE var_name='SchemaVersionMajor'" [1 ms]
2018.02.12 12:18:46.358 [db.query           ] Successful sync query: "SELECT var_value FROM metadata WHERE var_name='SchemaVersionMinor'" [0 ms]
2018.02.12 12:18:46.359 Your database has format version 21.4, but server is compiled for version 22.16
2018.02.12 12:18:46.360 [db.conn            ] DB connection 0000016862CD6E00 closed
NetXMS Core initialization failed

Carl Green

opted to restore from backup.
system back up and running again on v2.1.2