Downloading Roam images

May 21, 2022
Downloading Roam images
One of difficulties of
Migrating from Roam to Obsidian
is that any images or files that were uploaded or pasted into Roam remain on Roam’s Firebase storage. So even if Roam’s Markdown is imported to Obsidian, the images are still online in their original location, defeating the purpose of local, offline mode of Obsidian for these images.
I started building a tool a year ago that would take a Roam JSON file, parse it for any Firebase images/files, and make a list of them. Then by using a Chrome extension, it could bulk download those files.
Since then, Roam has provided a file list under Settings. Today, I did some scripting to scrape this list. I found that there were some images that were “orphans”, meaning they were not referenced anywhere in the graph. These were usually duplicates. Some of the images listed were no longer found in firebase, so I deleted those.
Now, I’m trying to make a script that will bulk download them to my hard drive while automatically renaming them to their original, plus the date/time they were uploaded. That way there won’t be issues with duplicate filenames. There are a few hundred files named “image.png” which were pasted in. So I need to make the name unique.
I have a couple thousand total files. Downloading the metadata for each of them to get the createdTime has been the trickiest part so far.

Later, a friend shared this with me. Someone already made a (python) script to do this.