Does rebuilding a database preserve group and item UUIDs?

I ask because I have many links in other apps (including Freeplane, etc.) and want to rebuild my notes database as not all Markdown front-matter key/value pairs are detected. For example, I have hundreds of notes with ‘notetype: meeting’ in their front-matter, and only about half of them show up when I search for “notetype: meeting”

I just did a quick experiment, creating an “Experiment” database with two text files named “Note 1” and “Note 2”, copied IDs for the DB, Inbox, Note 1 and Note 2, and then rebuilt the DB. Then copied IDs again and compared. Results are as follows:

BEFORE REBUILD
DB x-devonthink-item://BFFE134A-347D-4B71-A755-5523DFD09398
Inbox x-devonthink-item://AA2E63CE-6EBF-4A38-AA04-8F043F346E9B
Note 1 x-devonthink-item://B72192B5-B544-45CB-ACD1-6D7C8A98805B
Note 2 x-devonthink-item://A37D5A05-829B-4CAE-88D9-346348DEB2D3

AFTER REBUILD
DB x-devonthink-item://BFFE134A-347D-4B71-A755-5523DFD09398
Inbox x-devonthink-item://8BF1638A-B43E-4047-AA8B-FD724AB647A2 <---- CHANGED
Note 1 x-devonthink-item://B72192B5-B544-45CB-ACD1-6D7C8A98805B
Note 2 x-devonthink-item://A37D5A05-829B-4CAE-88D9-346348DEB2D3

Interesting to note that the Inbox UUID changed. Good to know as I have some macros that create notes and send them to specific databases’ inboxes using their UUIDs.

I believe the JSON metadata export includes UUID’s for every group, tag, and document. Excel will read JSON, I believe, and there are many other ways to handle JSON data.

  • Are these older Markdown documents (there are no “notes” in DEVONthink)?
  • Are you using the hidden preference IndexRawMarkdownSource ?

Do you use AppleScript/JXA? Or what kind kind of “macro”?

Yes, I should clarify: I do all of my note-taking using Markdown notes (with templates for a variety of different note types).

Yes, I’m using the hidden preference IndexRawMarkdownSource (which you pointed me to some months ago). It’s been working flawlessly (as far as I can tell), except that when searching for some “notes” (i.e. Markdown files with specific front-matter properties)—searching on particular Markdown front-matter properties— which I knew I had created, I couldn’t find them.

A search for the same “notes” without searching via Markdown front-matter properties found the notes. That was when I realized that all was not entirely well.

I will rebuild the database and see what mileage I get.

I use a set of Keyboard Maestro macros + AppleScript, where I have the UUIDs of various database inboxes hardcoded, so that I can quickly create new Markdown “notes” and send them to the correct database inbox. As the tests above indicate, I will need update the hardcoded Inbox UUIDs in Keyboard Maestro after rebuilding databases.

It would be nice if Inbox UUIDs could be preserved during a database rebuild to avoid having to manually update IDs after a DB rebuild.

I would suggest to use the incoming group property of databases instead of using UUIDs.

2 Likes

Thanks Christian :+1: