Home / GitHub Page

Evernote bug causing issues with importing: internal note links are not persistent

Since maybe many people will come across this, I thought I would mention a bug in evernote I came across since it’s affecting imports from evernote. And when/if it’s fixed, I imagine Joplin will need to handle it as well.

Is this just the longstanding problem with Evernote exports in that internal links are represented only as links to Evernote’s web servers, which change if notes are deleted (or e.g. moved between accounts)?

(NB I quite Evernote for Joplin as soon as I became aware of this)

I don’t know how longstanding it is as I hadn’t noticed it before. I did a search on the forum but didn’t see any mention of it here.

Does it sound like it’s the problem described here — https://discussion.evernote.com/topic/24557-import-old-notebooks-into-evernote-using-enex-loses-all-note-links/ ?

If so, that’s the longstanding problem I refer to to. (that forum thread is from 2012). Given how long it’s been around, I’m not very worried that Evernote are going to fix it.

In theory, you could write a script that takes a .enex file and matches up internal links based on the note titles - but that won’t work for cases where you’ve edited the link text or the note. If you had only done that for a minority of cases, maybe the script could list the cases it couldn’t match, and leave them up to you to manually fix before running it again.

(the script might also incorrectly link some cases where the link text has been changed so that it matches the title of the wrong note. I don’t see any way to avoid that.)

Said script, or a second one, would then need to export in Joplin format somehow.

yeah, this looks like it. I looked at the enex files as they’re just XML files. There’s no unique internal identifier for any given note so there’s no way they have currently to link it. That’s really stupid.
And the link itself is clearly a reference to an internal database id.

2 Likes

A limitation? That would be soooooo easy to fix.

1 Like

Just a quick addendum - I'm looking into this for my own purposes, and one can use the Evernote API to retrieve a list of GUID, title, creation date, for example. So I am hoping to use this to re-map of the broken links in Joplin. I guess the workflow would be to script something that does this:

  1. Find all notes containing evernote:// links
  2. Extract the GUIDs in use from each note
  3. Use the Evernote API to look up the title and creation date of each linked note
  4. Use the Joplin API to find the corresponding Joplin note filenames
  5. Modify the notes to replace enex:// links with Joplin links

I haven't poked into the Joplin API yet, so step 4 is the unknown one for me, but I think this is reasonable.

Does anyone have other ideas? Or see any flaws in my plan?

Thanks!
Mark

1 Like

Does anyone have other ideas? Or see any flaws in my plan?

Great idea, can you implement this? The only problem I see is that you can find several notes with the same name in Evernote, but I think it is not a common situation and you can pick up the first one.

Another idea is that maybe steps 2 and 3 unnecessary. Each link in Joplin has already the name of the note (at least it is my case). So it is better to find a note in Joplin with that name, copy the markdown link and paste it instead of Evernote's link.

1 Like

Well, I don't know any js so won't be trying to tackle this in Joplin - my plan is to use a python script and work outside/with Jopling after I import.

Indeed title is not unique - title and creation date together are (in my case, at least).

I can't see how to avoid steps 2/3 since the only information in the imported Joplin notes is something like this:

<a href="evernote:///view/138788/s3/3ba1eea5-8f77-41d7-a2bc-116f18f7c034/3ba1eea5-8f77-41d7-a2bc-116f18f7c034/" title="evernote:///view/138788/s3/3ba1eea5-8f77-41d7-a2bc-116f18f7c034/3ba1eea5-8f77-41d7-a2bc-116f18f7c034/">Monthly planning May 2020</a>

So you have to turn this into a Joplin link (simple link to the Markdown file) by matching the note GUID (3ba1eea5-8f77-41d7-a2bc-116f18f7c034) referenced in the note to another Joplin note (for which we need to know the filename, e.g. 0a0b7d92a4df4feb8cddaddc1fee9e9b.md).

The only way I can see to do this is to query the Evernote API to find the note title and creation date, and find a matching note in Joplin. (Actually I simply use the Evernote API to create a CSV file with GUID, Title, Date records - that bit is easy, now I have to play with the Joplin API).

1 Like

Hope you can do that. I have many internal links what now are broken.

enex file and matches up internal links based on the note titles - but that won’t work for cases where you’ve edited the link text or the note. If you had only done that for a minority of cases, maybe the script could list the cases it couldn’t match, and leave them up to you to manually fix before running it again.

No, indeed - as I mention above, I would only do this immediately following an ENEX import - once, and never again :wink:

And please, share your work with us :slight_smile:

But I thought, if you share your work with us, it is possible that many users will change several links. Like I did with most recent notes I am working now. So now my Joplin base <> Evernote base in some notes.

Sure - I've got something that half works now, but once it's polished and tested I'll push it to GitHub and post in the #apps category.