Jump to content

Created tool to recover local notes when encountering 'an internal database error has occurred'


Recommended Posts

A week ago my Evernote app suddenly stopped working with the 'an internal database error has occurred' error which prevented Evernote from opening. All but one of my Notebooks is synchronized online but I had a critical local-only notebook (for security reasons) which I could not afford to lose. After spending some time browsing how Evernote stores data in 'Application Support', I discovered that my note content was still there.

I spent the rest of the day writing a program which can directly extract all of the enml files under 'Application Support' and export them into a single export file in enex format - independent of the Evernote app and regardless of whether the database is corrupted or not.

I called the program "Evernote Doctor" and it's free for anyone to use.

spacer.png

NOTE: It is provided "as is" w/o warranty, liability, claim, contract, tort, or otherwise in connection to the use of the software (see software LICENSE).

It has the following limitations:

  1. It does not recover note titles. This can be significant, I know, but for my purposes simply having the note content was infinitely better than not having that at all and I was able to reconstruct my note titles from re-reading my notes.
  2. It exports all notes across all notebooks (online and local-only - any enml file on disk under Evernote's 'Application Support' location) so once one repairs the Evernote app so the export file can be imported, they will need to search through that potentially large import notebook in order to find the notes from the local-only notebook.

If someone knows how to overcome these limitations, I'm happy to see about working that into the program. I assume that it's unlikely since #1 and #2 are part of the database which is corrupted.

 

Link to comment
  • Level 5*
20 hours ago, Caleb Jones said:

If someone knows how to overcome these limitations, I'm happy to see about working that into the program. I assume that it's unlikely since #1 and #2 are part of the database which is corrupted.

The note contents are stored in content.enml files, one for each note.  The note metadata is stored  in an sqlite database; this includes title, notebook, tags, dates, ...

Anyone using  local notebooks should have a data backup process running.  My backups use Evernote's export feature and creates enex or html files. 

Link to comment
  • Level 5*
20 hours ago, Caleb Jones said:

I spent the rest of the day writing a program which can directly extract all of the enml files under 'Application Support' and export them into a single export file in enex format - independent of the Evernote app and regardless of whether the database is corrupted or not.

I called the program "Evernote Doctor" and it's free for anyone to use.

 

Thanks for sharing.  I can see how this would be helpful to people who have lost Local Notebooks and cannot open the Evernote Mac app.

Since your recovery method includes ALL notes, not just those in Local NBs, one fact any potential user should be aware of is that this could take quite some time, and result in a very large Evernote dataset when you import the recovered file.enex.  I have      20K+ notes, which currently require ~15GB of space.

20 hours ago, Caleb Jones said:

If someone knows how to overcome these limitations, I'm happy to see about working that into the program.

As @DTLow mentioned, the Evernote metadata on the Mac is stored in a SQLite database.  If you can read that, you might be able to identify the Local Notebooks, as well a other Note data like Note Title.

Link to comment
43 minutes ago, DTLow said:

The note contents are stored in content.enml files, one for each note.  The note metadata is stored  in an sqlite database; this includes title, notebook, tags, dates, ...

Anyone using  local notebooks should have a data backup process running.  My backups use Evernote's export feature and creates enex or html files. 

Yeah, for me when this happened I realized that it had been 1 month since my last local notebook backup - my bad.

Link to comment
6 minutes ago, JMichaelTX said:

As @DTLow mentioned, the Evernote metadata on the Mac is stored in a SQLite database.  If you can read that, you might be able to identify the Local Notebooks, as well a other Note data like Note Title.

I assumed that was what was corrupted. For me, the content was most important to recover and so I didn't spend much time working on cracking the SQLite DB. If I do, I'll probably rewrite it as a Python script.

 

6 minutes ago, JMichaelTX said:

Since your recovery method includes ALL notes, not just those in Local NBs, one fact any potential user should be aware of is that this could take quite some time, and result in a very large Evernote dataset when you import the recovered file.enex.  I have      20K+ notes, which currently require ~15GB of space.

Yes. For me, I'm almost entirely using Evernote for text notes so while I had a lot of notes (~7000), they were all mostly text and so resulted in an enex file of only ~30MB.

Link to comment
  • 3 months later...

@tmgallagher

The commands it relies on are:

  1. find - should be standard on any Linux/Unix OS
  2. uuidgen - this may be not be standard on your OS (but should be easy to install using package manager - or homebrew on MacOS)
  3. date - should be standard on any Linux/Unix OS

Of these I'd check whether "uuidgen" is installed.

Also, in linux you do need to run:

./recover-evernote-enml.sh > file.enex

With the "./" before the script if you are running it from the current directory you are in (due to the way Linux $PATH works). I've updated the README to indicate that.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...