Hrothgar32 / logseq-import-org-roam

A script which let's you import your Org-roam notes and journals into Logseq.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logseq Org-Roam importer

What is this?

This is a little Python script which let’s you import your org-roam notes and daily journals into Logseq.

Prerequisites

You should update your Logseq config file (which is located in: /Logseq graph root folder/logseq/config.edn) to match the following settings:

{
 :preferred-format Org
 :preferred-workflow :todo
 :org-mode/insert-file-link? true
 :date-formatter "yyyy-MM-dd"
 }

This ensures that Logseq treats your files and backlinks properly. You should also have SQLite as an Org-Roam database, but most probably you have, since that is the default.

I’ve written this script with Linux in mind, because it relies on sed.

How to run it

The scripts needs 3 arguments and has 1 optional argument:

ORG_ROAM_DB_PATH

The path to the SQLite file which is Org-roams database. You can easily get it’s value if you search for the org-roam-db-location variable in Emacs:

(print org-roam-db-location)

ORG_ROAM_NOTES_PATH

The path to the directory where org-roam captures its notes by default. You can get it’s value with the org-roam-directory Emacs variable.

(print org-roam-directory)

LOGSEQ_DIR_PATH

The directory which you chose as local directory when you first entered Logseq.

ORG_ROAM_DAILIES_PATH (optional)

If you want to also import your daily org-roam files as Logseq journal files, you need to also give this argument to the script.

You need the value of the org-roam-dailies-directory variable, but the dailies folder is usually the folder located in the org-roam-directory with the name daily

Run the command

chmod +x script.py

./script.py ORG_ROAM_DB_PATH ORG_ROAM_NOTES_PATH LOGSEQ_DIR_PATH (ORG_ROAM_DAILIES_PATH)

About

A script which let's you import your Org-roam notes and journals into Logseq.


Languages

Language:Python 100.0%