darktable: finding database/catalogue on my MacOs

Please make sure to understand how darktable finds the library before moving it around. The default database is expected in that folder, and you need to run darktable from the command line with additional command line options to access it somewhere else.

2 Likes

It looks like you got it sorted. Holding down command-shift-. (period) displays the hidden files in the Mac Finder. Doing it again makes them invisible again.

When I first migrated all my lifetime’s photos from Aperture to darktable, I imported all my photos (a few hundred thousand) into one darktable library and it just about ground to a halt. Unusably super sluggish. So I switched to running one library for each year of photos.

I keep a folder in the .config/darktable folder called “my libraries” and inside that is one folder for each year. Inside each is the library.db folder for that year. When I want to run darktable with a year other than 2018, I move 2018’s library.db folder into its 2018 folder and move the other year’s library.db file up to the top of the darktable folder. Then start darktable.

It works pretty well. Except that I’m still figuring out the best way to search across all my years’ library.db sqlite databases at once. I’ll do that outside of darktable.

1 Like

Dear Jon,

thanks for your post. Inspiring. At least to me.

Now, so that you know, I come from Lightroom, and I am not going to import my (thousands of) photos. No way, too much of a mess and I don´t have the .xmp files from LR. End of the story.

Now, I struggle to understand how to create a new library in darktable, I do not find the way. Could you explain that to me, please? Since I run Mac, my DT library folder is normally invisible, that’s why I took my a while to find it. In fact, with LR, I used to create a new catalogue for each year.
I am struggling to find a way to replicate the same workflow.

Thanks in advance for your help

M.

In reply

That’s actually a terrible thing to do. You will get wrong thumbnails for your images as darktable has no idea about the fact that the same image id is now used for a completely different image. Better start darktable with --library "~/.config/darktable/my libraries/2016/library.db". That way darktable will create its own thumbnail cache for that library.

Adding a small tool to create a new library or pick one existing library and then start dt with that is on our todo list. If anyone wants to give it a try (s)he should ping me on IRC. It won’t be too hard as it’s going to be a standalone tool, so no knowledge of darktable internals are required.

1 Like

Tags are stored in a separate shared database called data.db.
If you specify a non-default library name with the command line as houz suggested for the individual years, darktable will still use this shared database (data.db) to read and store the tags. So basically you will have the same tags across all years.

Hi houz,

(I’ve deleted my first reply after realising that I’d misinterpreted your post the first time.)

Thanks for the advice.

Yes, I noticed the thumbnail cache problem immediately. I “solved” it by turning off “enable disk backend for thumbnail cache” in the settings, which worked OK, but meant that the thumbnails need to regenerate each session.

Your solution sounds much better! Thanks! I’ve not tried starting darktable from the command line. I’ll give that a go now.

That library picker feature is a great idea idea.

Thanks peterbud. You bet me to it. I realised that I’d misread houz’s post the first time and deleted my first reply before I saw your reply show up. This sounds like a great solution.

FYI, I’ve been trying but can’t get this working. It might be a Mac thing. I installed darktable with the dmg, not via the command line, and I can’t figure out how to get darktable working properly from the Mac unix Terminal app.

For a start, my Terminal doesn’t recognize darktable as a command.

-bash: darktable: command not found

Not deterred, I then went and found the app inside the darktable app package in my Applications folder and ran that in my Terminal using

/Applications/darktable.app/Contents/MacOS/darktable --library "~/.config/darktable/my libraries/2016/library.db"

That tries to open the darktable GUI but gives the following error.

[init] error opening the database lock file for reading
[init] database is locked, probably another process is already using it

I checked in .config and there are no library.db.lock files present.

It does try to open the darktable app GUI but instead displays the following window and I’m forced to close darktable.
42 AM

If I just run /Applications/darktable.app/Contents/MacOS/darktable in Terminal, it does open the darktable GUI (using my default library.db) but also produces the following errors and the Terminal cursor vanishes.

(darktable-bin:28710): GLib-GObject-WARNING **: invalid cast from ‘GtkMenuBar’ to ‘GtkWindow’

(darktable-bin:28710): Gtk-CRITICAL **: gtk_window_add_accel_group: assertion ‘GTK_IS_WINDOW (window)’ failed

(darktable-bin:28710): Gdk-WARNING **: GdkQuartzDisplay does not implement the monitor vfuncs

I’m going to stop now before I break something. Any hints?

You still have a lock file, either library.lock or data.lock. if darktable is not open, you can remove those files.

Just make sure that the folder ~/.config/darktable/my libraries/2016/ exists. I should have mentioned that.

Hi, can you tell me more about migrating from Aperture to Darktable ?
Just create a topic here
Thank you