Bug 384492

Summary: Error migrating database from SQLite to MySQL external
Product: [Applications] digikam Reporter: Mattia <mattia.verga>
Component: Database-MigrationAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: caulier.gilles, leoutation
Priority: NOR    
Version First Reported In: 5.6.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 7.5.0
Sentry Crash Report:

Description Mattia 2017-09-08 13:12:19 UTC
I'm trying to migrate my Digikam DB from SQLite to an external MySQL server (MariaDB 5.5.44 running on Qnap NAS).

The process fails at 91% of "Copy ImageInformation" step with the error "Cannot add or update a child row: a foreign key constraint fails (`digikam`.`ImageInformation`, CONSTRAINT `ImageInformation_Images` FOREIGN KEY (`imageid`) REFERENCES `Images` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)"
Comment 1 Mattia 2017-09-08 14:52:22 UTC
Sorry, it seems that my SQLite database was corrupted in some way. I had to delete it and let Digikam rebuild a new DB, after that I successfully migrated to mySQL.
Comment 2 maderios 2017-10-01 17:06:52 UTC
(In reply to Mattia from comment #0)
> I'm trying to migrate my Digikam DB from SQLite to an external MySQL server
> (MariaDB 5.5.44 running on Qnap NAS).
> 
> The process fails at 91% of "Copy ImageInformation" step with the error
> "Cannot add or update a child row: a foreign key constraint fails
> (`digikam`.`ImageInformation`, CONSTRAINT `ImageInformation_Images` FOREIGN
> KEY (`imageid`) REFERENCES `Images` (`id`) ON DELETE CASCADE ON UPDATE
> CASCADE)"

I got today same fail message with database migration tool sqlite -> mysql external server:
'Details: Cannot add or update a child row: a foreign key constraint fails (`mydk`.`ImageInformation`, CONSTRAINT `ImageInformation_Images` FOREIGN KEY (`imageid`) REFERENCES `Images` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)'
Conditions: DK-5.7 Archlinux x86_64 Mariadb-10.1.28-1
DK works fine with sqlite.