Skip to content

Instantly share code, notes, and snippets.

@Blakeinstein
Created January 11, 2023 19:50
Show Gist options
  • Save Blakeinstein/0cdf4a17ad3dc2e440e8dd389f5f7aba to your computer and use it in GitHub Desktop.
Save Blakeinstein/0cdf4a17ad3dc2e440e8dd389f5f7aba to your computer and use it in GitHub Desktop.
Move Microsoft EDGE collections to raindrop / csv

Move Microsoft edge collections to services like Raindrop (that can accept csv)

Get the sqlite db file

  1. You can find the db file in the following places
  • Windows: %LocalAppData%\Microsoft\Edge\User Data\Default\Collections
  • MacOS: ~/Library/Application Support/Microsoft Edge/Default/Collections
  • Linux: TBD
  1. Copy the files (esp. collectionsSQLite) to a seperate Folder.

Execute the script

  1. Install python 3.10 and then setup pandas via pip pip install pandas
  2. save collections_to_csv.py to the same folder with the db files from the previous step.
  3. Exec the script python collections_to_csv.py

Then you can simply import the file normally to raindrop.

import json
import sqlite3
import pandas as pd
con = sqlite3.connect("./collectionsSQLite")
cur = con.cursor()
df = pd.read_sql_query(
"""
SELECT i.title as title, c.title as folder, i.source as data, i.date_created as created
FROM collections as c, items as i, collections_items_relationship as r
WHERE r.item_id == i.id and r.parent_id == c.id
""",
con
)
def blob_to_json(col):
my_json = col.decode('utf8')
d = json.loads(my_json)
return d["url"]
df["description"] = ""
df["tags"] = ""
df["created"] = df["created"].astype(int)
df["url"] = df["data"].apply(blob_to_json)
df.to_csv(
"out.csv",
index=False,
columns=["url", "folder", "title", "description", "tags", "created"]
)
@Kamek437
Copy link

@Davecon11 Win 8.1? Holy cow man how do you not get viruses and crap. You know they don't do security patches for that anymore right? Upgrade like now if you value your data.

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