Bug 384492 - Error migrating database from SQLite to MySQL external
Summary: Error migrating database from SQLite to MySQL external
Status: RESOLVED NOT A BUG
Alias: None
Product: digikam
Classification: Applications
Component: Database-Migration (other bugs)
Version First Reported In: 5.6.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-08 13:12 UTC by Mattia
Modified: 2022-01-02 22:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 7.5.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.