Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

My Notes disappeared, how can I read the "storedata" files?

Hi there, I am using a Macbook Air 13", running High Sierra 10.13.4, and Notes version 4.5


So, yesterday night I decided to figure out why my Notes weren't syncing between my Mac and my iPhone (which I've had since February, and all this time Notes never synced across the devices).

Turns out that on my Mac, Notes had set as default folder "Google" - puzzled by this, I promptly set it to "iCloud". At that, my Mac started downloading all the notes from my iPhone, and the app crashed. When it opened again, the only Notes that were left there (in the iCloud notes folder) were: the iPhone's notes, and the Mac's notes that were created previously to having my iPhone.

All the notes that I wrote on my Mac, within the last 3 months, are gone.

Even the "Google" folder on my Mac's Notes app (which is where they were supposedly stored so far) is now empty; and there is no trace of said notes in my Gmail, or on any another mail account linked to my Mac, nor on iCloud.


My interpretation, developed also after talking with staff from the genius bar (who weren't immensely helpful, though) is that when I started using iCloud and Notes on my new iPhone, somehow the Mac's Notes started to be stored in Google, rather than iCloud; but since Macs cannot take decision on their own volition, probably this never really happened and my Mac's Notes were simply not synced anywhere in these 3 months.


I have written all of this in case somebody has a better explanation for the phenomenon, or alternative suggestions.

However, as read elsewhere in the forum, I think that my best chance is to recover these Notes from the "library" files, such as "NotesV7.storedata" and "NoteStore.sqlite". However, when opening these files as html in my browser, all I can see is text like:

"> *  A ”[ > %  ”Z >* $ ”Y > * Œ € ”X >* ‹ ”W > * ‹ ”V > % Š ”U >* Š$ ”T > * Š A ”S > * ‰ ”R >"


Why do you think that I'm unable to read these files correctly? Any suggestions?

Thank you so much, I have an exam in ten days and several chapters of my notes were in there........ 😢

MacBook Air, macOS High Sierra (10.13.4)

Posted on May 25, 2018 5:37 AM

Reply
Question marked as Best reply

Posted on May 26, 2018 5:49 AM

  1. Open a new blank document in TextEdit
  2. Open Terminal
  3. Paste in this command:

    sqlite3 ~/Library/Containers/com.apple.Notes/Data/Library/Notes/NotesV7.storedata

  4. Enter the following commands at the sqlite> prompt:
    • .mode csv
    • .headers on
    • .output '| open -f'
  5. Paste in this set of SQL statements (you can select it all and paste in):

select f.ZNAME AS Folder, n.ZTITLE AS Title, b.ZHTMLSTRING AS NoteHTML

from ZNOTE n

inner join ZFOLDER f ON n.ZFOLDER = f.Z_PK

inner join ZNOTEBODY b ON n.ZBODY = b.Z_PK;


Enter .exit at the sqlite> prompt to leave Sqlite3 and put the output into TextEdit.


That should dump out the Folder, Title, and HTML for the Note into a Comma Separated table.

You can then Save the file with a .csv extension and re-open it in a Spreadsheet (or just use it as is).

The file will have an odd name and a txt extension. Use the filename editor in the Titlebar to save it somewhere else with a useful name and csv extension, like Notes.csv.


If you copy each HTML string and paste into a text file, you can save each note with an .html extension. You can open those with a browser (double-click) then probably copy/paste back into Notes.

I don't know how much formatting will remain, but you should get all of the info back.

Similar questions

3 replies
Question marked as Best reply

May 26, 2018 5:49 AM in response to valentina157

  1. Open a new blank document in TextEdit
  2. Open Terminal
  3. Paste in this command:

    sqlite3 ~/Library/Containers/com.apple.Notes/Data/Library/Notes/NotesV7.storedata

  4. Enter the following commands at the sqlite> prompt:
    • .mode csv
    • .headers on
    • .output '| open -f'
  5. Paste in this set of SQL statements (you can select it all and paste in):

select f.ZNAME AS Folder, n.ZTITLE AS Title, b.ZHTMLSTRING AS NoteHTML

from ZNOTE n

inner join ZFOLDER f ON n.ZFOLDER = f.Z_PK

inner join ZNOTEBODY b ON n.ZBODY = b.Z_PK;


Enter .exit at the sqlite> prompt to leave Sqlite3 and put the output into TextEdit.


That should dump out the Folder, Title, and HTML for the Note into a Comma Separated table.

You can then Save the file with a .csv extension and re-open it in a Spreadsheet (or just use it as is).

The file will have an odd name and a txt extension. Use the filename editor in the Titlebar to save it somewhere else with a useful name and csv extension, like Notes.csv.


If you copy each HTML string and paste into a text file, you can save each note with an .html extension. You can open those with a browser (double-click) then probably copy/paste back into Notes.

I don't know how much formatting will remain, but you should get all of the info back.

May 26, 2018 1:03 AM in response to Barney-15E

Hi there, thank you for answering!


- Do you mean Google's app "Keep"? No, unfortunately they aren't there.


- Mmh I'm afraid I don't know SQL, but if there's some steps that I could follow I would happy to learn in order to retrieve my notes! I tried to open them in the Terminal, but the Terminal won't import those files so I guess I'd need to copy and paste them?


- Searching for "ZNOTEBODY" in the html "NoteStore.sqlite", if that's what you meant, unfortunately returns nothing. However it appears 22 times in the "NotesV7.storedata" file, and 108 times in the "NotesV7.storedata-wal" file! Is that a positive or negative sign?

My Notes disappeared, how can I read the "storedata" files?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.