Evernote ENEX import suggestion (or plugin) re: note links

As many of you are aware, Evernote's ENEX export format does not include note GUID's (unique note identifiers), so the note links in a referring note, e.g., evernote:///view/623444547/s234/3234284a05c-d67a-47af-c354-adad387102b3/3234284a05c-d67a-47af-c354-adad387102b3/
are pointing to a GUID that does not exist in the enex file or in any notes imported from an enex file. So perfect recreation of note links via enex is impossible.

However, in practice, most note links have note text that is exactly the same as the target note's title. This is because this is default behavior in Evernote. In Evernote, when you select a note (target note) and copy its internal link and paste into another note (referring note), what is pasted as the note link text is the title of the target note along with a hyperlink that is the EN GUID link. A user could edit the note link text so that it no longer matches the target note's title or edit the target note's title, but I would expect this occurs in only a small minority of note links.

Given the foregoing, it seems Joplin's enex importer could preserve the vast majority of Evernote note links by checking each imported note for a GUID link, searching note titles for that note link's text, and if target note is found, recreate the note link.

It's not "perfect" in that:

  1. it doesn't recreate note links in cases where note link text does not match title of target note (a small minority of cases). But no harm is done as nothing is changed, and user is no worse off than if this feature was never implemented.
  2. it may inadvertently create note links in cases where note link text matches title of note that is not the target note (an even smaller minority of cases than #1, where user edits the note link text such that it exactly matches another note's title). In this case, an inadvertent change is made in that you now have a link pointing to a note that is not the intended target note (as opposed to a link that points at something that doesn't exist).

But it would recreate most note links for most users. Perhaps it could be implemented in enex importer as an option - those users who think they have numerous notes falling into imperfection #2 described above could turn off this option.

Since the implementation as described here would only recreate note links where referring and target notes are in the same enex file, and given that people are often migrating from EN to Joplin using multiple enex files (e.g., 1 enex file per notebook), perhaps this note link recreation would be better implemented as a function, either in Joplin or a plugin, that user can run when desired - for example, after they have completely finished importing all enex files from EN to Joplin.

As an aside, this feature would make Joplin superior at importing enex files than Evernote itself, since Evernote import of enex files causes user to lose all note links, and EN has no provision to automatically recreate these links after the import.

3 Likes

I would prefer the latter if anyone is thinking of coding this - an operation to recreate internal links, that could be run later, after import of ENEX, and after all stack-and-notebook hierarchies re-created. Especially useful if there was the ability to preview all the suggested links and edit - as a check for errors / missing / changed. Maybe 5% of the time I change the title of a linked note, or the link display text of the note link, or both, for internal note links across notebooks and stacks.

2 Likes

A plugin that does this would indeed be a good idea. It would be best not to process these links at import time since all the notes might not be there by that time, but as a post-processing step in a plugin that would be easier and more reliable.

2 Likes

As I described here: Any suggestions on what plugins could be created? - #95 by jb261

with @roman_r_m's Quick Links plugin, we're partway there in terms of steps such a plugin would need to execute.

This would be incredibly useful. As a long time Evernote user I use internal links extensively, so switching to Joplin seems impossible (I estimate I have more than 10,000 useful links).

A possible improvement to the original proposed process for exporting from Evernote (one notebook at a time):

For the first notebook

  1. Check all titles are unique.
  2. Create an "index note" of links to all notes in the notebook.
  3. Export the enex file for the notebook.
  4. The plugin can then use the "index note" to extract the mapping from GUID to title.
  5. As the plugin imports the remaining notes it can replace the evernote internal links that have GUID within the notebook with the correct Joplin links.
  6. Store the mapping between the GUIDs and Joplin notes for future use.

With subsequent notebook exports it uses the stored GUID mapping as well as the newly extracted GUID. If you export all the notebooks using this process you should get all the links correctly exported .... I think.

Sadly I am not very good at programming and this is a complex process, so cant test any of these ideas.

You lost me there. How is the plugin going to accomplish this when there is no GUID in the enex?

You get the GUID from the "index note" that you create before you export the notebook from Evernote. You create the index note by selecting all the notes in the notebook and then using "copy internal links". You create a new note in the notebook and paste the links into the note. Give it the title index. When you export the enex the index note will provide a mapping between note titles and GUID.

BTW - A simplification to my original suggestion would be just to have a GUID field as a property of the Joplin note. As you import notes you can then convert any Evernote note links to notes already imported to the correct Joplin links.

1 Like

I'm tracking now. That's a good idea. Even apart from a plugin, it's a useful way to help recreate note links manually in those instances where the target note title doesn't match the note link text.

My guess is that if the "index note" approach was followed each time you imported a notebook and the Joplin import code was updated to make use of it then it would be equivalent to the GUID having been included in the enex file in the first place (as Evernote should have done).

The code to correctly replace Evernote links with Joplin links on import could then be fully automated and fool proof. I don't think you would need any additional harvesting of GUID to title mappings.

Clearly until somebody tries to code the solution we will not be certain of the best approach ...

1 Like

I reread your original proposal and realised the simple way of thinking about the index note idea is: do exactly as you propose but in addition generate an "index note" for each notebook before exporting it from Evernote so that you guarantee that all notes have the required "Title - GUID" Evernote link that your method requires. It would eliminate the need for any checking or manual intervention.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.