NotesSo, I use Apple Notes to store almost everything I jot down. For whatever reason, there is an “On My Mac” section of Notes, and an “iCloud” section of Notes. The latter is obviously synced to iCloud.  I always use this portion as it syncs with my other devices and works pretty well.  It has some syncing issues when tricky situations occur (such as the same note being edited on two devices at once), but for the most part it’s always been pretty “safe” and conservative about the way it handles tricky situations as long as I use it wisely.

That is, until now.

This is a bit of a novel, so TL;DR:  Apple Notes, while handy, is unreliable in terms of syncing. I would wager most any Notes platform is unless they’re extremely careful.  Take regular backups of things that are in the Cloud, and try to use a Notes client that supports bulk Import/Export.

I made the mistake on Friday (Jun 5th) of renaming one of my Notes folders within iCloud to “Work / Bill“.  (Bill is a coworker.)  It didn’t occur to me that special characters would ever matter in a Notes folder name, because (a) input validation is something a company like Apple should have down pat, and (b) because the “folders” in Notes aren’t real folders in the traditional sense, like you’d find in a filesystem. All notes are stored in a single database file anyway, so folders are more akin to Tags that just behave like folders.  This makes sense for how the program operates and in any normal scenario, special characters (outside of maybe SQL commands) should have no impact.

Anyhow, this rename was a mistake.  I didn’t realize it until today (Monday), but Notes had busted my folder of 50 some-odd notes into two separate folders, “Work” and “Bill”.  This was very troubling, especially since Bill now seemed to be a child of the Work folder and I didn’t even know having child folders was possible. I quickly realized what had happened, and noticed that “Bill” contained no notes at all. I checked the main “All Notes” section to see if they were there. They weren’t.

I paniced a bit. This is a database and these were folder tags – this makes no sense that the NOTES are gone.. only their metadata should be.  In an effort to solve the problem, I renamed both folders again to something different and valid. This time, both disappeared from the “iCloud” portion of Notes and went into a new, Recovered Items section of the “On My Mac” portion. I clicked the folders, and again they were empty. The notes were gone. Nothing. Poof.  Frantically checked www.icloud.com/notes hoping it would have the correct data and this was just a syncing problem with the client. Nope, nothing.

This was now a big problem. Years worth of tribal knowledge was seemingly gone. Luckily, after my last Mac debacle I have yet to post, I had Time Machine up and running, which meant I had a recent backup.

I called Apple Support, and while they were more helpful and technically versed than I expected, they were ultimately no help. They let me know where the database file was which was nice, but informed me there is no way to “roll back” notes that have disappeared from iCloud.  In a normal scenario where notes were actually /deleted/, there are ways they can help. Apparently Notes are considered part of Mail on the iCloud end, and they can perform an operation to undelete anything you’ve deleted.. problem is, I never deleted anything.  They tried this anyway and ended up cluttering up All Notes with a bunch of stuff that I had deleted previously – nothing I was actually missing came back. I now had a corrupted database on both iCloud and my Computer.

At this point, I had a massive amount of work to do and needed some of the data. I disconnected from the internet, restored an old database file (I had to go all the way back to Thursday), and got what I needed. I discovered there is no Export / Import function of Apple Notes that is of any use. That alone should be enough for me to quit using it, but damn it it’s handy.. :(  Anyway upon reconnecting to the internet, all of my older notes were destroyed again.. iCloud basically took over with what content was in the cloud. In a way this makes sense if a device is massively outdated, but man.. I figured syncing issues like this would have been solved by a company like Apple in 2015.

I haven’t had time to completely fix this issue yet, but next up on the list is probably to tear apart the Notes database and extract the records one by one.. the question now is how I’m going to get them to sync back up into iCloud since the moment I connect, everything is erased by iCloud’s content. I’d wager I’m going to have to manually extract Note content record by record and place it into a new note, and I suspect all my old ones that are no longer visible are actually still in iCloud’s database, just corrupted in such a way that the app won’t display them. The only solution for that would be to purge the iCloud database and start over, but outside of deleting my account, that likely isn’t possible. Getting someone technical on support is also a nightmare.

Apple, shame on you for (a) not validating user input for folder renames, (b) not displaying folders at all within iCloud, (c) not having an Import/Export bulk feature for christ’s sake, and (d) not giving users the ability to control which direction syncs occur when conflicts arise, and/or purge the iCloud side of things. You’ve cost me a lot of time and potentially years worth of data because of poor design practices.

[ Update! Resolved this in a pretty easy manner! See Part 2 of this post. ]