I am syncing my org-roam files between two computers with Nextcloud. In one computer, I execute org-roam-db-build-cache and it seems to work right but in the other computer I get a bunch of “Duplicate IDs in file.org” error, for example:
Error (org-roam): Duplicate IDs in /home/user/Nextcloud/Apps/org/notes/emacs.org, one of:
92b14ab3-8af6-4e5d-9370-63ba34603fa1
ae0b3645-13d4-4443-997d-18d20af68795
I thought it would be better to sync the org-roam.db file… is it automatically re-generated in every boot of emacs? If I use emacs daemon in a PC running for days, should I run org-roam-db-build-cache to update the database file from changes from the another PC that have been synced?
Although it is not exactly org-roam, should I sync orgidfile?
No, he is saying that you should keep it out of your dropbox/googledrive/onedrive/syncthing/git folder. Keep it somewhere that is just local to a single machine.
The expensive build is done once when you activate org-roam the first time (when you install it), and the database is updated incrementally whenever you save a file.
I have my db file locally on my machine (not syncing with anything).
In my case, the problem occurred when I was creating a note, and my emacs was lagging. I had to abort using C-g. Then I created the note again, and got the “duplicate id” error.
I solved it (I think) by doing what was suggested above: