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
- Make sure that you’ve done the preparation steps. All of them will affect the outcome/probable success rate of the migration process.
- Make sure PowerShell and OneNote are open and running in Admin mode
- In PowerShell, navigate to the folder you unzipped ConvertOneNote2MarkDown4Obsidian in.
- Run ConvertOneNote2MarkDown-v2.ps1
- 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.
- 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.
- 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. - Leave the script and OneNote open and running. This is a good time to grab something yummy to drink.
- Do NOT fiddle with the OneNote-window, just open stuff above it, if you need to continue working somewhere else.
- When the script is done, a summary in white will show up.
- 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!
- If all looks as expected: SUCCESS!! Celebrate!
- Move all the .md-files and media folder to your normal vault. Done!
- 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
Culling is nice! Have fun
- 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
Ooooor…
- 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.