darktable is a non-destructive image editor. This means that darktable opens images read-only. Any newly added metadata, tags, and parameters of image operations (the “history stack”) are stored in separate .xmp files, so-called sidecars, allowing you to store information about the images as well as the full editing history without touching the original raw files. When you import an image into darktable for the first time, an XMP file with default settings is generated automatically.
For a given source image, multiple editing versions, called duplicates, can co-exist, sharing the same input (raw) data but each having their own metadata, tags and history stack. Each duplicate is represented by a separate XMP sidecar file with a filename constructed in the form “<basename>_nn.<extension>.xmp”, where nn represents the (minimum two-digit) version number of that edit. Information for the initial edit – the “duplicate” with version number zero – is stored in the sidecar file “<basename>.<extension>.xmp”. The version number of a duplicate is displayed in the image information panel in each of darktable's views (see an example in Section 2.3.5, “Image information”).
Sidecar files automatically synchronize with your work without the need to press a “save” button. When backing up your data, make sure you also keep the XMP files, as these are needed to fully reconstruct your work in case of a disaster.
In addition to the sidecar files, darktable keeps all image-related data in its database for fast access. An image can only be viewed and edited from within darktable if its data is loaded in that database. This automatically happens when you first import an image or at any later time by re-importing it (see Section 2.3.1, “Import”). In the latter case the database gets updated with data that darktable finds in the sidecar files belonging to that image.
Once an image has been imported into darktable the database entries take precedence over the XMP file. Subsequent changes to the XMP file by any other software are not visible to darktable – any changes get overwritten the next time darktable synchronizes the file. This behavior can be changed in the preferences dialog (see Section 8.9, “Storage”). On request darktable looks for updated XMP files at startup and offers a choice whether to update the database or overwrite the XMP file.