Darktable Windows : How to move database/library to external hard disk

I have just started using Darktable for Windows and really loving it!

I keep my original photos in External HDDs and I would like to move the Darktable database/library to external HDD so that I can open my photo-edits in another system (also Windows). This would also help me to move the database from my system drive (C) which has limited space.
Is it possible to do?

I have been searching for the answer since the Windows version is released but unable to find anything on it… would really appreciate any help.

There are different command line options that can be used to tell dt where to find the databas (es) in different ways. But be aware that you should ensure to access the db only with one version of dt, I the database gets upgraded by newer versions and is then no longer usable by older versions.

I don’t know about Windows, but in Linux, you can use darktable --library <library file>, where <library file> is the location of library.db. I would think you’d have a similar option in Windows - you can view the available command-line options by typing darktable --help or darktable /? or darktable -h (depending on the style of the arguments - I’m not sure the way darktable is built for Windows).

1 Like

Alright I can’t figure out how to actually get the help to display (none of the options I provided actually worked), but --library works (I think). Let me run a couple of things and confirm that.
[Edit] Cool. Yup, --library works as I described. But none of the ways to get help actually worked (at least when I tried them)…:joy:

So help works here on Windows:

darktable-generate-cache can be called with -h or --help to give usage information and terminate
darktable-chart ignores -h (opens the GUI) and does nothing with --help

Oh nice. I was just talking about the main darktable binary, which seems to just ignore --help and -h and throws an error (unknown directory) with /? (which makes sense).

I was looking at the manual, which does not mention the help parameter for the main binary. Will try the Linux version later.

The linux version definitely has it (that’s how I discovered the --library option in the first place).

I see, thanks! This does not seem to be implemented in Windows version yet, and the darktable-chart thingy is also waiting for help at the moment.

Thanks guys for your replies.

I do I run those commands on Windows?
I tried running them on command prompt - but it doesn’t seem to work.

Also, in which directory is the Library/database file located in Windows?
My install location is C:\Program Files\darktable on Win10.

Please read the FAQ relate to Windows:

And also the User Manual is extremely useful if you search for answers:
https://www.darktable.org/usermanual/en/

Ansewring your original question: database file is located in the configuration directory by default.

Also the command line works just on other platforms, just every output is redirected to the log file :open_mouth:, even if you start darktable with --help parameter - That’s not very fortunate, and we might change that soon to be more user friendly.

And the --library command line switch is also working on Windows. I have created a separate “catalog” and I can start darktable by "C:\Program Files\darktable\bin\darktable.exe" --library C:\Users\[username]\AppData\Local\darktable\catalog1.db just fine either from the command line or creating a new shortcut at the Start Menu. If the database does not exist, darktable will create a new empty database (library) for you.

2 Likes

Please note that the database does not contain any previews of images. So the occupied space of library.db might be not that much*. lighttable previews in different sizes are stored in a harddisk cache. This cache seems to be on Windows in C:\Users\[Username]\AppData\Local\Microsoft\Windows\INetCache\darktable\mipmaps-*. This needs much more space if you have a lot of images.

There is a second database data.db, which stores presets, tags and styles. If you plan to work on different systems you maybe want to have same presets, tags and styles there as well.

*check this on my Debian/Linux home:

library.db contains 16k images and has a size of ~79 M.
mipmaps-* folder has a size of 871 M whereby most folders only contain 10k preview images. I don’t want to run darktable-generate-cache to update all previews as it would may take quite some time.

Not only is the actual library file relatively small, it also contains absolute paths to the images. So using the same library file on different computers only works when both have the same drive letter assigned to the external disk.

About showing output in cmd.exe, like --help, that is hardly possible on Windows due to the brain dead way Microsoft did things.

2 Likes

Not surprised. Not surprised at all. There’s a reason I left Windows for Linux (actually multiple hahahaha).

Unfortunately most of the programs I need to use for work are available only on Windows :frowning:
So I am still waiting to move to Linux…

If I understand correctly, these commands are not working on Windows. Is there any other way to do it? Like manually moving the databse/sidecar files or something?

All those options should work the same on Windows as they do on Linux.

1 Like

Starting darktable with "C:\Program Files\darktable\bin\darktable.exe" --library d:\tmp\dt.db at the windows command prompt (cmd.exe) creates a new database for me in d:\tmp\ as @peterbud already mentioned.

However, there is no logging output shown at the command prompt. So if you start darktable like: "C:\Program Files\darktable\bin\darktable.exe" --help to see some documentation about startoptions nothing happens. That’s what does not work, because the output is written to some log file on disk. E.g. to see the output/startoptions you have to look at this log file in the manual.

Multiple of this options can be used at the same time to invoke darktable. On windows you can create batch files or use shortcuts to do this. Inside this you can place commands like
"C:\Program Files\darktable\bin\darktable.exe" --library [usbdrive letter]:\dt.db --cachedir [usbdrive letter]:\cache to start darktable with the two options --library and --cachedirat the same time.
This would use an existing or if it does not exist create a new database called dt.db and put all created previews and other stuff the needs caching in the directory cache. If it is only is only a onliner like this you can use an icon/shortcut and put this in the “field execute” or so (I have no English Windows version so this field might have a different name).

The batch file or the shortcut can resist on your external drive and can be started by double-click. The only problem is the drive letter as @houz mentioned. It needs to be the same every time. I don’t know if it possible to ensure that the same drive letter gets assigned with commands inside a batch file.

1 Like

@peterbud already linked this, but here it is again. Please read it and you will know how to see the output of --help and similar.

Yes, you are right my answer is imprecise. I know that the output is written to some log files on Windows, because I read the FAQ a few days ago. I will add this above …