That's not working and would be a good suggestion for an enhancement request, I agree.
Like in Mail you mean (and actually this feature is not availble for most apps) and yes, Notes, next to Mail, would benefit most of that feature.
But it actually is being backed up, just not in an easily recoverable form.
Just tested this and it's true for me too. Time for some Feedback to Apple:
They are located in a sandboxed place that is not easy to find:
~/Library/Containers/com.apple.Notes/Data/Library/CoreData/ExternalRecords/blahb lahblah(large hex string!)/IMAPNote/_records/0/p18.notesexternalrecord
Where 18 changes for each note:
I guess they're in IMAPNote because I'm using iCloud?
Hi guys, I accidentally deleted all my notes on my Mac after I decided to stop syncing them via Icloud. Thanks to this thread, I have identified them and used Time Machine to restore them.
I can see them in their /ExternalRecords folders but they do not show up on the app Notes when I launch it.
When I double click on them they show up as a separate window but they are still not listed within the Notes app.
How do I manage to import them back? They are still sitting in the IMAPNote folder. Should I move them to another folder now that I have unticked Notes syncing with Icloud? Many thanks for your help (I use Mountain Lion).
I don't think those are the actual notes, because they're all the same size and opening them with TextEdit gives just a small HTML snippet. They're pointers to something though, because a QuickLook gives the right thing.
Certainly it seems like a document or knowledge base article on how to restore deleted or lost notes via Time Machine would make sense.
So the actual database that you want is a Core Data database.
You would need to restore the contents of your ~/Library/Containers/com.apple.Notes/Data/Library/Notes directory.
There are 3 files in there:
I think if you restore that directory to a point in time you should be able to recover the notes. However, because it syncs with iCloud, there is the possibiilty that they would be immediately deleted again from a server-side command.
Thus, to recover things, you would probably want to disconnect from the Internet (ENTIRELY), then restore that folder (with the core data database), and then move all the notes to local folders, and then re-connect your network connection, and move them back to iCloud.
I'm 99% sure this would work, but I'd hope there is a better way to do this. I may do a little research.
Thanks a million for your assistance.
I did disconnect first the Mac from Internet and restored the contents of ~/Library/Containers/com.apple.Notes/Data/Library/Notes directory. It worked like a charm as I could see again all my previous notes listed in the main window of Notes app.
The hiccup is that it only lists Icloud folders and I can't seem to find a way to create 'On My Mac' folders so that I can copy them to a local folder. The moment I turn internet on, there are automatically deleted as you rightly suspected. If I only wanted to restore them and have them on Icloud that would be just fine. In my case, I want them away from Icloud and only stored locally hence the initial decision to untick the sync with Icloud which triggered the whole havoc...we are getting close though...
I can't find a way to create them "On my Mac" either.
Well, so given that we now know that it's easy to restore the whole thing with Time Machine, here's what I'd recommend:
1) COPY the whole Notes directory with the 3 files to the desktop (hold down Option key and drag it to the desktop, you should see a green + to indicate it's being copied).
2) Now reconnect the network, and see if the notes stay around or they're deleted
If they're deleted, you can re-restore and I can do some more digging to see if there's a way to create an "On my Mac" folder. I know it can exist: If there are local notes it will be shown in the sidebar. But if there are no local notes, I can't find a way to create it.
Well I am afraid icloud keeps deleting them - at least I have now a copy with me handy on teh desktop and I can consult them at my leisure as long as I keep offline when I do it!! .
I will do some research as well - the key really as you put it would be to create a local folder in Notes...not yet there!