monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Migrate data from sqllite to mysql


From: fab admin
Subject: Migrate data from sqllite to mysql
Date: Tue, 11 Nov 2014 17:38:37 +0100


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 address@hidden 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]