Bug 445307

Summary: Unable to recover digiKam data on ubuntu 20.04 with Mysql server 8.0.27
Product: [Applications] digikam Reporter: Gerry Matte <gerry>
Component: Bundle-AppImageAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 7.3.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 8.0.0
Sentry Crash Report:
Attachments: digiKam Error Message trying to access MySql gatabase

Description Gerry Matte 2021-11-11 02:37:56 UTC
When I first ran the Linux AppImage I went through the "First Run" wizard and eventually succeeded in configuring digiKam to use the local MySql database.  Over a few weeks I processed all of my Pictures folders mainly completing facial recognition.

Reasonably frequently I have been using the MySql backup facility to export the Pictures database.

A few days ago, I suffered a major failure on my boot drive and after I managed to boot I reloaded my Ubuntu System using a Timeshift Backup I created about a month ago.  The system then operated correctly.

However, I realised that the MySql server databases had their data restored back to the date I last backed up Ubuntu. 
 So, I have been reloading the MySql databases from their MySql backups.  Everything seemed to proceed well - I restored my gnucash database and there were no problems at all.

However, after I restored my digiKam "Pictures" database the application would not start.  The splash screen appeared followed by an error window indicating digiKam was unable to connect to the MySql database - with no indication what I could do.  I tried deleting the database and recreating it with no data but that made no difference.  So I deleted the "Pictures" database hoping digiKam would execute its "First Run" wizard but that did not happen. 

Is there a way to execute digiKam and force it to run the "First Run" wizard ?  
Or can I delete digiKam settings and trigger the "First Run" wizard to run again ?

I believe that the MySql server ugraded itself from 8.0.26 to 8.0.27 at some point .... that may be why my restored database was preventing digiKam from starting.
Comment 1 Maik Qualmann 2021-11-11 07:04:40 UTC
You can delete your digiKam configuration file in order to restart with a First Run Wizard. This is probably under "~/.config/digikamrc". Otherwise, of course, a log from the terminal with an active debug variable would be helpful to isolate the problem first. How the log is created can be found here: 

https://www.digikam.org/contribute/

Maik
Comment 2 Gerry Matte 2021-11-12 00:07:20 UTC
Created attachment 143470 [details]
digiKam Error Message trying to access MySql gatabase
Comment 3 Gerry Matte 2021-11-12 00:07:58 UTC
Thank you Maik for your suggestions.
I was able to generate a startup log and during the process the original error window displayed again.  See attachment.   

That error suggested I try again "with an empty database."  So I deleted the 33 MySql tables in my "Pictures" database, rebooted so the active debug variable was dropped, and then ran digiKam again - it successfully rebuilt the tables and then queried me for my pictures collection.  After processing my pictures, digiKam was fully operational.

I did however lose the three hours of facial recognition data ..... but I can redo that process some other time.

It bothers me however that a MySql backup file could not be used to successfully restore digiKam's database.  Since the MySql server resides on my Linux root partition and I keep my user data on a different "home" partition (where my backups reside) perhaps digiKam should be given the ability to save and restore database backups itself.   Can you consider this as a feature request for a future version ?
Comment 4 caulier.gilles 2022-11-21 07:09:15 UTC
Gerry,

Important not : digiKam 7.9.0 (and later 8.0.0) AppImage bundle are now build under Ubuntu 18.04 to support a better binary compatibility with all Linux system.

As you use Ubuntu 20.04, and if your problem is due to a binary incompatibility with previous AppImage generated from Mageia7, this problem must be fixed now.

Best

Gilles Caulier
Comment 5 caulier.gilles 2023-04-09 05:31:12 UTC
For a database backup feature, i file is already open in bugzilla : https://bugs.kde.org/show_bug.cgi?id=224312

Following the comment #3 I can close this file now

Gilles Caulier