# Doom Emacs : how to upgrade org-roam

**URL:** <https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764>\
**Category:** Troubleshooting\
**Created:** [September 16, 2020, 7:00pm UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764 "2020-09-16T19:00:32Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![efim](https://avatars.discourse-cdn.com/v4/letter/e/e9a140/32.png) [@efim](https://org-roam.discourse.group/u/efim)\
**Post date:** [September 16, 2020, 7:00pm UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/1 "2020-09-16T19:00:32Z")

</div>

What should I do to update org-roam from my Doom Emacs setup?  
I’m struggling with the bug, solution for which is already merged to org-roam master

Running `.emacs/bin/doom upgrade` didn’t work  
I guess that’s because org-roam wasn’t upgraded in doom repo

Can I somehow set org-roam to be downloaded from it’s own repo?

---

<div class="post-metadata">

**Author:** ![mshevchuk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mshevchuk](https://org-roam.discourse.group/u/mshevchuk)\
**Post date:** [September 16, 2020, 9:07pm UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/2 "2020-09-16T21:07:49Z")

</div>

In `$DOOMDIR/packages.el` unpin `org-roam`:

```auto
(unpin! org-roam company-org-roam)

```

Exit Emacs, run `doom sync && doom upgrade`

---

<div class="post-metadata">

**Author:** ![yubrshen](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/yubrshen/32/367_2.png) [@yubrshen](https://org-roam.discourse.group/u/yubrshen)\
**Post date:** [September 18, 2020, 8:18pm UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/3 "2020-09-18T20:18:26Z")

</div>

> [@mshevchuk](#):
>
> `(unpin! org-roam company-org-roam)`

Related to this, should I enable the +roam plugging in $DOOMDIR/packages.el?  
Currently, I have the following:  
In `$DOOMDIR/packages.el`:  
(unpin! org-roam company-org-roam)  
(package! org-roam  
:recipe (:host github :repo “jethrokuan/org-roam” :branch “develop”)  
)  
and in `$DOOMDIR/init.el`:  
(org ; organize your plain life in plain text  
+journal  
+jupyter  
+noter  
+pandoc  
+present  
;; +pretty ; expensive!  
+roam)

Is there any improvement to make for the above configuration ?

---

<div class="post-metadata">

**Author:** ![mshevchuk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mshevchuk](https://org-roam.discourse.group/u/mshevchuk)\
**Post date:** [September 19, 2020, 8:40am UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/4 "2020-09-19T08:40:32Z")

</div>

> [@yubrshen](#):
>
> Related to this, should I enable the +roam plugging in $DOOMDIR/packages.el?

It’s up to you. The `+roam` flag adds some keybindings and a few other things. If you decide to use it, then you should remove `package! org-roam`. You also should not use `use-package! org-roam`, put your config in an `after!` form.

The following examples can be used interchangeably but not simultaneously!

```elisp
;; packages.el
(unpin! org-roam company-org-roam)

;; init.el
;; use the +roam flag
(org +journal ... +roam)

;; config.el
;; configure Org Roam with after!
(after! org-roam 
  (setq org-roam-...))

```

or

```elisp
;; packages.el 
;; Use master branch from org-roam/org-roam repository
;; instead of obsolete jethrokuan/org-roam repository! 
;; You don't need to unpin anything
(package! org-roam
  :recipe (:host github :repo “org-roam/org-roam” :branch “master”))
(package! company-org-roam
  :recipe (:host github :repo “org-roam/company-org-roam” :branch “master”))

;; init.el
(org +journal ...) ;; don't use the +roam flag!

;; config.el
;; configure Org Roam with use-package!
(use-package! org-roam
  :defer t
  :hook ...
  :config
  (setq org-roam-...))

(use-package! company-org-roam
  :defer t
  ...
  :config
  (setq ...))

```

It’s probably more convenient to use the first example with the `+roam` flag.

---

<div class="post-metadata">

**Author:** ![yubrshen](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/yubrshen/32/367_2.png) [@yubrshen](https://org-roam.discourse.group/u/yubrshen)\
**Post date:** [September 19, 2020, 2:01pm UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/5 "2020-09-19T14:01:29Z")

</div>

> [@mshevchuk](#):
>
> `unpin! `

Thanks for the detailed help.  
By the context and web search, it seems that the semantics of unpin! is to use the latest development version of the package?

So  
`(unpin! org-roam company-org-roam)`  
is already equivalent to  
(package! org-roam  
:recipe (:host github :repo “org-roam/org-roam” :branch “master”))  
(package! company-org-roam  
:recipe (:host github :repo “org-roam/company-org-roam” :branch “master”))

?

---

<div class="post-metadata">

**Author:** ![bruce](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@bruce](https://org-roam.discourse.group/u/bruce)\
**Post date:** [September 19, 2020, 4:27pm UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/6 "2020-09-19T16:27:16Z")

</div>

You use unpin for a package that you load via a module, which always pins specific versions.

Since org-roam is part of a module …

---

<div class="post-metadata">

**Author:** ![mshevchuk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mshevchuk](https://org-roam.discourse.group/u/mshevchuk)\
**Post date:** [September 19, 2020, 7:44pm UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/7 "2020-09-19T19:44:08Z")

</div>

> [@yubrshen](#):
>
> So  
> `(unpin! org-roam company-org-roam)`  
> is already equivalent to  
> (package! org-roam

No, it is not. It may give you the same result in this particular case, but this two macro do very different things and they are not equivalent nor interchangeable.

To use a package in Doom, you must must first declare this intent by writing the declaration `(package! ...)`. There are a lot of different initialization files in Doom called `modules` that do this for you. You can inspect these files yourself and learn what they are doing. The modules, besides declaring the recipe and initializing and configuring the package with `use-package!`, also typically pin the package to a specific commit.

You can load all these pre-installed configuration files just by putting something like

```elisp
:lang
module-name
:tools
(another-module-name +with-flag)

```

into your `init.el`. The above means that your Emacs instance will execute

```elisp
(package! package1 
  :pin commit
  :recipe ...)

(use-package! package1 
...)

```

You can `unpin!` the package then in your `config!` file.

Instead of using the module, you are free to configure the package yourself by using `package!` and `use-package!`

---

<div class="post-metadata">

**Author:** ![yubrshen](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/yubrshen/32/367_2.png) [@yubrshen](https://org-roam.discourse.group/u/yubrshen)\
**Post date:** [September 20, 2020, 1:42pm UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/8 "2020-09-20T13:42:09Z")

</div>

Thanks for the detailed explanation.

So in my context of wishing to try the latest released features of org-roam, while still taking advantage of the configuration of Doom’s configuration to org-roam, so I should do the following:

1. Declare my interest in using Doom’s installation receipt and configuration for org-roam at init.el
2. But in package.el do` (unpin org-roam company-org-roam)` and add the installation receipts of

> (package! org-roam-server :recipe (:host github :repo “org-roam/org-roam-server” :files (“\*”)))  
> (package! company-org-roam :recipe (:host github :repo “org-roam/company-org-roam”))

1. Do nothing special in terms of `(use-package! org-roam ...)` and `(use-packages! company-org-roam)`(in order to still using Doom’s configuration for org-roam and company-org-roam)

Is my above understanding more accurate than before?

Thanks again for your help!

---

<div class="post-metadata">

**Author:** ![mshevchuk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mshevchuk](https://org-roam.discourse.group/u/mshevchuk)\
**Post date:** [September 20, 2020, 1:47pm UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/9 "2020-09-20T13:47:21Z")

</div>

NO! You do not need `package! org-roam` because it has already been defined in the module.

Use what I wrote earlier.

> [@mshevchuk](#):
>
> The following examples can be used interchangeably but not simultaneously!
> 
> ```auto
> ;; packages.el
> (unpin! org-roam company-org-roam)
> 
> ;; init.el
> ;; use the +roam flag
> (org +journal ... +roam)
> 
> ;; config.el
> ;; configure Org Roam with after!
> (after! org-roam 
> (setq org-roam-...))
> 
> ```
> 
> or

> [@yubrshen](#):
>
> Thanks again for your help!

Sure, not at all!

---

<div class="post-metadata">

**Author:** ![ctop](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@ctop](https://org-roam.discourse.group/u/ctop)\
**Post date:** [August 2, 2021, 4:30am UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/11 "2021-08-02T04:30:16Z")

</div>

I know this is an old thread, but since I am using doom, I followed the advice here and (after a few hours…) seem to have succeeded in getting emacs and doom to the latest version and org-roam to the master branch.  
I am using the second method:

```auto
(package! org-roam
  :recipe (:host github :repo “org-roam/org-roam” :branch “master”))
(package! company-org-roam
  :recipe (:host github :repo “org-roam/company-org-roam” :branch “master”))

;; init.el
(org +journal ...) ;; don't use the +roam flag!

;; config.el
;; configure Org Roam with use-package!

```

Since my previous config for v1 of roam did not have any entries in config.el, I did not add anything here either. However, now I am missing the doom integration and the keystrokes to find and add roam notes. What do I have to do to get this back?

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [August 2, 2021, 5:47am UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/12 "2021-08-02T05:47:19Z")

</div>

I suggest you might like to try the new +roam2 flag instead, perhaps?

Also…

> [@ctop](#):
>
> `company-org-roam`

company-org-roam has long been deprecated. I would remove it from package.el.

---

<div class="post-metadata">

**Author:** ![ctop](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@ctop](https://org-roam.discourse.group/u/ctop)\
**Post date:** [August 2, 2021, 6:44am UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/13 "2021-08-02T06:44:09Z")

</div>

Thanks, great suggestion. Switched to +roam2 and am a happy camper now.

---

<div class="post-metadata">

**Author:** ![Sub](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Sub](https://org-roam.discourse.group/u/Sub)\
**Post date:** [October 26, 2021, 3:34pm UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/14 "2021-10-26T15:34:10Z")

</div>

I’m eager to migrate to v2 using Doom Emacs, but I’m not getting any of the above to work. I don’t know if things have changed since this thread went quiet, but nothing I see here upgrades my org-roam to v2. I’m still org-roam-version = 1.2.3 after trying all versions of the above. I can’t locate any suggestions that work for me in the Doom Emacs discord server, but things have gone pretty quiet there re: org-roam v2. I’ve tried a couple of Doom Emacs config.el/packages.el/init.el combinations I’ve found shared on GitHub. No dice. Has anyone here successfully migrated to org-roam v2 using Doom Emacs recently who could share their method?

---

<div class="post-metadata">

**Author:** ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://org-roam.discourse.group/u/roi.holtzman)\
**Post date:** [November 20, 2021, 8:01am UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/15 "2021-11-20T08:01:34Z")

</div>

I have spent much time yesterday on migrating to V2.  
I still have some issues which I am not sure how to fix, but most things work now.

Let me try to list here some issues I had. I am running on a Mac, and I use doom emacs.  
To update I followed the steps in [here](https://github.com/hlissner/doom-emacs/blob/develop/modules/lang/org/README.org#migrating-your-existing-files-from-v1-roam-to-v2-roam2).

# Installation stuff

I had an issue with sql not working. The problem was that my c-compiler was not working properly. I solved it by updating it. Then, even after updating it, the migration would not work, and the reason was that a backup folder (named `org-roam-directory`.bak) was already created which stopped the migration from working. It would be nice if there would be a warning telling this. So I removed the `bak` folder, and run the migration again, and the script ran fine.

# Configuration stuff

Here I have the most issues.  
Running on `doom` I think that one should use `(after! org-roam ...)` to config stuff, but that did not work for me. I had to use `(use-package! org-roam... )` instead. I am not sure what is the effect of this, but now the configuration is loaded.  
I had to define all of the keybinding myself, and it took me some time.  
I had to modify the `capture-templates` to work well with V2. That also took some time. To do it successfully I followed the default value of the variable ` org-roam-capture-templates`.

The org-roam-buffer is different on V2. I still could not make it work as I want. I would like to press `RET` on a link in the org-roam-buffer and that it would open the relevant note in the “main” buffer.  
I am not sure how to accomplish that.  
Moreover, I would like to modify the styling of the org-roam-buffer. Right now, the titles of the notes are not emphasized enough and it is hard to read.

Other than that, I was using before `org-roam-server` to view my graph.  
Now I installed `org-roam-ui` and it went smoothly!  
The only issue I have is that labels in my equations (i.e. `\label{eq:1}` in an equation environment) are also shown in the html rendering of the note. I opened an issue on that [here](https://github.com/rasendubi/uniorg/issues/21).

I hope this helps.

BTW, my config for org-roam v2 can be found [here](https://org-roam.discourse.group/t/the-org-roam-v2-great-migration/1505/81).

---

<div class="post-metadata">

**Author:** ![Sub](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Sub](https://org-roam.discourse.group/u/Sub)\
**Post date:** [November 21, 2021, 8:36pm UTC](https://org-roam.discourse.group/t/doom-emacs-how-to-upgrade-org-roam/764/16 "2021-11-21T20:36:30Z")

</div>

Thank you, rio.holtzman. It did help. I was encouraged by your reply and success upgrading to v2 in Doom Emacs to give it another try.  
While flailing around unsuccessfully again for a while, it dawned on me that I had not updated Doom Emacs for, let’s just say, too long (Hear the sound of egg splattering across my face?). So I did, and, lo, a lot of things work better now. Including being able to upgrade to org-roam v2.  
I was also inspired by your success with org-roam-ui, which I’ve installed and love. I liked org-roam-server, and ouri seems like progress.  
Moral of my story: “Never upgrade anything important,” a policy I adopted as a former Windows user, isn’t always the right approach.
