13

I need to export the chat history of an iMessage chat to either a text or PDF file.

I realize this is a common question, but I ask it again because preferably, each message should have beside it a record of:

  1. The sender, and
  2. a time/date-stamp for when the message was sent.

Is there a way to do this without having to download costly software? I am relatively experienced with Mac software and could potentially navigate scripting (I am most experienced with Python3, but have some limited experience with AppleScript), Terminal, and/or other techniques on the advanced side in this fix if walked through the steps.

bmike
  • 235,889
  • 4
    Is https://apple.stackexchange.com/questions/200328/is-there-a-way-to-either-save-copy-or-email-an-entire-imessage-conversation good enough, or do you want every single message to be timestamped independently? If so, you may have to do some crawling through the chat.db, or use a third party tool. Take a look at https://github.com/aaronpk/iMessage-Export – JMY1000 Jan 04 '18 at 10:24
  • I love that we can use the command line tools to do this. Apps like PhoneView do an amazing job at archiving and moving all sorts of data, but this narrow item doesn't require a purchase. – bmike Dec 20 '18 at 12:52

1 Answers1

13

First, make an iTunes backup, then find your iTunes backup folder:

macOS

~/Library/Application Support/MobileSync/Backup/

Windows

%APPDATA%/Roaming/Apple Computer/MobileSync/Backup

There will be one randomly named folder, except you have backed up more devices with iTunes. In that folder, there is database file with your messages.

You can open it using free SQLite database viewer and/or export the contents to CSV file format.


If you have a mac, you can simply

  • open Messages app
  • sign in (if you are not)
  • select the particular conversation
  • File > Print > Save (output will be in PDF)

The result doesn't look great, but it does contain all the images and the text is searchable.

Your messages database is stored in ~/Library/Messages/ under chat.db, so you can export it using SQLite database viewer as stated above, but the pictures and other files are stored in ~/Library/Messages/Attachments.