Restore Messages using Time Machine (not iCloud synced)

I've made a stupid misclick and deleted 4 years worth of Messages conversation with my significant other. They're not synced to iCloud, but I do have a recent Time Machine backup. I thought I could restore it from there, and I followed older how-to's (older because they are about iMessages, and I am using Messages on Big Sur).

What I've tried:

  1. close Messages
  2. restore the whole Library/Messages folder from Time Machine
  3. reopen Messages

Not only did it not work, but it screwed up absolutely all conversations as well. Now, every time I click on a contact's conversation, it disappears. It's like they're in cache, but it can't find them in the database when it tries to load them in full.

So: how do I restore my Messages database from a Time Machine backup?


Solution 1:

OK I've tried a few different things, and I've got something that works. There are two key points:

  1. You need to restore the whole Library/Messages folder (not just chat.db, as is said in most how-to's)
  2. Before you do this, you need to close Message. But also, after you restore, you need to reboot the Mac.

Doing all of these things (close, restore whole folder, reboot) means that when you restart and open Messages, your backed-up version is present and functional.

Phew!