Need to open chat.db file in readable format

I know that you can recover deleted message threads if you have the preference to save them after closing a thread selected. I didn't have that preference selected though, and recently deleted a bunch of conversation threads.


Now, a situation has arisen in my workplace where I need to prove a colleague said certain things to me (why oh why did I delete that thread?). Going to Library>Messages, I have the 'chat.db' file, which I've gone through and saw that the text of several of the deleted messages are still there, but the format is totally illegible and doesn't actually show who said them. I've tried using sqlite3, but the 'open' command isn't doing anything.


Does anyone know how I can restore these messages into a meaningful transcript? I could be in serious trouble if I can't access this database.


Thank you all so much.

MacBook Pro, OS X Yosemite (10.10.3)

Posted on Aug 7, 2015 5:29 PM

Reply
5 replies

Aug 7, 2015 7:18 PM in response to a.reiman

My question was, how do you back up all data? If you don't know what I mean, then you have no backups, and the database can't be restored. If you don't start backing up, you will inevitably lose every bit of data you have, sooner or later.


The message contents are stored in the database in a form that no SQL editor can read. A database expert might be able to reverse-engineer the schema and come up with a way to extract the messages, but that's a job for which you would have to hire a consultant. If you want to go that route, move the database files somewhere else so that the data won't be overwritten by Messages.

Aug 7, 2015 5:40 PM in response to a.reiman

You can only restore the whole message database, not individual messages or conversations. This procedure will replace the existing database with an earlier version, so you'll lose all later changes. If you don't want that to happen, move the folders indicated below to the Desktop before you restore, then put them back where they were after you copy the contents of the messages you're interested in.

1. Sign out of iMessage and all other IM accounts, if any. Quit Messages. Hold down the option key and select

Go Library

from the Finder menu bar. A folder window will open.

2. Restore the subfolder named "Messages" from a backup that predates the unwanted changes.

3. If you're running OS X 10.9 or later, also restore the subfolder

Containers/com.apple.iChat.

4. Log out and log back in.

If you don't have a backup, the archive can't be restored.

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.

Need to open chat.db file in readable format

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