Migrating From DokuWiki to Obsidian

󰃭 2024-08-18

About a year ago, I decided to move all my personal notes from DokuWiki to Obsidian.

DokuWiki is great software and has served me well, but I never utilized it to its full capacity. It’s biggest strength is that it’s a… wiki, and I was the sole user.

It made little sense for me to keep a service running when I could just have some Markdown files locally. And Obsidian provides a really nice UI on top of those Markdown files.

One reason I chose DokuWiki in the first place, is that it doesn’t need a database. All the content is kept in plaintext files. So if I ever wanted to move my notes elsewhere, it would hopefully be a painless process. In the end, I think it was a good choice, because the migration was quite simple.

The Migration Process

These are the steps I followed:

1. Copying the data folder locally

First, I needed to get the source text and image files from DokuWiki to my local machine. All of it is located at /var/www/dokuwiki/data/ for a common installation. This directory contains all the text files and images that comprise the wiki pages. This directory is configurable, so check your configuration if you’re unsure.

2. Convert all text files from DokuWiki Syntax to proper Markdown

The next step was to locate all the .txt files in data/pages. These files needed to be renamed to .md, and the content converted to proper Markdown.

DokuWiki uses its own syntax, which is not really used anywhere else.

I ended up writing a quick script to handle this, with some help from ChatGPT to speed up the process.

Main points the script covers:

  • Changing DokuWiki’s heading syntax to Markdown format.
  • Adjusting link and image paths to work with Obsidian.
  • Handling any quirks like list formatting.

3. Moving Media Files

After the text files were converted, I moved all the media files from data/media to data/pages. Obsidian can handle images and other media in the same directory as the Markdown files, which DokuWiki did not.

4. Final Touches

The last step was to verify everything in Obsidian. I went through my notes to check formatting and that there were no broken links or images. A few minor tweaks were necessary, but the script got me 95% of the way there!

Conclusion

It’s been about a year since I did the migration, and using Obsidian is much smoother. I just need to make sure the directory with my notes is properly backed up / synchronized between my devices. Obsidian offers this as a paid feature, but I didn’t want to depend on yet another 3rd party service. I simply use a Git repository to keep my notes.

For anyone looking to do the same or similar, I hope this post helps you out.

Here is a small peek of my notes in Obsidian’s beautiful graph view:

obsidian graph view



More posts like this

Migrating old-style JavaScript code to ES6

󰃭 2017-12-28 | #es6 #javascript #refactoring #webpack

Recently (at work) I had to migrate a medium-sized JavaScript codebase (20KLOC) to ES6. We wanted to migrate to take advantage of the new features such as arrow functions, destructuring, and classes (there are a bunch more!). Additionally, I was tasked with introducing eslint and prettier to improve the quality of our code a bit more. Before diving into the migration process, first I’d like to give some context on the state of the application.

Continue reading 