Bug 441749 - Method to relocate data
Summary: Method to relocate data
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Maintenance-Database (show other bugs)
Version: 7.3.0
Platform: Microsoft Windows Microsoft Windows
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-30 11:09 UTC by Steve Franks
Modified: 2021-09-15 09:01 UTC (History)
2 users (show)

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


Attachments
Collection.png (138.89 KB, image/png)
2021-09-01 16:55 UTC, Maik Qualmann
Details
attachment-25810-0.html (1.05 KB, text/html)
2021-09-15 09:02 UTC, Steve Franks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Franks 2021-08-30 11:09:53 UTC
SUMMARY
I moved Digikam database from Lubuntu to Windows. Lubutu phots are on removeable disk, Windows Internal disk.
I can't see a method in Configuration, or Database Maintenance, to easily change albums to the internal disk.

STEPS TO REPRODUCE
1. 
Add an album from removeable media
2. 
Copy Data to folders on an internal disk
3. 
Configure Digikam to use the folders on the internal disk
OBSERVED RESULT
Digikam will add a new album for the internal disk, even though the folders have the same structure and contain copies of the same files.

EXPECTED RESULT
A single album containing the original data, referring to the files on the target disk.
MY WORKAROUND
After digikam created the album for the internal disk I ended it. I then modified the digikam.db file using Heidi SQL:-
a) Opened the albums table
b) Copied the internal disk volume id (to the clipboard)
c) deleted the internal disk album reord from the albums table
d) Pasted the volume id into the removeable disk data and changed that disk from type 2 to type 1
e) Restarted digikam.

digikam then scanned the collections, unfortunately that is taking about the same time as if I had just created a new database from scratch.
SOFTWARE/OS VERSIONS
Windows: 11
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
I would like digikam to own its data. ie If the database data differs from the metadata in an image, the digikam data should take preference even if the file modified date is earlier.
Some people may disagree, so it would be nice if there was a switch to allow me to tell digikam to overwrite metadata on disk, or use it to update its database
Comment 1 Maik Qualmann 2021-08-30 11:17:32 UTC
You can easily change the collection type and path in the digiKam collection settings with the "Refresh" symbol (round circle). Only the underlying directory structure has to be the same.

Maik
Comment 2 Maik Qualmann 2021-08-30 11:58:30 UTC
Incidentally, your wishes under "additional" exist already. There are corresponding settings in the digiKam metadata settings to force a re-read of the images and also to clean up the database.

Maik
Comment 3 Steve Franks 2021-09-01 11:39:08 UTC
OK I'm now confused.
I did not find an option to move the collection from removeable to internal disk. Refresh only refreshed the non-existent external disk. Setting the correct folder on the internal disk created a second collection and digikam started to read all 160k photos again. That would have undone all of my work removing redundant keywords. 

How do I set digikam to just write metadata from its database to files, without reading them first?
Comment 4 Maik Qualmann 2021-09-01 16:55:09 UTC
Created attachment 141229 [details]
Collection.png

I would suggest you if you only deal with digiKam in peace. You should think carefully about the things you are planning to do at the moment and have a backup of the database. Here is a screenshot. 

Maik
Comment 5 Steve Franks 2021-09-15 09:01:59 UTC
Created attachment 141556 [details]
attachment-25810-0.html

I tried moving the database by the method you suggested, but digikam still
asked for a new album name.
I have decided not to use digikam for Windows, but have put the 7.3.0
appimage onto an old pc.
When I migrated the database to MySQL internal I ended up, after about an
hour with a database without albums. I tried again, using a different
directory for the new database. This time the database contained my photos,
but digikam spent about 12 hours (not certain, because I went to bed and
left it running), scanning my pictures.
The end result is a database that contains all of the old keywords that I
spent days removing from the database.
I think that the database needs to be MySQL, because t has 162,347 images
and stalls when checking for new files.
What am I doing wrong? Why doesn’t the new database contain the same data
as the original did?
Thanks in advance,
Steve