After the KDE guys decided to make it impossible to use KNotes in recent versions of Plasma 6, leaving us users literally stranded in this regard (no, I have not worked trying to import with “Marknote”), I have gone crazy to retrieve important notes that I have stored in two computers with Plasma. So, for all of you affected by this ugly thing that KDE has done to us, here’s what I finally figured out:
Each KNotes note is stored in an individual file in a subfolder of the “$HOME/.local/share/notes/” folder. In my case, the subfolder on one computer was named “aY0f6xtEL2/new/”, but in each case you will have to go through the possible subfolders you have until you find them. The contents of the folder are text files with tags similar to a markup language, but the contents are perfectly readable.
KNote was discontinued as it was unmaintained (you can search for the forum thread here…). The replacement is Marknote which is readily available in the Tumbleweed repos. And yes, Marknote can import your notes from your KNote and Kjots…
Few facts? How easy it is to just repeat for the sake of repeating. The facts are known to the affected users, who are the ones to whom the message is addressed, and by now they have already assumed and understood that they have not been provided with a solution that works for everyone. Because if you think that I’ve been going around to find a solution like the one I post is “for the sake of it” or that I had nothing else to entertain myself with, you are wrong: Marknote didn’t care about the notes of any of the two teams with Tumbleweed, and yes, there are more cases like mine.
KNotes was part of the default KDE desktop installation for more than 6 years so there are many users who, like me, have been annotating texts with it. Over the years it has been working worse, but at least it was what we were looking for: floating notes that even stayed on top of the rest of the windows.
It would have been much nicer of KDE to have just temporarily added an export option, even if it would have been from the command line.
Still, I thank you for including in your reply a link to which, if you notice, I had already written on September 5. Since then, no import solution has worked or even exporting from Akonadi database has worked.
For those Knotes users who have managed to open these files, it is very likely that you will open them with KMail. If KMail correctly displays their contents for copying, you can stop reading.
For those who do not see the content correctly, if for example you use Kate or Visual Studio to open those files, you will find that there are strange characters. For example, some “space” characters appear as “=3D=”. Also, non-ASCII characters from other languages, such as French, Portuguese, Spanish, Chinese, etc., will not be readable. This happens because the content of the notes is encoded (quoted-printable format).
To decode the content of your notes:
Install “perl” if it is not already installed (from YasT or from console with sudo zypper in perl).
Open a console or terminal (Kconsole)
Go to the folder where the notes are. On one of my computers for example I would do: cd $HOME/.local/share/notes/new
Execute the following command
perl -MMIME::QuotedPrint -e 'for my $file (glob "*.*") { open my $in, "<", $file or die "Unable to open file $file: $!"; my $content = do { local $/; <$in> }; close $in; $content = MIME::QuotedPrint::decode($content); open my $out, ">", "$file.decoded" or die "Unable to create file $file.decoded: $!"; print $out $content; close $out; print "Processed: $file\n"; }'
After executing this command, in that same folder, we will have created copies of all the files that were already in that folder, with the extension “.decoded”. Those files contain the text correctly encoded, and we will be able to open it with any plain text editor and copy its content without strange characters.