NetXMS Support Forum

English Support => General Support => Topic started by: lindeamon on September 11, 2011, 07:31:03 PM

Title: db upgrade 1.1.4
Post by: lindeamon on September 11, 2011, 07:31:03 PM
hi,

how can i import sqlite exported db from version 1.0.12 to sqlite db in version 1.1.4 ?
i have installed version 1.0.12,imported the db and everything worked fine.
i have uninstalled the 1.0.12 and installed version 1.1.4 and tolled it to use the old db with out initializing it and i got errors.
when i tried to upgrade the db through command line it says it had a problem with the syntax in "drop table network_maps drop column background"

what can i do ? i do not want to reconfigure everything again.

10x,
Lindeamon
Title: Re: db upgrade 1.1.4
Post by: Victor Kirhenshtein on September 11, 2011, 08:11:37 PM
What is your production DB engine?
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 11, 2011, 08:15:19 PM
i want to use mysql.
what i have done now is installed my old server v 1.0.12 with mysql and import the data.i have managed to upgrade it before to 1.1.3 but not to 1.1.4 and that is what i am tryin to reproduce now so i could maybe export through version 1.1.3 and do the upgrade.
Title: Re: db upgrade 1.1.4
Post by: Victor Kirhenshtein on September 11, 2011, 08:21:52 PM
So, you have MySQL database for 1.0.12 and want to upgrade it to 1.1.4? It should be possible to done it in place. Just install 1.1.4, point it to appropriate database, and run database upgrade. If it shows any error, please send me log/screenshot of nxdbmgr upgrade execution.

Best regards,
Victor
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 11, 2011, 08:25:51 PM
ok victor.
does this apply also to any database of chosen ? can i use sqlite if i want ?

thank you very much
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 11, 2011, 08:34:27 PM
do i have to do initialize ?
when do i have to do initialize ?

10x again
Title: Re: db upgrade 1.1.4
Post by: Victor Kirhenshtein on September 11, 2011, 09:29:57 PM
You should not initialize database if it already contains data. Initialization is for fresh installation on empty database.

Generally I do not recommend to use SQLite in production. It has both performance and upgrade issues, although performance can be insufficient only for relatively large installations. Upgrade problems are related to the fact that SQLite does not support DROP COLUMN operation - so if database upgrade requires column removal from the table, it will fail. It is possible to do upgrade manually in these cases, but it is time consuming and requires digging into the source code of nxdbmgr to see what SQL queries should be executed.

Best regards,
Victor
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 11, 2011, 09:34:08 PM
ok victor.

i have installed everything from the start.
1. installed the mysql
2. installed version 1.0.12
3. imported the db export i had.

up to here everything worked fine.

4. uninstalled the 1.0.12
5. installed version 1.1.4 and pointed him to the mysql server and did not tell him to initialize.
6. the setup upgraded the db successfully.

the core service does not come up and the eventlog indicates this malfunctions:
1. event id:46, error initializing component locks table
2. event id:43, sql query failed (query = "select var_value from config where var_name=?"):

i have tried to run the services through command line and added the -D 9 at the end for debug mode but got the error: "startservicecontroldispatcher() failed: the service process could not connect to the service controller."

what do you think is wrong ?

10x,
lindeamon
Title: Re: db upgrade 1.1.4
Post by: Victor Kirhenshtein on September 11, 2011, 10:02:05 PM
If you run netxmsd.exe from command line, you should omit -d switch, like this:

netxmsd.exe -D 9

Best regards,
Victor
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 11, 2011, 10:04:13 PM
you are right.i have changed the service config and i got the messages i wrote in my last post

i hope you have the answer to the problem.
Title: Re: db upgrade 1.1.4
Post by: Victor Kirhenshtein on September 11, 2011, 10:15:07 PM
I have replicated this issue on my system. Looks like a bug in MySQL driver. I'll post a patch when I fix it.

Best regards,
Victor
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 11, 2011, 10:17:40 PM
so what you are saying is that will not be able to use this new vesrion ?
bummer
ok, i will wait for the patch.
b.t.w - i have restored everything to version 1.1.3 and everything is working fine again.
Title: Re: db upgrade 1.1.4
Post by: Victor Kirhenshtein on September 11, 2011, 10:49:21 PM
Yes, unfortunately there is a bug in MySQL driver in 1.1.4. I'll try to made a patch tomorrow. Other DB engines should work fine. I do most of the development using Oracle and PostgreSQL, and at some point forgot to make necessary tests at MySQL.

Best regards,
Victor
Title: Re: db upgrade 1.1.4
Post by: Marco Incalcaterra on September 12, 2011, 03:44:32 PM
Hi Victor,

