NetXMS Support Forum

English Support => General Support => Topic started by: colaboy on March 29, 2011, 02:30:01 PM

Title: Downgrade database
Post by: colaboy on March 29, 2011, 02:30:01 PM
I am using mysql database, I just downgrade from 1.1 to 1.0.10, but I cannot downgrade the database, any way to do that?



Checking database:
Your database has format version 221, this tool is compiled for version 105.
You need to upgrade your server before using this database.
Database check aborted


Thank you.
Title: Re: Downgrade database
Post by: colaboy on March 29, 2011, 02:35:18 PM
Is it safe to change the SchemaVersion in table metadata?
Title: Re: Downgrade database
Post by: Victor Kirhenshtein on March 29, 2011, 03:09:15 PM
Hi!

There are no standard downgrade procedure. It is not safe to just change schema version. I'll take a look how to downgrade database manually.

Best regards,
Victor
Title: Re: Downgrade database
Post by: Victor Kirhenshtein on March 29, 2011, 03:15:45 PM
You can try to execute the following SQL script to downgrade database:

DROP TABLE ap_common;
DROP TABLE ap_bindings;
DROP TABLE ap_config_files;
ALTER TABLE items DROP COLUMN system_tag;

ALTER TABLE users DROP COLUMN auth_failures;
ALTER TABLE users DROP COLUMN last_passwd_change;
ALTER TABLE users DROP COLUMN min_passwd_length;
ALTER TABLE users DROP COLUMN disabled_until;
ALTER TABLE users DROP COLUMN last_login;
ALTER TABLE users DROP COLUMN password_history;

DROP TABLE network_maps;
DROP TABLE network_map_elements;
DROP TABLE network_map_links;

UPDATE metadata SET var_value='105';

Best regards,
Victor
Title: Re: Downgrade database
Post by: colaboy on March 30, 2011, 04:46:41 AM
Thanks~ The core is running normal now. But it will stop everytime when I amend the event processing policy. And return "Unable to determine database syntax.

I am planning to make a clean install and migrate data to it.
Title: Re: Downgrade database
Post by: testos on May 20, 2011, 09:52:18 AM
Hi.

QuoteYou can try to execute the following SQL script to downgrade database:

DROP TABLE ap_common
...;

Is valid this script for downgrade database from 1.1.1 to 1.1.0?

For these situations, it would be nice nxdbmgr tool had a downgrade option

Best regards.
Title: Re: Downgrade database
Post by: Victor Kirhenshtein on May 20, 2011, 10:10:13 AM
No ready to use script. I have to create one. Could you please try my posted patch first, and if it will not help, I'll create downgrade script.

Best regards,
Victor
Title: Re: Downgrade database
Post by: testos on May 20, 2011, 11:17:04 AM
Okay. Thank you very much.

Best regards.