How to tell darktable that images have moved?

I’ve reached the conclusion that my revised folder structure for 2021 needs to be, well, revised! I can’t see anyway of moving them directly with darktable - is this possible?
If not, I’ll just move them using the relevant file management function of the Op.Sys, re-import the images into darktable and delete the images/folders that darktable says it can’t find - correct?

As long as you’re moving entire folders, you can move them on the filesystem and then use the collect module to tell darktable where they are.

https://www.darktable.org/usermanual/en/module-reference/utility-modules/shared/collect-images/#updating-the-folder-path-of-moved-images

AH, great - that looks like the solution I need. But disappointed in myself that I couldn’t find that reference in the official documentation, though.

The process works fine; human factors are, shall we say ‘basic’: enough to do what is required, but require a lot of additional clicking from the user because the dialog boxes are closed after each successful ‘re-linking’ of a folder. Fortunately I had to invoke the process only 7 times…

Yeah I think I’ve used it twice ever.

Another easy option is to simply move the folder using your filemanager or cli, reimport it into darktable, then shut down darktable and run the purge_non_existing_images.sh script.

I had the same question. I’d tried pointing dt to the new location of the folders, but it didn’t quite work out the way I wanted. Finally, I just deleted all photos from dt and imported them back again.

Useful tip; thanks. but I don’t see this script on GitHub - what am I missing ?

Thanks for this. In my ignorance, I was looking here:

which seems like the obvious place to look.

I would never have found the URL you sent me to. When I search (Google) for “darktable lua scripts” it does not tell me about this location. And having now been pointed to it, the really dumb question is: how do I get a copy of this script? I do not have experience with or understanding of Git Hub, so my first reaction is to copy and paste bits of the script into a text file. But what is the correct way of doing it?

1 Like

If you have git installed just run git clone https://github.com/darktable-org/darktable.git and this will create a new darktable directory and put all of the source code into it. Pasting into a text file will probably work too though.

You can also right-click on the “Raw” button in the link I sent and choose “Save Link as”

Sadly, no it doesn’t: “remote: Invalid username or password.
fatal: Authentication failed for ‘https://github.com/darktable.org/darktable.git/’”

I’m not surprised: how could I possibly know what the authentication values are?

No idea why you’re getting this. You shouldn’t need to authenticate just to clone a repo.

Try this:

git clone git://github.com/darktable-org/darktable.git

If that doesn’t work then maybe you do need a github login. I don’t know how to log out to test it myself.

Sorry ignore my last post - that’s for ssh clone which certainly won’t work if you don’t have a github login and ssh keys set up. It seems that you do need a github userid and password just to clone a repo (which seems a bit rubbish to me given that the repo is public and cloning just pulls the content).

So your option is probably either to create a github login (if you don’t have one) or just download the zip file.

Creating a github login does not solve the problem: git still tells me that the repository ‘/darktable.org/darktable.git’ does not exist when I try to use the command line.

In order to make a pull request git requires me to have a repository. To achieve that I have to have a login. To achieve that I have to reveal a valid email address. So the price for getting the script is the certainly of getting ever more scam and spam emails - currently running at over a hundred a day aggregated across my email addresses.

But to make a pull request essentially requires me to become a darktable developer - which is quite beyond me.

Finally, there is no option, that I am able to find, that either identifies a zip form of the script or allows me to download it. As I said, GitHub is quite beyond my understanding or requirements as a picture taker and raw image editor.

I was talking about a zip of the repo, here:

Alternatively, as I suggested above

Well, in my blundering about earlier, in a fog of ignorance, I stumbled across the ‘raw’ button, clicked it then copied the contents of the file into a text file and saved it. When I try to run the .sh file, bash (?) tells me that the command does not exist, but is quite willing to list it!

This is almost certainly because I don’t know how to run a script. My brain, looking back to 1980 (or even earlier), equates a ‘sh’ with a ‘.bat’ and thinks it should just be executable by invoking its name…

You probably need to make it executable (chmod +x <file>.sh) then probably it’s worth running it with ./<file>.sh

Ah, figured out how to run a ‘.sh’ file; even guessed at what a ‘sqlite3 binary’ might be, but really defeated by an error in the script on line 87: “Syntax error: redirection unexpected”.

Never a dull moment, is there?

Maybe you don’t have sqlite3 installed? I don’t know - I’m not familiar with this script.