Where does OS X Mountain Lion store Notes data?

15

9

Any idea about where OS X Mountain Lion stores Notes data? Is there a way that I can recover lost Notes?

lucemia

Posted 2012-08-22T04:56:24.083

Reputation: 253

Answers

20

Notes are stored as HTML in an apparently non-standard binary format in ~/Library/Containers/com.apple.Notes/Data/Library/Notes/NotesV1.storedata-wal.

You can grep for known note contents on the command line, or print all notes (stored as HTML):

cat ~/Library/Containers/com.apple.Notes/Data/Library/Notes/NotesV1.storedata-wal | grep -aio '<html>.*</html>'


While I was writing this answer, I also had the problem once that Notes restarted with data reset. The next launch, everything was there again, even though I had created new notes after the reset (so both the old and new notes existed on third launch). Maybe just try quitting and starting Notes again?

Daniel Beck

Posted 2012-08-22T04:56:24.083

Reputation: 98 421

thanks. But it looks like the note is totally lost.... – lucemia – 2012-08-22T06:32:24.550

Most of my (local) notes are in ~/Library/Containers/com.apple.Notes/Data/Library/Notes/NotesV1.storedata. – Lri – 2012-09-27T18:19:01.850

1Thank you. Presumably "wal" indicates a write-ahead log. The very first (and now probably only) time I used Notes in Mountain Lion, it ate the substantial note I composed. With your pointer I was able to recover data. – ches – 2013-02-06T12:57:19.693

I found 'strings ~/Library/Containers/com.apple.Notes/Data/Library/Notes/NotesV1.storedata-wal | open -f' a useful command for recovering a lost note! – gawbul – 2013-08-08T13:44:57.243

3

I found this article which appears to help: http://applehelpwriter.com/2013/03/02/how-to-recover-disappearing-notes/

cd ~/Library/Containers/com.apple.Notes/Data/Library/Notes; strings NotesV1.storedata | grep body | open -f

Matt

Posted 2012-08-22T04:56:24.083

Reputation: 141

Why -1 on this I wonder? I thought it was a decent article! Personally I found it easier to do a 'cd ~/Library/Containers/com.apple.Notes/Data/Library/Notes; strings NotesV1.storedata-wal | open -f' – gawbul – 2013-08-08T13:42:11.153

2

On OS X Lion (10.7), I found my notes in the file below.

~/Library/StickiesDatabase

Clinton Blackburn

Posted 2012-08-22T04:56:24.083

Reputation: 121

2You're referring to Sticky Notes. However, the question is about Notes.app, the OS X version of iOS Notes.app, which was introduced in Mountain Lion and did not exist in Lion. Perhaps this should be clarified... – BoltClock – 2012-09-27T16:27:20.713