Thank you @sam.baron - as I think sooner or later anyone might be interested in the process I developed today, I will describe it here in detail:
Be aware that this, as mentioned above, is a solution for Linux OS and might possibly work on MAC as well!
If you want to migrate from zkn3-zettelkasten without losing your internal links and your tags, use the following documentation. The sequence of the single steps is important - otherwise your migration experience might end up in a mess…
-
First we have to prepare the zkn3 keywords for export:
- If you have used some keywords that consist of several words (like for example “migration from zkn3”), replace the spaces with hyphens. Do a “Search and replace” (ctrl + r), be sure to have activated the “regular expression” field, choose only “keywords” and replace
\s with -.
- Then convert all your zettelkasten keywords in a format that obsidian can recognize as a tag. Use “Search and replace” again, be sure again to have activated the “regular expression” field and again choose only “keywords”. Then replace
^(which is the regular expression for the beginning of the line) with #.
- Having both done, your former tag “migration from zkn3” should now look like “#migration-from-zkn3”.
-
Now export your complete zettelkasten to markdown. Be sure to have activated both “export as single files” and “put zettel number before zettel heading”. Your single zettels will now be exported to markdown files named with the pattern “Number Title”, for example: “1 Title_of_my_note.md”.
-
In order to be able to convert internal zettelkasten links to wikilinks, we first have to rename all our files such that the name only consists of the zettel number - for example “1.md”. In the terminal, we cd to the directory where we exported our files to and use the “rename” command: rename 's/\s\S+/.md/' *.md
-
For finally converting the links in the single files, we now use “sed” in the terminal. Execute the following commands in exactly the following sequence:
Now, we finished the insertion of the respective wikilinks. Whereas before the link looked like [z 1]Link to another note[\z], we now have: [[1]]Link to another note[\z]]. The first part of this is a working wikilink which takes us to the file “1.md”. Yet, as you see, we have to do some cleanup (and notice that by executing the last command the closing part of the former zkn3 link [\z]has also been replaced by [\z]]!).
Let us now remove this complete string from all our text files:
sed -i 's/\[\/z\]\]//g' *.md
The result will now look like [[1]]Link to another note
Yet, there is now also another problem we have to correct. By replacing all ] with ]], standard markdown links in our files have changed from [text](url) to [text]](url). We will finally correct this defective formatting:
sed -i 's/\]\](/\](/g' *.md
And that’s it! Finally paste all of your new *.md notes into your vault and you can work with them in obsidian - all of them being tagged and linked correctly! 