Bug 389241 - Several errors in migrating from sqlite to external mysql server
Summary: Several errors in migrating from sqlite to external mysql server
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Migration (show other bugs)
Version: 5.8.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-20 08:49 UTC by Mattia
Modified: 2019-01-06 14:36 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.0
Sentry Crash Report:


Attachments
5.9 appimage console output - migration fails (12.97 KB, text/plain)
2018-01-21 08:27 UTC, Mattia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mattia 2018-01-20 08:49:50 UTC
I've just upgraded to Digikam 5.8 and I tried the database migration tool to migrate from local Sqlite database to an external mysql (mariadb) server located on a local NAS.

First thing, it would be nice to have some debug output when things gone wrong... at the moment I can only get some quite unuseful message.

The first error happens just at the first step ("Copy albums..."): suddendly I get a "Lost connection to database server", but I don't know if it's caused by a connection timeout or if the operation is successfully completed, but it doesn't get finalized in some way (looking in the database by phpMyAdmin I can see the "albums" table to be populated).

The second error is when I try to re-launch the migration tool: I get "Error while trying to clean the destination database" (roughly translated from Italian). Seems that the tool is not able to clean the database... I have to manually drop the database and recreate it.
Comment 1 caulier.gilles 2018-01-20 09:50:13 UTC
I just finish to build the first 5.9.0 AppImage Linux bundle 64 bits from scratch, with all internal shared libraries updated to last stables, and also Qt5 5.9.3 + KF5 5.42.

5.9.0 include last changes from Maik about database migration tool. This can fix your report. Bundle is here :

https://files.kde.org/digikam/

Please test again and report

Gilles Caulier
Comment 2 Mattia 2018-01-21 08:27:13 UTC
Created attachment 110027 [details]
5.9 appimage console output - migration fails

(In reply to caulier.gilles from comment #1)
> 5.9.0 include last changes from Maik about database migration tool. This can
> fix your report. 

No, this doesn't solve the issue. Now it creates the database schema, but as soon as it starts creating AlbumRoots it says "Can't connect to MySQL server".

I attach the output from console.
Comment 3 Maik Qualmann 2018-01-21 19:40:46 UTC
(In reply to Mattia from comment #0)
> The second error is when I try to re-launch the migration tool: I get "Error
> while trying to clean the destination database" (roughly translated from
> Italian). Seems that the tool is not able to clean the database... I have to
> manually drop the database and recreate it.

When the migration starts, all tables in the target database are dropped. Why the connection to the database server can seem lost, I can not say at the moment. Can you test it with a locally running MariaDB server, if the problem also occurs here?

Maik
Comment 4 Mattia 2018-01-22 16:09:37 UTC
(In reply to Maik Qualmann from comment #3)
Can you test it with a locally running MariaDB server, if the
> problem also occurs here?
> 
> Maik

The migration to a mysql server hosted locally works. But in this case I used MariaDB 10.2.9, while on the Qnap NAS I have MariaDB 5.5.44.
Comment 5 Maik Qualmann 2018-01-22 17:57:56 UTC
Are there any problems with other programs to access the MariaDB server, possibly even Qt programs? There was a new client library with MariaDB-10.2. It would be conceivable that there are therefore problems with the older MariaDB server version on the NAS? Is there an update for the NAS?

Maik
Comment 6 Mattia 2018-01-23 17:35:43 UTC
(In reply to Maik Qualmann from comment #5)
> Are there any problems with other programs to access the MariaDB server,
> possibly even Qt programs? There was a new client library with MariaDB-10.2.
> It would be conceivable that there are therefore problems with the older
> MariaDB server version on the NAS? Is there an update for the NAS?
> 
> Maik

Actually the only other program that uses the MariaDB on the NAS is Amarok and I never had any problem with it so far.

Unfortunately, there's no update to MariaDB 10 for Qnap NASs. I always used to have Digikam database on the NAS with old 4.x, but after the port to Qt5 I had to revert back to Sqlite.

Some months ago, with Digikam 5.6 (or maybe it was 5.7) I successfully managed to migrate the database on the NAS, but I reverted back because of the problems with disappearing tags.
Now it seems that with 5.8 and 5.9 I'm not able to migrate the DB again.
Comment 7 Mattia 2019-01-06 14:29:34 UTC
Not sure what is changed, but now it seems I have no more problems in migrating and using Digikam with external MySQL database on my NAS.
One year ago I tried Digikam 5.9 from appimage, now I'm using 5.9 from Fedora repository and it works, so I'll close this bug.
Thanks.