Hello Martin,

Thanks for your help.
I downloaded the new script and launch it. It works!
Data have been migrated. I change the method in server.xml to MySQL and it
works fine ;)

Thanks again for you're help Martin.

Kind regards,
Fabien


2014-11-12 16:25 GMT+01:00 Martin Pala <[email protected]>:

> Hello,
>
> there was bug in the migrate script, the users table has to be migrated
> first, as the eventfilter and eventnotice tables have foreign key to it.
> You can get the fixed script here: http://mmonit.com/tmp/migrate_db.sh
>
> Regards,
> Martin
>
>
>
> > On 11 Nov 2014, at 17:38, fab admin <[email protected]> wrote:
> >
> >
> > Hello all,
> >
> > This is my first post on the mailling list so welcome!
> >
> > We use Monit to manage few host (with MMonit as dashboard) and we would
> like to migrate from sqllite3 to MySQL.
> >
> > We create a new database, and a new user with all rights on this
> database.
> >
> > CREATE DATABASE mmonit;
> > GRANT ALL ON mmonit.* to mmonit@localhost identified by 'password';
> > FLUSH PRIVILEGES;
> >
> > We go to the specific folder:
> > cd /usr/local/mmonit/mmonit-3.3/db
> >
> > Do this:
> > mysql -u mmonit mmonit -p < mmonit-schema.MySQL
> >
> > All tables have been created.
> > So now, we try to migrate all existed data from sqlite3 to MySQL with
> the script.
> >
> > ./migrate_db.sh -t mysql | mysql -u mmonit -p mmonit
> >
> > It start. But 1min later, I've this error:
> > ERROR 1452 (23000) at line 79410: Cannot add or update a child row: a
> foreign key constraint fails (`mmonit`.`eventfilter`, CONSTRAINT
> `eventfilter_uname_fk` FOREIGN KEY (`uname`) REFERENCES `users` (`uname`)
> ON DELETE CASCADE)
> >
> > Did this problem append tom somebody before? I don't how I can solve
> this problem of foreign key here...
> > Do you know how I can solve it?
> >
> >
> > Thanks a lot for your help.
> >
> > Regards,
> > Fabien
> >
> >
> > --
> > To unsubscribe:
> > https://lists.nongnu.org/mailman/listinfo/monit-general
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
>
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to