The Org-roam v2 Great Migration

I’ve attempted to update roam to V2 using this guide ( Hitchhiker's Rough Guide to Org roam V2 · org-roam/org-roam Wiki · GitHub )

I’m using Doom emacs on Linux (NixOS),
the branch got installed successfuly, I think, but there is a problem with EmacSQL

When I try any new roam command (e.g org-roam-doctor )
I get error message
“emacsql-sqlite-ensure-binary: No EmacSQL SQLite binary available, aborting”
the list-packages seem to include “emacsql” and 4 backends (by default on Doom Emacs?)
but I still don’t have the binary?

For some reason I could only find questions about ‘emacsql-sqlite’ about Windows systems

Should binary have already been compiled during the package installation?

I do have “sqlite3” installed and available

λ (executable-find “sqlite3”)

How could I further troubleshoot this?
Does the error even refer to “emacsql-sqlite” binary?

My answer:
I could find lisp funcion in SPC h f “emacsql-sqlite-compile”

Trying to call it in eshell with I got Message “missing C compiler”
So I added “gcc” to available packages

And it seems that evoking (emacsql-sqlite-compile) fixed the problem
also documentaion said that the binary compilation is attempted at first use,
so I could have missed the message about lacking C compiler, or maybe there was no warning

1 Like

@efim this is hot from the press. You might like to engage in this other thread about compiling

Hi everyone! I’m having some difficulties with the setup of Org-roam v2 in a vanilla Emacs configuration in Ubuntu 20.04, following the Hitchhiker’s Rough Guide to Org roam V2. Briefly, here’s what I did:

  1. Cloned the v2 branch of the org-roam repo to a local folder;
  2. Installed magit 2.90.1 from melpa-stable through the package manager (the package includes magit-section which is apparently required by Org-roam v2);
  3. Commented out the Org-roam v1 lines in my Emacs init file;
  4. Added to the init file the configuration lines from the Hitchhiker’s Rough Guide.

After that and restarting Emacs I got the initialization error ‘Symbol’s value as variable is void: magit-section-mode-map’. Please find attached a picture of my configuration file.

I’m relatively new to Emacs and Git so I might be missing something obvious. If you could point out what that is I would be most grateful!

The vanilla set up in the Rough Guide is from me; I don’t have the same issue.
Two suggestions:

  • add (load-library "magit-section") just before where you load org-roam
    I don’t do this but this should remove the erorr message you reported.
  • (temporarily) add (toggle-debug-on-error) at the beginning of your init file, relaunch, and get the error stack – this would help debugging the problem

Hi Nobiot. Thanks for the suggestions. I tried load-library to no avail. Does that require adding the path to the magit-section library to the load-path list?

As said, I installed magit through the package manager so I thought that the package would be autoloaded by Emacs (if I start Emacs and type M-x magit-version RET I correctly get the version info from Emacs).

Supposing the above assumption is wrong, I tried adding (require 'magit-section) before loading org-roam but I still get the same error. You can find attached the screenshot of the debugger.

@FilTower, I can only think that magit-section is not in your system. I just checked MELPA-stable, and it appears magit does not depend on magit-section — this means that these need to be separately installed via package-list-package or package-install. I am assuming you mean one of these when you say “package manager”.

@nobiot Thanks again for your reply. Yes, I meant package-install. Weird, with that command I installed magit from melpa-stable and I could see that magit-section is installed as a dependency in the list of packages in Emacs. Magit and magit-section also appear in my ~/,emac.d directory. I’ll try again by removing and installing magit one more time.

Hmmm. Strange. Maybe you could try require as in (require ’magic-section) instead of loa-library—there might be difference between the two that I don’t know that causes your issue. I do neither and mine works so it’s weird.

Okay, I found the problem. If you install magit-section from melpa-stable that package requires magit-utils so it does not compile correctly unless you have magit already installed. So, you need to first install magit and then magit-section if using melpa-stable.

However, if you use just melpa the installation of magit-section runs smootly and the error goes away.

Thanks Nobiot for your help!

1 Like


Please find the error in step 3 in my transition.

Hi! I’m new to Org-roam. I want to install v2, but if I follow the instructions:

(use-package org-roam
  (org-roam-directory "/my-path-to/org-roam")
  :bind (("C-c n l" . org-roam-buffer-toggle)
         ("C-c n f" . org-roam-node-find))

However, if do M-x org-roam-version' I get 1.2.3rather than 2, so I guess I haven't installed the new version with the major redesign? (even thought the package installed has date20210513`). If so, what’s the best approach to installing it? Cloning the git repo?

By the way, in *Warnings* I get Error (use-package): org-roam/:config: Symbol’s function definition is void: org-roam-setup

Thanks for your help!

PS: Sorry, another question. Is there an intro to the v2 version of Org-roam? The manual at Org-roam User Manual is for v1.2.3… but I don’t know, maybe it is still good to go with v2?

Sorry for the bother!! I’ve just found the answer to all my queries!!!

1 Like

I set up org-roam v2.

When I capture something, the node created does not get automatically an id, after hitting C-c C-c. Is it normal ? In order to have org-roam register the new node, I need to capture again.

Also, if I invoke org-roam-db-sync, it does not seem to work, I only get the meaningless message Selected deleted buffer

Are you using the org-roam-capture-tempates?

Something like

(use-package! org-roam
  :after org
  (setq org-roam-capture-templates
      '(("d" "default" plain "%?"
         (file+head "${slug}.org"
                    "#+title: ${title}\n")
         :immediate-finish t
         :jump-to-captured t
         :unnarrowed t))))

Does someone know how to disable centaur-tabs in org-roam-buffer-toggle? org-roam used to have a org-roam-buffer-prepare-hook in which one could do

(add-hook 'org-roam-buffer-prepare-hook #'centaur-tabs-local-mode)

but that seems to be gone now. There’s an org-roam-buffer--post-command-h but it doesn’t seem to do what I need. The problem is that even if I deactivate the tabs manually, they’ll just show back up when I switch to a different buffer as the roam-buffer gets updated.

@sva You can try using org-roam-mode-hook, now that the buffer has its own dedicated mode.

1 Like

This suggests to me your schema is still old. Are you sure you’re running the code with Org-roam v2 loaded?

I just migrated to v2. I understand that a node (a headline) is the most basic element in the v2 database.
When I create a new node using org-roam-node-find, the default capture template does something like this:

:ID: efc1f9c5-4cc3-486d-b7ee-440e7ed31f8f
#+title: Some title

Instead of creating a heading, it creates a title (like v1), and adds the ID thing on top. Is this legit org syntax? I thought file-level properties were mentioned using #+properties:.

I am able to find the file using the node-find command and the migration script made all of my old files exactly like this so I guess this is how it is?

I’m a little confused. Org syntax is a little messy, I think.

It is. File-level property drawers are a thing.

Wow, you never know with Org, haha. I’m still learning new stuff. Why can’t I find this in the Org manual? (Property Syntax (The Org Manual))
I gotta say, it looks grotesquely weird though.