I changed my external hard drive and the drive letter got changed in the process.
All my collections are now “broken” (strikethrough font).
I know I can change the drive letter back and I know I can go one by one and search the filmroll but is there a better way of doing this?
The filmroll → folder information is stored in the database library.db, table film_rolls, column folder. If you are familiar to work with sqlite databases you can correct the folder names using one single SQL command. Create a backup of your database first !
In the collections module you might change the dropdown from “film roll” to “folder”.
Then the top level folder of your archive should also be striked out. You can correct this (right click) and things should be ok afterwards.
Nice! Thanks.
Just what I was looking for except that I don’t know anything about SQL
But I’ll play around with it and try and figure it out (using a backup).
From an initial look, I can see that different folders are formatted differently. Examples:
D:/Photos/2020
D://Photos\2016
D:/Photos/2018\
Is there any difference between forward and backslashes and why do I sometimes see both?
Also, if I change to folders it also looks weird.
I only see some of my folders there and they appear in different ways.
Some appear as subfolders under /photos/2021
and some appear as /photos/2021/folder_name and not as subfolders like the above (although they are all in the same directory).
In other words… I feel this is getting messed up.
Is it safe to “remove” everything and then add back to the library? What will I lose?
You should have a xmp sidecar file for each image file which contains your edits. Having these xmp files you can remove images from your database without losing the edits. Then you can re-import. But you will lose any custom sort order inside your filmrolls.
Regarding the slashes / backslashes I can’t help very much. This seems to be windows specific, I’m on linux having only slashes in paths (checked this in my library.db). Backslashes are mainly used as escape characters in shells etc. on linux.
Before you go that route please follow @bilddateien advise. Since a long time this kind of problems can be solved like this, without messing with the database:
There are also tools to manipulate database entries without any knowledge of SQL. One example is sqlitestudio (opens source, https://github.com/pawelsalawa/sqlitestudio/releases), I’m sure there are others. These tools provide a GUI where you can edit entries one by one. This might be a solution for you if you have not too much filmrolls in your database.
I have found DB Browser for SQLite which is an opensource SQL database browser available for Linix,Mac & Windows which has a search and replace command to change the drive Letter/Name in one go.
I think when the collection is broken you can just rightclick on it and search for it so you can reestablish the correct location from within DT but if there are many like this I suspect careful database editing is the fastest way…
Just adding some more context to those remarks…I don’t think for a new user that what was said there would be completely obvious that you had to search and reconnect…I should have reference that I suppose…
I have a > 4TB of photos on a NAS (specifically: storage on spinning hard disks in a RAID over a gig-e wired network) and have used this “search filmroll…” feature on the topmost missing folder’s right-click menu after I renamed the location on the NAS… and darktable was surprisingly quick at fixing the locations. We’re talking a few seconds at most. (All subfolder / subdirectory locations for each image are fixed as well.)
I doubt manually messing with SQL is as quick (as you’d have to shut down darktable, switch to a terminal, type in correct SQL statements) or as easy (as the SQL statements could really mess things up if you don’t type the right thing).
The search operation in darktable is most certainly running a SQL command for you behind the scenes that changes the location of the files.
(Note: This is with darktable on Linux with an NFS mount for the photos, but it’s probably similar for everything else too.)
To prevent Windows from relettering your drives based on its whims (usually the order of what it finds for devices), you might want to manually assign the drive letter where your photos reside:
You could assign the drive letter (and probably reboot) instead of having darktable change the location. Or you could assign the drive to wherever you want (a lot of people use a higher letter… sometimes even Z:… for external storage for like this). And then if it’s not the same as before (like D: or E:), you could have darktable search for the new location and then you’re done and don’t have to worry about it again.