Hi,
using geeknote I was able to export all my notes in md files (one per note), each notebook has its own folder on my FS, each folder name is the same of corresponding notebook. I thought an abstract on how to implement the import in laverna by a bash shell script and I would like to ask you some questions to understand if the procedure I have in mind could work :
Could this work? Any suggestion or advice?
Obviously, if I can get something working I will provide you the full script, hoping it will be useful to other users.
Let me know
Best regards
magowiz
Hi,
It should work because there is nothing special about the import process. The structure of the folder should be somethings likes this:
./
└── notes-db
├── configs.json
├── notebooks.json
├── notes
│ ├── note-id-1.json
│ ├── note-id-1.md
│ ├── note-id-2.json
│ ├── note-id-2.md
As you can see from this tree, only notes have separate files for each item. For instance, all notebooks should be saved in file named notebooks.json
.
Hi wwebfor,
first of all thank you for the information provided, I was able today to try to import, manually one md note into laverna without issues, this test was a prerequisite about what I'm going to write in my code.
The whole process is simpler than I thought, I didn't notice in first instance that note content is saved in another file , in md format file, so I thought I had to extract content from json files.
I will obviously provide you the code I will write.
I'm still working on it, in particular to notes json files, I noticed that in each json there is encryptData element that contains an inner object, I think it is the information laverna needs to encrypt back once imported,the content of that element should be identical on each json. Are my thoughts correct? Is it safe to use data from an existing laverna note to create json of the imported note? For what I understood it should be safe to let it empty.
Which criterias, formats or algorithms does laverna use to determine notes filenames or notebook Ids? At some point I will need to give names to md and json files and id to the new notebooks.
Thanks in advance.
magowiz
Ok I wrote the script and I generated the new zip file from an export using the same structure as described on first reply : anyway once I choose to import it does nothing, the same notes as before are there.
I'm pretty sure that every note has an unique filename in uuid format, each note refers to its notebook and every new notebook are inserted into notebook.json file . I don't know what I've done wrong, can you please tell me how to "debug" the importing process or tell me if you want the script I wrote so you can test a generated zip file.
Thanks
magowiz
Ok I did it, I read again the initial indication and I removed all metadata from json files that was not essential.
Now as promised I will publish the scripts (one for getting notes using geeknote, one for building laverna import file) I hope my work will be appreciated .
This script may destroy your data as well as it may work flawlessly, please, please, please make a backup of all your notes (evernote and laverna ones) , it is better you first try it in another profile or in another dir than usual laverna data one or please backup the whole ~/.config/laverna directory
If you find a bug or you have an idea to improve it, please write me here on github.
I used a few packages other than simply bash v4, anyway I will list them to give you the possibility to run the scripts :
previous version of evernote backup script was bugged about log file location, now the log file is in same folder of exported data, I reattached the zip with evernote-back script updated, please download it again if you downloaded it previously.
lv-md-import.zip
Sounds nice. Although I am not an Evernote user :)
the second script isn't so related to evernote, but to every note program from wich you can export to md format. ;)
Ah ok, did not read carefully.
No problem at all, for me all it started with the need to migrate from evernote :-) Then wwebfor gave me some precious information about laverna file format and I tried to get something working.
I read the instruction I gave, I choose to isolate what's needed if you don't need to migrate from evernote:
That's it, the only thing is that you have to find yourself a method to get notes in md files from program you need to migrate from..... .
I hope I clarified better the whole process.
This... is awesome. I've dreamt for so long to have something similar to escape away from Evernote (with my content).
Except i have several questions for you before i dig into it : I've been a long time evernote user and to this day have ~1700 notes. So here are my concerns :
Anyway, thanks for your job on this, can't wait to fully migrate :)
Hi Julianoe I appreciate your enthusiasm about what I've done, that is, keep in mind, nothing more than putting together the information wwebfor gave to me, the geeknote program , and some tries to get something working. Nothing more than that
Now I answer to your questions :
I hope my answer satisfies you.
I noticed some issues on log file of evernote script, I fixed it and I will update the one I attached here.
A small update on tags : I read geeknote documentation and for what I understood there is a way to list all tags, using command : geeknote tag-list
, anyway I didn't find a way using gnsync
or other geeknote commands to get a list of notes from a given tag or to get a list of tags from a given note.
This makes almost useless the tag synchronization, since you will get all tags you had in evernote but you lost the association between them and notes. I think if it is so it wouldn't be worth to implement such feature in the script.
I hope I am wrong, anyway you can read geeknote documentation and tell me if there is a way to do it that I didn't find.
UPDATE : Nevermind I didn't search in right places, geeknote find
command it's the one we can use, in particular with geeknote find --tags
, I will do some tries and let you know.... Now tags migration makes sense.
@magowiz thank you for scripts, since geeknote not always relevant due to Evernote API limitations, here's some mix of scripts that worked https://github.com/m00rt1/enex2laverna
Most helpful comment
Ok I did it, I read again the initial indication and I removed all metadata from json files that was not essential.
Now as promised I will publish the scripts (one for getting notes using geeknote, one for building laverna import file) I hope my work will be appreciated .
Warning
This script may destroy your data as well as it may work flawlessly, please, please, please make a backup of all your notes (evernote and laverna ones) , it is better you first try it in another profile or in another dir than usual laverna data one or please backup the whole ~/.config/laverna directory
If you find a bug or you have an idea to improve it, please write me here on github.
Prerequisites :
I used a few packages other than simply bash v4, anyway I will list them to give you the possibility to run the scripts :
Usage
UPDATE :
previous version of evernote backup script was bugged about log file location, now the log file is in same folder of exported data, I reattached the zip with evernote-back script updated, please download it again if you downloaded it previously.
lv-md-import.zip