I'm getting this error upgrading to version 1.1.4 (from 1.1.3):

C:\Program Files\NetXMS\bin>nxdbmgr.exe upgrade
NetXMS Database Manager Version 1.1.4

Upgrading database...
Upgrading from version 236 to 237
SQL query failed ([Microsoft][SQL Native Client][SQL Server]The object 'DF__business___paren__09746778' is dependent on column 'parent_id'.):
ALTER TABLE business_services DROP COLUMN parent_id
Rolling back last stage due to upgrade errors...
Database upgrade failed

Now I rolled back to version 1.1.3, any hints?

Another question: where can I find the mobile client for Android?

Thank you very much for your support.

Marco.
Title: Re: db upgrade 1.1.4
Post by: Victor Kirhenshtein on September 12, 2011, 04:01:46 PM
Hi!

Same problem as here: https://www.netxms.org/forum/installation/1-1-4-database-upgrade-error/ (https://www.netxms.org/forum/installation/1-1-4-database-upgrade-error/). In short, try to run manually

ALTER TABLE business_services DROP CONSTRAINT DF__business___paren__09746778;

Best regards,
Victor
Title: Re: db upgrade 1.1.4
Post by: Victor Kirhenshtein on September 13, 2011, 01:13:49 AM
MySQL driver patch for 1.1.4. Just replace existing mysql.ddr with attached one.

Best regards,
Victor
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 13, 2011, 09:44:54 AM
thank you victor.

there is something not clear to me yet.how can i do a replace if the installation is a new one ?
do i have to do an installation without configuring the server,replace the driver and then do the server configuration part ?

10x,
lindeamon
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 13, 2011, 09:49:09 AM
sorry victor,

i have remmebered why we needed the patch.to replace the old one after the db upgrade.
just ignore my former post.

thank you,
lindeamon
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 14, 2011, 10:52:19 AM
hi victor,

i have installed version 1.1.3 and let it work for a day or two and it worked ok.i have uninstalled it and installed version 1.1.4.
i have gone through all the steps of the setup and when the server configuration wizard came up i have replaced the mysql.ddr file with the one you gave me in this post and finished the wizard and nothing works.
i have tried to upgrade the db through command line and it says the db version is the latest.
i invoked the netxmsd in command line with debug 9 and it said it had connected to the database but failed with this message "error initializing component locks table"

best regards,
lindeamon
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 14, 2011, 10:55:32 AM
i forgot to say that i did not initialized the databse.
Title: Re: db upgrade 1.1.4
Post by: Victor Kirhenshtein on September 14, 2011, 12:21:31 PM
Could you please try this driver?

Best regards,
Victor
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 14, 2011, 02:32:54 PM
ok

i will give it a try and tell you if it worked.
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 14, 2011, 02:54:29 PM
hi victor,

to cut the story short i did everything as i mentioned in the last time and everything went fine but service did not came up.running the service from command line told that my db has a version of 232 and the server is compiled for version 240.
i did an upgrade and it failed and the error message said :" sql query failed (table 'business_services' already exists): " and then it writes the sql command: "create table business_services........" and all of it's data.

Best Regards,
Lindeamon
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 14, 2011, 03:13:01 PM
hi victor,

i have tried to delete the table mentioned in the former post and failed with other tables like node_links.
fyi

lindeamon
Title: Re: db upgrade 1.1.4
Post by: Victor Kirhenshtein on September 14, 2011, 03:48:00 PM
Hi!

Looks like database was messed up during all these upgrades. Can you please run

nxdbmgr upgrade -X

(it will ignore errors), and then try to run server. Also, if possible, export and send to me database schema - I'll check it for correctness.

Best regards,
Victor
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 14, 2011, 04:41:43 PM
ok victor,

it worked.
what version of the sql.ddr patches do i have to save for now ? the latest one ?

Best Regards,
Lindeamon
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 14, 2011, 04:48:43 PM
regarding the schema,is there any quick way to export it without any records ? if it is not possible then i will not be able to send it to you.
but there is something the makes me wonder,after each installation i tried with the different patches you gave me i have restored the databse to the one that worked with v1.1.3 so why would it give me errors ?
maybe i will try to make a clean install and check it.

10x,
lindeamon
Title: Re: db upgrade 1.1.4
Post by: lindeamon on September 14, 2011, 05:03:02 PM
hi victor,

i found a way to export with no data.here is the v1.1.4 schema
Title: Re: db upgrade 1.1.4
Post by: Victor Kirhenshtein on September 14, 2011, 07:19:07 PM
Quote from: lindeamon on September 14, 2011, 04:41:43 PM
what version of the sql.ddr patches do i have to save for now ? the latest one ?

Yes.

Best regards,
Victor