Hey there for everyone. I had the same problem, I wanted to restore my notes from my Time Machine Backup.
So its quite easy. You just open:
and the same path but on your backup. Then you copy the Folder with the large number onto your hard disk.
And the last thing you have to do is to open:
and replace the SQlite databases with the ones of your Timemachine Backup.
Im not using iCloud so I dont know if this will work out when you sycn the next time. For me its okay
This shell-command tells sqlite to write all your notes to a single text/html file:
echo 'SELECT * FROM ZNOTEBODY;' | sqlite3 ~/Library/Containers/com.apple.Notes/Data/Library/Notes/NotesV1.storedata > ~/notes.html
As others pointed out, the notes reside in ~/Library/Containers/com.apple.Notes/Data/Library/Notes/ . If you want to restore your notes with Timemachine, you have to restore the whole directory, containing of NotesV1.storedata, NotesV1.storedata-shm and NotesV1.storedata-wal (these files seem to depend on each other). You can also copy this directory from Timemachine to anywhere on your filesystem and extract the notes with sqlite.
For example copy the directory to your desktop and run
echo 'SELECT * FROM ZNOTEBODY;' | sqlite3 ~/Desktop/Notes/NotesV1.storedata > ~/Desktop/notes.html
Works great for me!
I haven't tried your instructions, but in the name of the whole community and people who care and use notes for hundreds of their notes (as it should be as it's the only app that supports the built-in iphone/ipad spotlight function and Siri) I heartily thank you.
Thank you for sharing your hard earned knowledge. I'll try it and sleep better.
Alright: couldn't resist and tried it.
Yes, my current iCloud stored notes were saved in a huge, badly readable and non formatted HTML file. At least the text would have been backed up in this case so the loss would be less dramatic. Still, no workable restore at this point.
****, APPLE, why don't you let us just drag and drop those notes to a folder, zip them up, and when needed drag them back to the notes.app?!
[sorry for the rant, i'm so %$#$%@]
Notes are stored on your computer (just like contacts, calendars, mail etc) and are backed up by any local backup system, such as Time Machine.
Nice thought. Please try, before you post. Time machine, with the advent and intro of iCloud has lost a lot of functionality.
Of course it would be easier to restore single notes if they were plain text files. But the format the notes are stored in is not as proprietary and obscure as I first thought. (Only the file-extension "storedata" is.) Actually it's just a sqlite-database that can be read and modified quite easily, as I found out now: There's a Firefox-extension called SQLite Manager that you can use to browse all of your notes - even ones that where previously deleted! Although I don't know for how long deleted notes are kept (and if all of them are kept), I can confirm that I saw one in there that I had deleted weeks ago.
I hope that helps!
I just found your post today...
There are a few things about this program I'd like changed, but it does "exactly" what I wanted done (a solid backup of the information on my IPHONE to my PC)
Of course you already knew this, but I wanted to thank you for the post. I'm really irritated with Apple for making this so difficult for me and irritating for so long. I bought the program and it allows "anything" to be saved locally. I haven't explored all the options, but I have the backup running now. I don't see a restore yet, but again, I do have the data.