MySql import database problem ('DBVersion' does noet exist)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

MySql import database problem ('DBVersion' does noet exist)

Robert
This post was updated on .
I use digikam 7.1 with a MySql (MariaDB) backend on my NAS.
I wanted to tag, clean and restructure a lot of images and albums. The performance over the network is a lot slower compared to digikam + mysql locally. So I exported the database and imported it in my local database (images still on the NAS)
I spend a lot of time tagging, face recognition, restructuring of albums etc. on my local database. Now I need to export and restore the database to the network server.

The problem is that Digikam won't recognize the database when I restore it back to the network database server. Digikam keeps saying that the database is invalid (DBVersion does not exist).

When I compare the remote db and the local one (with HeidiSQL) they look the same to me. Sizes are the same (2.6Gb) and both settings tables are exactly the same (including the DBVersion field). Local and remote use the same user and password for the digikam database.

(When I use the same db setting but use a different databasename (DK for for core, thumbs, faces etc) Digikam will create a new empty database and will work... )

The steps I did to export / import the database from local to remote:
On the remote db:
- Drop database digikam
- Create a new digikam database using the Sql from the manual:
               CREATE USER 'dbuser'@'%' IDENTIFIED BY 'password';
                GRANT ALL ON *.* TO 'dbuser'@'%' IDENTIFIED BY 'password';
                CREATE DATABASE digikam;
                GRANT ALL PRIVILEGES ON digikam.* TO 'dbuser'@'%';
                FLUSH PRIVILEGES;
- Use the MySql CLI to import the export file:
sudo mysql --user=dbuser  --password=xxx digikam < export.sql
(this takes some time, 2.6Gb)

In digikam:
- Change db settiings: Hostname and port (password, dbuser are the same)
- Check database connection: OK!

When I do this I get the error about the DBVersion does not exist.

It worked the other way around (network database to local...)

What am I doing wrong, what am I missing?


--Robert
 
Reply | Threaded
Open this post in threaded view
|

Re: MySql import database problem ('DBVersion' does noet exist)

Robert
(I posted my question also to r/kde. This is my post on that thread)

After several days debugging this problem, I've come to the conclusion that I have stumbled on a bug. I will give up on trying to import the MariaDB database from windows into the MariaDB on my Synology NAS.

For the curious: Export database from NAS and import into Windows works fine. Directly export from Windows and reimport on NAS works fine also.

Then I changed some things using DK (I dropped a few tags, and assigned a few faces) When I then export the Windows database and import it into the NAS , DK does not recognize it anymore (with the error mentioned)

I gave up on this and will be using an other approach:

I was using the network database so two people can use DK on different machines with the same photo library.

What I do instead: I stripped all metadata from the images with exiftool. Than I had DK write all its metadata to the images. On the other machine I started with a fresh install and reread all metadata from the images. This way all metadata is synced across both machine without a shared database.

It has as added benefit that both machines have a local database, which make it way faster than before with the network database.

It seems to be running fine. Is this a good approach, or can I expect to run into trouble later on?

See also this post on r/kde