NetXMS Support Forum

English Support => General Support => Topic started by: JMC Software on July 02, 2012, 11:16:51 AM

Title: Database export failed -> V 1.2.0 ERROR: cannot load schema file Windows 2008 r2
Post by: JMC Software on July 02, 2012, 11:16:51 AM
Hello netxms community,

we have the same problem like this member: https://www.netxms.org/forum/general-support/export-cannot-load-schema-file
We would like to change our netxms DB server from Server1 MS SQL 2005 to Server2 MS SQL 2008 R2.
First i try to move the database with ms sql export and import. I stopped the netxms core, export and import the database with the sql export tools, change the netxmsd.conf file. That doesnt work for me, because i got a version error.
The secound try was with the export parameter from netxms
"nxdbmgr.exe export db_name"
I got the error:
ERROR: cannot load schema file "C\lib\sql\dbschema_sqlite.sql"
Database export failed.
The schema file is located at: C:\NetXMS\lib\sql\dbschema_sqlite.sql
I created the path "C\lib\sql\" but that didnt work.
I thought its a bug in 1.1.7 but it seems that the bug is still alive in 1.2.0.
Does anybody have an idea?
Thank u.
best regards
Steffen
Title: Re: Database export failed -> V 1.2.0 ERROR: cannot load schema file Windows 2008 r2
Post by: Victor Kirhenshtein on July 02, 2012, 01:02:00 PM
Hi!

I'll take a look at this bug. However, moving database with MS SQL export/import should work. What exact error you got when you try to connect database on new server?

Best regards,
Victor
Title: Re: Database export failed -> V 1.2.0 ERROR: cannot load schema file Windows 2008 r2
Post by: JMC Software on July 02, 2012, 02:51:08 PM
Hello victor,

thank u for replay.
I got this error:
PS C:\NetXMS\bin> .\netxmsd.exe
Using configuration file "C:\NetXMS\etc\netxmsd.conf"
[02-Jul-2012 13:48:59] Database driver "mssql.ddr" loaded and initialized successfully
[02-Jul-2012 13:48:59] SQL query failed (Query = "SELECT var_value FROM metadata WHERE var_name='SchemaVersion'"): [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name 'metadata'.
[02-Jul-2012 13:48:59] SQL query failed (Query = "SELECT var_value FROM config WHERE var_name='DBFormatVersion'"): [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid Object name 'config'.
[02-Jul-2012 13:48:59] Your database has format version -1, but server is compiled for version 252 NetXMS Core initialization failed

I changed the config parameter for the new sql server.
best regards,
Steffen
Title: Re: Database export failed -> V 1.2.0 ERROR: cannot load schema file Windows 2008 r2
Post by: Victor Kirhenshtein on July 04, 2012, 08:12:49 PM
Hi!

It looks like new database does not contain NetXMS tables. Other possible problem could be that tables in new database has schema name different from NetXMS database user's schema (maybe I'm using wrong terminology here, I'm not a MS SQL expert - I mean that full table names could be dbo.config for example in new database, but server uses only short names, like config, so it can search for netxms.config instead of dbo.config).

Best regards,
Victor
Title: Re: Database export failed -> V 1.2.0 ERROR: cannot load schema file Windows 2008 r2
Post by: JMC Software on July 06, 2012, 03:12:09 PM
Hi victor,

it works! The db schema user was the problem. like u said. I delete the old one, create a new user (same name) and vola... it works.
Thank u very much!

best regards
Steffen