On 25/07/2021 06:48, Niranjan Rao wrote:
> Greetings,
>
>
> Not a directly darktable question so to say, but relates to it and I'm
> sure many on this list have experienced similar issues.
>
>
> As photo collection grows, so does disk usage to the point it becomes a
> critical issue. I have another storage disk connected to different PC
> where I keep moving the files as needed. However when the file is moved,
> images are naturally broken.
>
>
> Is there a way to remap the image to new path? If not, how do you handle
> this kind of scenario? File is still available, but at a new path. Main
> storage does get full and because it's a laptop, I can not connect
> another disk easily.
>
>
> If it matters, all machines are Ubuntu based.

Ok, first of all: There is a "move" feature in dt's lighttable. If you
use this, I'd expect that it will update the library etc. all right.

But then, for the hackers here, I have some script to do that... But
it's messing around with the internal dt library, so the behaviour has
to be considered as undefined, and certainly not stable with regards to
future versions.
My script relies on my folder structure, so you probably cannot use it
directly. It will also move the files for you, if you have already done
it, it will also not help, so I'm not going to share it (and no one can
blame me for screwing their library).

So here's the outline what you can try:

1. Connect to the library.db wiht a SQLite client of you choice (I'm
using a perl script with the DBI module and the SQLite "driver".

2. Find the id of the folder where your files live with "select id from
film_rolls where folder = '/your/old/path'"

3. Update the DB with "update film_rolls set folder = '/your/new/path'
where id = <id from step 2>".

(of course, if you are sure about your source path, you can combine 2
and 3 with "update film_rolls set folder = '/your/new/path' where id =
(select id from film_rolls where folder = '/your/old/path'), or even
simply "update film_rolls set folder = '/your/new/path' where folder =
'/your/old/path'", but the last version could potentially update more
than one row... I'm not sure if it ever could happen, but I'd be careful
here -- on the other hand, maybe you want this to happen...)

4. If you also want to fix your history of folders, you can update your
darktablerc with sth. like using this perl-replace
s!/your/old/path!/your/new/path!g;

Step 4 is "nice to have", if you ignore it, your history in dt will not
find show the new paths, but that's not an issue, just open the new path
from "import".

Of course, needless to say, make backups of library.db and darktablerc
before even trying. As I said, this may or may not work for you, you
might render your library useless. You have been warned.

Best regards,
        Michael

--
Michael Staats
[email protected]
____________________________________________________________________________
darktable user mailing list
to unsubscribe send a mail to [email protected]

Reply via email to