Bugs & Fixes: Saving your Notes from disaster

Apple’s Notes (available both for OS X and iOS) has long been one of my most frequently used apps. With its improved cross-platform syncing in recent OS iterations, the app is better than ever. If I create a note on my iPhone while away from home, it’s waiting for me on my Mac when I return—and vice versa. The Notes user interface is almost identical across platforms, making it especially easy to navigate between the two. That’s why, whenever I want to jot down and store snippets of information, Notes is my go-to app.

“But wait!” I can hear the naysayers out there. They are reminding me that there are other note-taking apps, ones that similarly offer cross-platform syncing, but have more extensive editing options. They also include useful features missing from Notes, such as an ability to store images or organize notes in category folders. Evernote is one such app. I do use Evernote. It’s great. But I still keep coming back to Notes precisely because of its barebones simplicity. Too often, when I just want to record some brief text (especially if I don’t intend to save it for an extended time) the multitude of features in apps such as Evernote seem to get in my way rather than offer benefits.

That said, there is one limitation of Notes that is quite serious. It’s so serious that it is almost a deal-breaker for me: The way OS X stores notes is so obtuse that, if you unintentionally delete a note and the Undo command cannot bring it back, recovering the file will be a hassle at a minimum and, at worst, all-but-impossible. At the very least, this makes Notes a poor choice for long-term storage of important data. To be fair, apps such as Evernote share some of the same problems. But they typically have better recovery options than Notes.

Disable internet access

The near immediate syncing of Notes among your Apple devices, normally an asset, becomes a liability here. It means that if you delete a note on your iPhone and go to your Mac in the hope of retrieving it, you’ll likely find that it’s gone from your Mac as well. With a bit of luck, you might be able to prevent this mass destruction by disabling Internet access on your synced devices as soon as you discover your error. If this succeeds, you will be able to retrieve the deleted note. Just copy the text to another location and you can then turn Internet access back on.

Retrieve from storage

If it’s too late for this trick, you may still find the deleted text within the files Notes uses to store its data on your Mac. Here’s where the road can get really rocky. If Notes saved each item as a separate readable file (as most apps do), and moved deleted items to the Finder’s Trash, it would be a breeze to recover deleted notes. Unfortunately, Notes does not do this. Rather, all notes are combined into a single database-like file. The one upside here is that this file may retain the text of recently deleted items.

The first obstacle to using this method for recovery is finding Notes’ storage location. It’s not at all obvious. You’ll find it in your home Library at ~/Library/Containers/com.apple.Notes/Data/Library/Notes/. To go there, enter the path string in the Finder’s Go to Folder window; this works whether or not the Library folder is invisible on your Mac.

Notes data are stored in the files in this Library subfolder.

Once inside this folder, you should see a small assortment of similarly named files, with names such as NotesV2.storedata. The text of all your notes, typically including recently deleted notes, is stored within one or more of these files. Unfortunately, the format of these files does not make it easy to view the content of each note. To recover an individual note, you have a bit more work to do.

1. The two files that offer the best bet for data recovery are the .storedata and (especially!) the .storedata-wal files. Make a copy of these files and move them to a separate location, such as the desktop.

Making copies is a common safeguard. You’ll work with these copied files. In case anything goes wrong, the original files remain untouched and in place.

2. Add an .html extension to the name of the copied files, confirming that you want to make this change when the question dialog box pops up.

As it turns out, these files employ HMTL tags. Adding the extension allows the critical text to appear in a more easily readable format.

3. Open one of the files in a text processing app (such as TextEdit) or in a web browser. Interspersed among all the cryptic text should be readable versions of both your current and recently deleted notes. Because there can be a lot of data here, I suggest using the app’s search feature to locate the text you want to recover. Once you have, copy and save it to a separate location. If the first of the two files does not bear fruit, try the other.

Retrieve from backup

If you are unable to recover the deleted data via either of the two previous methods, you have one final option—assuming you’ve been backing up your data with Time Machine (or similar software). To do so, enter Time Machine and locate a version of the Notes storage folder that just precedes your deletion. Replace the current folder in your Library with the backup version (first making a copy of the current folder). When you next launch the Notes app, your missing file should reappear. If so, you can now transfer the recovered data to another location. When done, return the current Notes folder to the active location, deleting the backup version, and you are back in business. Although I haven’t tried this method myself, articles I’ve read online confirm that it works.

These recovery hassles may be sufficiently onerous to convince you not to bother with Notes. If so, I understand. In my case, I have been using Notes for years and have never once lost any data. Maybe I’m lucky or maybe I’m just extra careful. Either way, given my successful track record, Notes remains my preferred choice for quick note taking.