Skip to content

Instantly share code, notes, and snippets.

Last active Jul 19, 2021
What would you like to do?
Migration script
;;; PLEASE USE M-x org-roam-migrate-wizard, FOUND WITHIN THE ORG-ROAM REPO ITSELF.
Copy link

junwei-wang commented May 14, 2021

Bugs when "#+roam_alias" exists:

$ git diff                
diff --git a/roam/ b/roam/
index 1f07744..9155df8 100644
--- a/roam/
+++ b/roam/
@@ -1,8 +1,11 @@
+:ID:       c20ceaae-7d3d-4f06-83a6-ba149b98f53f
+:ROAM_ALIASES: "Secure Hash Algorithm 2"
 #+CREATED: [2021-04-23 Fri 22:06]
-#+LAST_MODIFIED: [2021-04-24 Sat 20:29]
-#+ROAM_ALIAS: "Secure Hash Algorithm 2"
-#+ROAM_TAGS: crypto hash
+#+LAST_MODIFIED: [2021-05-14 Fri 14:18]
+#+ROAM_ALIAS:#+FILETAGS: crypto hash

 * Overview

Copy link

junwei-wang commented May 14, 2021

I know org-roam-bibtex does not support v2 yet, but there is also a small bug in your migration script, for example

diff --git a/roam/biblio/ b/roam/biblio/
index ece11a4..6e035e4 100644
--- a/roam/biblio/
+++ b/roam/biblio/
@@ -1,7 +1,10 @@
+:ID:       3c8b23c9-1942-45d6-b1a1-ee66d24a98a6
 #+TITLE: 2011 - [AC:BCGHKR11] - Program obfuscation with leaky hardware -- Bitansky, Canetti, Goldwasser, Halevi, Kalai, Rothblum
 #+CREATED: [2021-01-21 Thu 17:37]
-#+LAST_MODIFIED: [2021-01-21 Thu 17:37]
-#+ROAM_TAGS: paper crypto obfuscation
+#+LAST_MODIFIED: [2021-05-14 Fri 14:17]
+#+FILETAGS: paper crypto obfuscation
 #+PROPERTY: authors Bitansky, N., Canetti, R., Goldwasser, S., Halevi, S., Kalai, Y. T., & Rothblum, G. N.

Copy link

yosevu commented Jun 14, 2021

M-x-evaluate-buffer should be M-x eval-buffer.

Copy link

JonathanReeve commented Jul 5, 2021

Correct me if I'm wrong, but this won't work, since org-roam-db-sync appears to be a v2 function, and other functions, like org-roam--list-all-files are v1. Unless I'm missing something?

Copy link

rodelrod commented Jul 10, 2021

@JonathanReeve: to make it work, I've ran step 1 in V1 and then steps 2 and 3 in V2.
Then I had to fix all of the files with ROAM_ALIASES by hand because they were borked. I didn't have many so I did it manually.
It was transforming something like:

#+title: PostgreSQL
#+created: [2020-04-03 17:22]
#+roam_alias: Postgres
- related :: [[][Databases]]

into something similar to:

:ID:       b6d673e3-d117-4bbe-806c-817effcb6050
:ROAM_ALIASES: [[][Databases]]
#+title: PostgreSQL
#+created: [2020-04-03 17:22]

Same thing with ROAM_KEY/ ROAM_REFS.

Copy link

rodelrod commented Jul 10, 2021

M-x-evaluate-buffer should be M-x eval-buffer.


Copy link

liebkne commented Jul 14, 2021

When I eval step 1, I got user-error: Before first headline at position 1 in buffer Any idea?

Copy link

japhir commented Jul 19, 2021

I get some errors with titles that use entities, such as \delta or \endash.

Here's the error message I get:

Debugger entered--Lisp error: (error "Invalid use of ‘\\’ in replacement text")
  vulpea-buffer-prop-set("title" "dosSantos2010: Glacial\\textendash interglacial var...")
  vulpea-buffer-title-set("dosSantos2010: Glacial\\textendash interglacial var...")
  (save-current-buffer (set-buffer (find-file f)) (message "migrating %s" f) (vulpea-migrate-buffer))
  (with-current-buffer (find-file f) (message "migrating %s" f) (vulpea-migrate-buffer))
  (while --dolist-tail-- (setq f (car --dolist-tail--)) (with-current-buffer (find-file f) (message "migrating %s" f) (vulpea-migrate-buffer)) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (let ((--dolist-tail-- (org-roam--list-all-files)) f) (while --dolist-tail-- (setq f (car --dolist-tail--)) (with-current-buffer (find-file f) (message "migrating %s" f) (vulpea-migrate-buffer)) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (dolist (f (org-roam--list-all-files)) (with-current-buffer (find-file f) (message "migrating %s" f) (vulpea-migrate-buffer)))
  eval-expression((vulpea-migrate-db) nil nil 127)
  funcall-interactively(eval-expression (vulpea-migrate-db) nil nil 127)

Copy link

japhir commented Jul 19, 2021

(if I just replace the offending entity with the corresponding utf-8 symbol and run it again, it appears to continue nicely).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment