Notes Disappeared: Backup Files Crashing Notes

Hi Apple Community!


This morning I opened my Notes application and it was blank. I don't sync with iCloud, but rather I use "On My Mac" notes and manually sync the "~/Library/Group Containers/group.com.apple.notes" data folder with Google Backup & Sync.


I found the files for my old notes under "~/Library/Group Containers/group.com.apple.notes/Backups":

NoteStore.sqlite

NoteStore.sqlite-wal


When I try to restore my old notes by dropping these 2 old files back into "~/Library/Group Containers/group.com.apple.notes", replacing the new files created, it doesn't work. When I open Notes again I see my old notes for a few seconds, and then the application crashes giving me the attached report and replacing the 2 old files with 3 blank ones (NoteStore.sqlite, NoteStore.sqlite-shm, NoteStore.sqlite-wal).


I've tried restoring the notes unsuccessfully after:

  • restarting my computer
  • with a VPN on
  • with my WiFi turned off,
  • after deleting everything associated with the Notes application (starting from scratch)
  • on another laptop


My Computer:


Can anyone help me make sense of the crash report (attached below)? I believe either NoteStore.sqlite or NoteStore.sqlite-wal is corrupted.


What else can I try?



Posted on May 12, 2021 11:03 AM

Reply
Question marked as Top-ranking reply

Posted on May 12, 2021 9:12 PM

Solved the issue!


I just had to find a backup of all 3 files from last week. I dropped those into the Group Containers folder and it worked.

Similar questions

2 replies

May 12, 2021 5:38 PM in response to thatcoldguy

As you're using Catalina it would be better to post your question in the Catalina community rather than the Mojave community as there may be differences which affect the reply.


I am not a developer so cannot help you understand the report but there are a couple of things which I'd question.


Firstly, you say you put the 2 files NoteStore.sqlite and NoteStore.sqlite-wal into the appropriate directory. Do you not have a backup of NoteStore.sqlite-shm? I have never tested to see what would happen to an SQLite database if this index file was removed but since SQLite uses all 3 files it wouldn't surprise me if one being missing causes problems. If it is attempting to use a cached index which is for a different database (ie the one with your notes missing) then there will be mismatches which may be causing the crash.


Secondly, you don't mention the cache files. Replacing (some of) the database files but leaving in the cache files from before the replacement may also cause problems. I think the main cache should be in

~/Library/Group Containers/group.com.apple.Notes/Data/Library/Caches/

but there may be others.



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Notes Disappeared: Backup Files Crashing Notes

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.