Losing file metadata when importing any file into DEVONthink database

Using DEVONthink 3 for a while, I noticed that metadata attributes are discarded after importing any file into the DEVONthink database. For example, I created a pdf file on my desktop then imported the file into the DEVONthink Inbox. Notice how the desktop pdf file contains more attributes in the “More Info” section. In contrast, the pdf file in the DEVONthink database does not contain the attributes.


I can further confirm this using the mdls command in the Terminal. Executing mdls on the desktop pdf file returns:

_kMDItemDisplay> NameWithExtensions = “Doc.pdf”
kMDItemAlternateNames = (
“Doc.pdf”
)
kMDItemContentCreationDate = 2020-09-25 02:16:00 +0000
kMDItemContentCreationDate_Ranking = 2020-09-25 00:00:00 +0000
kMDItemContentModificationDate = 2020-09-25 02:16:00 +0000
kMDItemContentModificationDate_Ranking = 2020-09-25 00:00:00 +0000
kMDItemContentType = “com.adobe.pdf”
kMDItemContentTypeTree = (
“com.adobe.pdf”,
“public.data”,
“public.item”,
“public.composite-content”,
“public.content”
)
kMDItemCreator = “Word”
kMDItemDateAdded = 2020-09-25 02:16:00 +0000
kMDItemDateAdded_Ranking = 2020-09-25 00:00:00 +0000
kMDItemDisplayName = “Doc”
kMDItemDocumentIdentifier = 0
kMDItemEncodingApplications = (
“macOS Version 10.15.6 (Build 19G2021) Quartz PDFContext”
)
kMDItemFSContentChangeDate = 2020-09-25 02:16:00 +0000
kMDItemFSCreationDate = 2020-09-25 02:16:00 +0000
kMDItemFSCreatorCode = “”
kMDItemFSFinderFlags = *
kMDItemFSHasCustomIcon = (null)
kMDItemFSInvisible = 0
kMDItemFSIsExtensionHidden = 1
kMDItemFSIsStationery = (null)
kMDItemFSLabel = *
kMDItemFSName = “Doc.pdf”
kMDItemFSNodeCount = *
kMDItemFSOwnerGroupID = *
kMDItemFSOwnerUserID = *
kMDItemFSSize = 11646
kMDItemFSTypeCode = “”
kMDItemInterestingDate_Ranking = 2020-09-25 00:00:00 +0000
kMDItemKind = “PDF document”
kMDItemLogicalSize = 11646
kMDItemNumberOfPages = 1
kMDItemPageHeight = 792
kMDItemPageWidth = 612
kMDItemPhysicalSize = 12288
kMDItemSecurityMethod = “None”
kMDItemTitle = “Microsoft Word - Document4”
kMDItemVersion = “1.3”

While the pdf in the DEVONthink database returns:

kMDItemFSContentChangeDate = 2020-09-25 02:16:00 +0000
kMDItemFSCreationDate = 2020-09-25 02:16:00 +0000
kMDItemFSCreatorCode = “”
kMDItemFSFinderFlags = *
kMDItemFSHasCustomIcon = 0
kMDItemFSInvisible = 0
kMDItemFSIsExtensionHidden = 1
kMDItemFSIsStationery = 0
kMDItemFSLabel = *
kMDItemFSName = “Doc.pdf”
kMDItemFSNodeCount = *
kMDItemFSOwnerGroupID = *
kMDItemFSOwnerUserID = *
kMDItemFSSize = 11646
kMDItemFSTypeCode = “”

(some values replaced with ‘*’)

I think this is a bug since DEVONthink claims to preserve files (allowing users to recover files from a DEVONthink database) after adding them into a DEVONthink database. The checksums (md5, sha1 etc.) of the two files are the same.

Edit 1: Fixed formatting issues.

I noticed that too, however the metadata is not gone, seems it only can’t be read (completely) when a file is inside a database package. Just exported a PDF from a database and outside it shows a lot more metadata with mdls. So it’s there.

@pete31 is correct. Spotlight doesn’t index inside package files and the files inside the database aren’t searchable via Spotlight. (There are separate metadata files exported for Spotlight, if you are using the Spotlight option per-database.)