monit-general
[Top][All Lists]
Advanced

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

Re: Migrate data from sqllite to mysql


From: Martin Pala
Subject: Re: Migrate data from sqllite to mysql
Date: Wed, 12 Nov 2014 16:25:00 +0100

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 <address@hidden> 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 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
> 
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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