Roam import (and potentially any paste event) should download and store images locally

Currently when you import things from Roam - logseq will display images, but they would be still stored on Roam servers.
Which works, but is quite fragile:

  • you can’t access those images offline
  • if you were to close your Roam account those images will break

Request:
On import download and store any referenced images locally in the vault (optionally retaining a reference to the original nearby).

I think it can be a good way to handle any images pasted in/linked by reference anyway (or maybe prompt users on this?). As allows for graph to retain full offline capability and helps with link rot.

I just imported my Roam graph to Logseq and transferred all the images by hand with a script. If there’s any interest I could package the script up for use by others.

1 Like

I think that’d be great! Your comment prompted me to remember a tool that should crawl markdown documents and download/replace images within - GitHub - gunar/markdown-backup: Download remote images in markdown files and store them locally

1 Like

Has anyone had experience with this Roam to Logseq script ?

GitHub - sebastianpech/roamtologseq at pythonawesome.com

Performed actions

  1. Turn all roam queries into inline code. Works with multiple queries at arbitrary locations inside a block.
  2. Download all files stored in roam and relink them for placement in the assets folder (This will take a while, files are only downloaded once)
  3. Rename roam attributes. A given set of attributes is turned into logseq properties, all other are renamed to [[name]]:
  4. Schedule blocks with a given tag. If a block contains a given tag flagging it for scheduling, the first found date reference is added as a logseq scheduled property.
  5. Convert given task management tags to logseq task markers. Eg. #waiting becomes WAITING, or #canceled becomes CANCELED

Did anyone ever get this working?

Been struggling with this for weeks. I want to make the jump to Logseq from Roam, but have tons of images and none of the scripts I’ve found work.

VERY interested! Any chance you could help me make the switch from Roam to Logseq, getting images locally, if you have a script that’s working?

Well…I don’t have a packaged script, I have some code that runs inside of my static site builder, or did a year ago. Here’s some of the code involved but I expect it won’t be runnable without some work.

I don’t have a Roam account any more so I can’t fix it up myself. If you feel comfortable granting my access to your graphs, I would be willing to try to package this up or just do the export for you.

1 Like

Wow - thank you so much for offering!

There’s nothing too confidential in my graph, I’d be happy to grant access or just send you the JSON export of my Roam. What is the best way to get it to you without posting publicly here?

No problem, happy to help.

Yes sending a JSON export would probably be enough, you can email me at mtravenhyperphor.com

1 Like

Just emailed! Thank you soso much!

Yes, the script above works nicely.