Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pandora FMS db migration error
I try to migrate the pandora db version 6.0 to version 7.0. But I got an error " ERROR 1054 (42S22) at line 145: Unknown column 'ip_target' in 'tpolicy_modules' ", I'm using pandora FMS 7 ubuntu 18.04

Attached Files

.png   Screenshot (478).png (Size: 71.88 KB / Downloads: 5)
¡Hi everybody! I am just drinking more coffee☕ for this, I start...

*** WARNING *** : you are working at your own risk, I only suggest some issues  that I found.

FIRST: Check if table 'tpolicy_modules' exists because I got error when creating it. I use MySQL 14.14 on Ubuntu 18.04:

>>mysql --version
mysql  Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using  EditLine wrapper

There is a problem for default values (see ) for TEXT fields:

ERROR 1101 (42000): BLOB, TEXT, GEOMETRY or JSON column 'unit' can't have a default value

quick-and-dirty: I created that table erasing «default ''» ;-)  this is an old issue for MySQL.

SECOND: absolutely no problem for your case, this instruction fix very well:

ALTER TABLE tpolicy_modules ADD COLUMN `ip_target`varchar(100) default '';

BUT NEXT LINE yes, "Uh, Houston, we've had a problem":

ALTER TABLE tpolicy_modules ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
ERROR 1060 (42S21): Duplicate column name 'dynamic_next'

I thing that we need here a function for check first if field exists, something like explains here (I am not tested that code) BIG WORK but at long time harvest benefits (and avoid headaches!).

Thanks for your attention! ?

This failure is due to the fact that you are missing some changes made to the database (aka MR). Before reviewing them I have to ask you,  you comment that you are using Pandora FMS 7 version, this is the version you are updating to? were you in a Pandora FMS 6 version instead of in a Pandora FMS 7?

In case you had a Pandora FMS 7 before, it is not necessary to use the migration script, you just have to update the MR as indicated in our wiki.

In case you were using Pandora FMS 6, you should update the database with a migration script. I also attach a link to this section of the wiki.

But it is important that you identify which version you were in and which one you are in now to avoid having more database problems in the future.


Users browsing this thread: 1 Guest(s)

(c) 2006-2018 Artica Soluciones Tecnológicas. Contents of this wiki are under Create Common Attribution v3 licence. | |

Theme © MyBB Themes