How to migrate many OneNotes to Obsidian from scratch (2k+ files)

How to migrate many OneNotes to Obsidian from scratch (2k+ files)

An avid OneNoter for years that just found Obsidian and finally found THE(?) tool to actually see/connect what you did before?

… but all my notes are locked up in M$ jail and there are NO way I’m gonna manually export those, one by one… HAAAALP!

Fear not, the Obsidian community to the rescue!

This exact workflow exported my 2000-ish OneNotes and embedded files, with retained structure links (phew!). You WILL have to clean up a bit inside Obsidian after the export, but at least the note file structure and data are freed up into .md notes… you’re not starting from scratch!

Huge thanks to the creators of the assorted scripts, details of functionality and further installation instructions can be read on the respective resource pages. I’ve incorporated those I found was vital in the instructions below. YMMV.

Base requirements

  • Windows >= 10
  • Windows Powershell 5.x and above
  • Microsoft OneNote >= 2016
  • (Microsoft Word >= 2016)
  • Admin rights on your computer
  • Basic commandline proficiency (ie know how to navigate to/run a specific folder/program in a PowerShell/command line environment (cd <‘filename’> /cd… )

Preparation

Stuff to get/install

  • Windows PowerShell (Core functionality on win10-machines)
  • Install Pandoc via Chocolatey: Pandoc
  • Install stand-alone desktop OneNote, NOT web version: Free of charge
  • Install Onetastic Onetastic
    (relevant macro to run is attached in Convert…4Obsidian-package below)
  • Get ConvertOneNote2MarkDown4Obsidian - rab-bit fork
    • Exact release I worked with: v2.5

Prep file structure / programs

  • Create a clean, short, absolute file path for the script to work in, in root. Ie “C:\temp\notes”
  • Unzip the downloaded ConvertOneNote2MarkDown4Obsidian-zip in a folder with an ‘easy to remember’-path.
    • You will probably need to tweak the export some times before you’re satisfied and thus you might need to re-type the path. Long paths are a nuisance…
  • Open Windows PowerShell as Admin

Prep OneNote

  • Open OneNote as Admin (right-click on the OneNote icon in startmenu, choose ‘Run as Administrator’)
  • Close all notebooks that you DON’T want to export. All notebooks currently loaded (open) in OneNote will be converted.
  • Make sure the open notebooks doesn’t resides in any local harddrive(s). If any are locally saved, move them to OneDrive so the conversion script can find them.
  • Remove all password protection(s) on any OneNote file or section
  • Flatten nested Section groups deeper than 4.
    • TIP: Rename the children/leaf sections before you move them upwards to parent section level to denote the old structure. Much easier to re-create the original structure in Obsidian afterwards
  • Install Onetastic
  • Run Onetastic script (included in the conversion4Obsidian kit) once per open notebook.

Prep Obsidian

  • Create a new Sandbox vault to check the migration result in.
    • If you’re not brand spanking new to Obsidian, chances are that you already have a small vault going and you do not want to inadvertly delete other files while you fiddle with the exports. It’s nice to be able to wipe the whole vault and redo.

Migration process

  1. Make sure that you’ve done the preparation steps. All of them will affect the outcome/probable success rate of the migration process.
  2. Make sure PowerShell and OneNote are open and running in Admin mode
  3. In PowerShell, navigate to the folder you unzipped ConvertOneNote2MarkDown4Obsidian in.
  4. Run ConvertOneNote2MarkDown-v2.ps1
    1. The choices you make in the initial ‘setup’ will affect the outcome of the script. Re-run the script until you are satisfied with the outcome.
    2. NB! When the export runs, the script will throw (the same) exeption like no tomorrow (one for each file-call, by the looks of it), so the log will look like a blood red carnage of errors. It still works tho.
  5. Open up the script working folder (“C:\temp\notes”) in a file explorer window and watch the script bulding up your files … it’s quite mesmerizing :).
    Also a non -evolving file structure is a good heads up that the script have crashed.
  6. Leave the script and OneNote open and running. This is a good time to grab something yummy to drink.
    1. Do NOT fiddle with the OneNote-window, just open stuff above it, if you need to continue working somewhere else.
  7. When the script is done, a summary in white will show up.
  8. Manually copy the result from /notes to your new Obsidian Sandbox vault via a file explorer window. Check the results, don’t forget Graph view. Such satisfaction!
  9. If all looks as expected: SUCCESS!! Celebrate!
  10. Move all the .md-files and media folder to your normal vault. Done!
    1. Aka …begin the cleaning up. TIP: Batch clean out doubles, weird pictures/media files in a file explorer window instead of one by one inside Obsidian… You can thank me later :smiley: Culling is nice! Have fun :smiley:

Ooooor…

  1. If the result looks like a spiderweb made on drugs, a tatched roof or a strange orphan starred sky, or you are missing half the notes… time for a re-run from step 4.
    1. Remember to clear out the .md and media files (keep the docx-folder) in c:\temp\notes between every new run, otherwise you WILL have doubles galore to clean out.

This is essentially a duplicate of this thread and, and a copy-paste of the Readme, for the tool that I made. https://forum.obsidian.md/t/new-tool-for-migration-from-onenote-updated-and-improved-version/

It is out of date anyway, given that I passed the project off to other people who have made considerable improvements. I’ve linked to the new tool in the original thread.

@nixsee Weell. Yes, it is absolutely based on your work, and a few others that forked it. I got rab-bits fork to work, unfortunately not yours, tho I tried). I take exactly NO cred for actually creating the scripts, I also did thank you all, albeit as a contributor group?

What I DO take cred for, however, is to have merged the whole process of quite a few scripts (and descriptions) into ONE single, step by step workflow proven for a massive amount of files, instead of having to read tons of git-conversations to understand how to do stuff… and to wonder whether the scattered git-repos would work on a ‘slightly’ larger note set than a few hundred that others had reported.

Call me stupid, but as a novice of both git, pandoc, chocolatey and Obsidian, this step by step ‘holding hand’ instruction is what I would have love to read when I started this process. YMMV.

Btw… Isn’t it the whole point of Obsidian to expand and publish your take on others thoughts/work where you see it needed? Anyway, I’m sorry to have offended you. Was not my intention. Thank you so much for doing the initial (massive) leg work!

No offense taken. I was just pointing out that this was redundant and out of date. I strongly recommend checking out the most recent version. The new maintainers have done a fantastic job of improving it far beyond what I had hacked together.

2 Likes

First: Thank you so much to all the parties involved in this! This is what the internet is for!

I am trying this, and I am following the instructions exactly (i think)
I am getting this error

Please help!
TIA