Skip to main content

logseq-migration

Download and use local copies of assets in logseq after importing a file from roam.

NB: Users have reported problems running this on Windows. I have been unable to reproduce the problem, so I cannot fixit. The software should run on any model of a Raspberry Pi so Windows users with a Pi could install and run the software there.

Roam stores the assets (images, pdfs, mp4 files etc.) in the cloud.

While logseq makes it easy for you to import a roam json export, your assets will remain in the cloud.

That worries me, because

  1. I want to store all the data that I own in my local file system.
  2. I want to be able to view my pages even if I am not connected to the Internet.
  3. The assets could disappear if roam research ceased trading or changed its policy about closed accounts.

So I adapted the code from here to suit logseq instead of Obsidian, wrote some minimal tests and refactored the code.

It's currently beta software

It's had limited testing, but it worked for me on a graph with about 1800 nodes.

Once installed, you can run the code each time you want to process a recently imported roam graph.

Since the program messes with the markdown in your pages (in order to make asset links local),

back up your graph before you run this code!

The application is easy to install and run. You'll find instructions below.

Installation

Install required software

Python 3

The code is written in Python, and you will need an installed copy of Python3.8 or later.

If you don't already have a suitable copy of Python installed, you'll find installation instructions here.

Under Windows, it appears that you must install Python system-wide (with script wrappers) and ask for Python to be added to your PATH.

pip3

pip is Python's package manager. You'll need pip3, the version that supports Python3.

This is normally installed with Python3. If it isn't for some reason you can follow these instructions.

Install the application

run pip3 install logseq-migration

Run the application

run localise_assets <vault_dir>

where vault_dir is the directory in which your logseq graph lives.

You'll see version information printed, and the word done when the migration is complete

The migrator will create a logfile called migration.log. By default, this will only log the start and end of the migration, with any errors.

If you wish to see detailed debug information, run localise_assets <vault_dir> 1

The code is idempotent. In other words, if you run it two or more times, nothing should change after the first run.

Let me know how you get on, and please raise an issue if there are problems, or you want to suggest new features.

There's a roadmap and a project journal. If you're interested in contributing, get in touch. Help is always welcome!

I'm @rareblog on Twitter.

Metadata

Release files for logseq-migration 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for logseq-migration 0.3.1
File Size Uploaded
logseq-migration-0.3.1.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for logseq-migration 0.3.1
File Interpreter ABI Platform
logseq_migration-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / logseq-migration-0.3.1.tar.gz

Download URL logseq-migration-0.3.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
01659c914a02e374217b0ae05d7a1ed7cd625efef8897580f579f823535be57f
BLAKE2b-256 checksum
How to use checksums
d8906725eb1d05770004a93d2a298860f1c137d76e62004270dc97a1ec8feebe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / logseq_migration-0.3.1-py3-none-any.whl

Download URL logseq_migration-0.3.1-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15b8cd97f0a6da1b95294e1ab99063ed2b4aba8c5f809fc783101c0d208e4c6e
BLAKE2b-256 checksum
How to use checksums
2870128b5f87507f5fc57073bd6eced347075cfeeaaee5d3b2f8a0a3d0ed169e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3

2 release files

0.2

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page