Merging Tags in Darktable

Hi everyone

I have been using Darktable sporadically for a while now since I decided not to pay for Lightroom anymore. Now I just noticed that some of the tags are duplicated. Back in Lightroom I organized the people tags like this

Person 
    John Smith
    Jane Smith
    ...

Now in Darktable, I seem to have every single person twice. Once in the Person category, and once without category.

John Smith
Jane Smith
Person
    John Smith
    Jane Smith

Since I didn’t notice this from the beginning, those tags are now diverged. So I can not just delete all person tags not in the person category. Is there a way I can merge them? When I try to move the John Smith tag into the Person category I get the message: “at least one new tagname (Person|John Smith) already exists, aborting.”


After writing this, I found the “rename-tags” script in Darktable, which allows you to merge two tags. But since I have around one hundred person tags, this will take a while.

I guess the reason is that Lightroom saves tags in several xmp fields (e.g hierarchical keywords and keywords … and so DT imports them twice. I don’t know if you are familiar with exiftool but I would recommend to inspect the xmp files from Lightroom, clean up the fields (just leave the hierarchical keywords) and import the images in DT again. Make sure you have a recent backup before you start.

Once imported I suggest to delete all *.xmp files from Lightroom or to move them to another folder. DT will only use them during the initial import and create its own img.rawext.xmp files.

1 Like

I suggest to use Digikam to manage these kind of things. It’s more easy to manage lot of information. You can write the metadata in the sidecar file, and as soon as you reopen the image in darktable they will be fixed as well.

1 Like