darktable re-imported my entire library instead of the handfull of new photos I was trying to add. Is there a way to reset the library?

I now have duplicates of almost 10k photos, and I haven’t found a way to simply reset the library. I’ve been meaning to re-structure my storage before i try to switch my PC to linux, but don’t have the time to do it for a little while. Is there a quick reset option?

Dt makes backups at a frequency you select. How old is the last backup?

2 Likes

If using the copy and import feature there is an option to select only new images. I am not sure how you duplicated your library and if your computer has created duplicate raw files or just duplicate xmp files (which are very small).

1 Like

it happened when I tried to import some new photos, but i could have messed something up in my file management. i’ll have to look into it tomorrow

If you used the add to library feature that doesn’t create duplicates, but if you used the copy and import feature you have asked it to make a duplicate file and add it to darktable’s library.
image

1 Like

@my_dad:
If the import was through “copy & import” the duplicates should have a different name and creation date? If that’s the case, you can:

  • quit darktable
  • use a file manager to delete the duplicates (file date could be handy for this)
  • then use the script purge-non-existing-images.sh (or the equivalent under windows)
  • restart darktable.

You may have to re-import the batch where you made the error (can’t say for sure with the level of detail provided)

Important: do NOT have darktable running when you use the script! (either the script won’t work because the database is locked, or you risk two programs modifying the database).


I noticed you ignored g-man’s question. His solution (replacing the current database with a backup) would be the easiest, but you would have to re-import the failed batch.

1 Like

I don’t fully understand what you mean by reset. One simple way is to delete library.db and re-import all images. This will afaik lead to image-groupings being lost (not 100% on that) and you should be very sure that all your edits are in the XMP files. If you mean “revert” - then yes: darktable keeps dated snapshots of your library.db in the configuration directory.

Duplicates as in “darktable-duplicate”? Can you take a look at the raw-files and XMPs? Are there always 2 XMPs?

1 Like

I’ll have to look into that. I was unaware of backups. I’m sure whatever happened was something I messed up on. I’ll look into it. hopefully this is the solution.

Only if no XMPs were created when the duplicates were created.

this could have been what happened. I was in a bit of a hurry when i tried to import the new photos, and I’ve been pretty scatter-brained lately. too many things need to be done, so it’s hard to focus on the things I want to get done. I posted about a potential corrupted file a few weeks back, and still haven’t gotten around to troubleshooting that. I move a lot of old jpegs to be with where I’m storing all my current pictures and still need to sort through them, especially since some of them are somehow duplicated. I’m trying to make space on one of my drives so I can hopefully switch to dual-booting linux… on top of house projects, kids, yard, pets, etc.

Sorry for the rant. Everyone here is so helpful, so I feel bad when I can’t get around to using the advice y’all give.

I had to collate all my digital images from many years and many different devices into a single collection. With 20+ years of images from camera and scanners I got DT to copy and import and place the images into folder structure based on capture time. This created a collection with year folders which were then divided in month and finally individual days. It took time but I was able to go through each day folder and deleted all duplicates.

DT allowed me to finally create a system that would organise my images once and for all.

It results in a very organised way to find my photos. I just have to remeber what year I took them.
image

1 Like

I ended up deleting the library.db and am in the process of deleting the duplicates. Thanks for the advice.

1 Like

your system is very similar to how I’ve been organizing things. I have folders for each year, inside those are folders for each quarter of the year, then in those are folders titled with the date and place/subject that contain the actual photos. Thankfully most of my collection started in 2024, with some oddballs from 2016 when I first bought my camera.