1

My Mac was updated to Sierra and, although I can use the Notes app just fine, it erased all my previous notes and I don't have a backup in Time Machine or iCloud.

I tried to recover them from the library and changed the extension to .html (for example: NotesV2.storedata-wal.html) but when I open it in a browser it just code garbage.

How can I get my notes back?

  • Did you make a clean install or just an upgrade to Sierra? – Mattia Righetti Jun 18 '18 at 9:04
  • It was upgraded. – Annie Jun 20 '18 at 1:58
  • aren't notes backed up in iCloud? – So Lo Dec 5 '20 at 11:58
2

It might be possible to recover the text of your notes. I cannot gaurantee this will work for you, but I've tried this in High Sierra and it worked for me. There might be an easier way, I'm not sure.

Using Finder or Terminal check in the following directory (Note - this may well be a different directory from the one you tried first)

~/Library/Group Containers/group.com.apple.notes

for the following file

NoteStore.sqlite

(In Finder, select Go->Go to Folder, enter ~/Library/ , then navigate to the dir shown above)

If this file exists, copy it to your Desktop. (Otherwise, sorry, game over, although someone else might know otherwise)

You will now need mac_apt (macOS Artifact Parsing Tool) to analyse this file.

Download a compiled bundle of mac_apt for macOS from

https://github.com/ydkhatri/mac_apt/releases

I had to use the 10.13 bundle on High Sierra.

Using terminal, then cd into the mac_apt directory you have downloaded.

cd ~/Downloads/<name of mac_apt directory>

You should see the following two files:-

mac_apt_singleplugin.app
mac_apt.app

Now you need to run mac_apt_singleplugin.app to analyse your Notes sql notes db

In terminal, run the following in the mac_apt download directory

./mac_apt_singleplugin.app/Contents/MacOS/mac_apt_singleplugin -i ~/Desktop/NoteStore.sqlite -o ~/Desktop/NotesOutput NOTES

This should create ~/Desktop/NotesOutput

Inside this directory will be a log .txt file, and if you are lucky, a Notes.csv file. The csv file can be opened in any spreadsheet e.g. Numbers, and you can search through its fields to find the text of your notes if they were in the original file. You can copy / paste these into text files. Alternatively it might well be possible to run a script to pull out particular csv fields into individual text files - someone here may be able to help you with that particular problem.

  • Thank you for your answer, but I'm afraid the file NoteStore.sqlite doesn't exist :c the only files i managed to find were: com.apple.Notes (which is blank) And NotesV2.storedata-shm NotesV2.storedata-wal NotesV2.storedata But as mentioned above, they are just trash code :/ I tried looking for more answers, and some people mention "SQLite code" but I have no idea how that works. – Annie Jun 25 '18 at 1:40
1

Here's what worked for me :

  • locate the original (corrupted/damaged) NoteStore.sqlite as described in the previous messages (make a backup copy just to be sure)

  • fix the db with sqlite3 https://www.sqlite.org/download.html

  • The ".recover" command worked for me :

sqlite3 broken.db ".recover" | sqlite3 new.db

(where broken.db is the original NoteStore.sqlite)

I also had tried the ".dump" one but it didn't work (the procedure described here https://docs.locusmap.eu/doku.php?id=manual:advanced:map_tools:corrupted_sqlite ).

Rename new.db to NoteStore.sqlite and paste it where the original one was in the ~/Library/Group Containers/group.com.apple.notes folder, leaving the other two original files (shm and wal).

Restart you macbook, and then (at least for me) the notes were back in their place (including the ones protected by password, that in my case were not recovered my mac_apt).

Note that I performed the sqlite3 step on windows 10, but I guess that the precompiled MacOS version that you find on the official website should work in the same way.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .