How have people handled org-oam installations running across multiple machines?
With plain old org-mode I’ve had no problem with a directory of .org file, synced across the three machines I use for work and home. But a single shared org-roam directory has turned out to be problematic, as org-roam apparently maintains some kind of file lock on org-roam.db for as long as emacs runs.
If I forget to kill emacs on machine 1, I’ll have an org-roam conflict when I start org-roam on machine 2. My synching mechanism is OneDrive, and the result of a conflict is that I get duplicate copies of org-roam.db with a uniquified name extension. I imagine DropBox, Syncthing, or whatever will have the same problem.
Am I right? Do other people have this problem, and if so, what do you do about it?
Just for all those OneDrive users out there… OneDrive can only exclude entire folders from syncing, not individual files. The solution is to put org-roam.db outside of your OneDrive folder, and to tell org-roam where it is by customizing the variable org-roam-db-location, which should the full path to your org-roam.db file, including the filename.
For Syncthing users, you can create a .stignore file, similar to a .gitignore. I have added the org-roam.db file to it and this fixed my problems when using org-roam across multiple machines.
I am using dropbox to sync, and they don’t allow to exclude single files as well.
I have tried your solution, but apparently I can’t change the variable. When I try to save the changed variable I am getting the following error Symbol's value as variable is void: /path/org-roam\.db.
So I managed to solve this by defining the variable directly in the config file (org-roam-db-location "~/org-roam.db")
@roi.holtzman, I don’t understand that error message but I’m glad you’ve got a solution now. It’s exactly what I do inside of use-package. Here’s the fragment in my .emacs file:
(use-package org-roam
:custom
(org-roam-db-location "~/org-roam.db")
;; other configs
)