Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Converseallstar95

macrumors member
Original poster
Sep 24, 2008
31
13
So I did I fresh install of El Capitan and wanted all my messages (SMS/iMessage) from my iPhone, as I lost the message on my computer, so I made a backup through iTunes, then used iExplorer to extract the "sms.db" and the "Attachments" folder from the iPhone backup. I then deleted the "com.apple.iChat" container in my user library, and copied the "sms.db" (renaming it "chat.db") and the "Attachments" folder to the "Messages" folder in my user library. After I opened the Messages app, all the conversations were there (SMS/iMessage), but the attachments in each conversation showed, for example, "IMG_4271" with a question mark. How can I associate all the attachments with the correct conversations (I don't mind doing it manually with a .db file editor or something)? Thanks!
 
  • Like
Reactions: DBird846

boston04and07

macrumors 68000
May 13, 2008
1,834
935
So I did I fresh install of El Capitan and wanted all my messages (SMS/iMessage) from my iPhone, as I lost the message on my computer, so I made a backup through iTunes, then used iExplorer to extract the "sms.db" and the "Attachments" folder from the iPhone backup. I then deleted the "com.apple.iChat" container in my user library, and copied the "sms.db" (renaming it "chat.db") and the "Attachments" folder to the "Messages" folder in my user library. After I opened the Messages app, all the conversations were there (SMS/iMessage), but the attachments in each conversation showed, for example, "IMG_4271" with a question mark. How can I associate all the attachments with the correct conversations (I don't mind doing it manually with a .db file editor or something)? Thanks!

So first of all, I have no idea how to fix the attachments issue, so sorry about that. I just wanted to say that I've long been wanting to do exactly what you just did - transfer iPhone message threads to my Mac for safekeeping, and have them available in the Messages app. Most of the apps I've found that transfer messages from the iPhone export them to a PDF or something, which isn't what I want. I have threads on my phone going back to my first iPhone years ago, way before Messages on the Mac was a thing. I may just try this! It sounds pretty genius. :) I'll be watching this thread too, hopefully you'll get a solution to this problem!
 
  • Like
Reactions: DBird846

Converseallstar95

macrumors member
Original poster
Sep 24, 2008
31
13
So first of all, I have no idea how to fix the attachments issue, so sorry about that. I just wanted to say that I've long been wanting to do exactly what you just did - transfer iPhone message threads to my Mac for safekeeping, and have them available in the Messages app. Most of the apps I've found that transfer messages from the iPhone export them to a PDF or something, which isn't what I want. I have threads on my phone going back to my first iPhone years ago, way before Messages on the Mac was a thing. I may just try this! It sounds pretty genius. :) I'll be watching this thread too, hopefully you'll get a solution to this problem!

If you need help transferring messages from your iPhone, let me know, as I've done it plenty of times and it always works!
 
  • Like
Reactions: DBird846

Converseallstar95

macrumors member
Original poster
Sep 24, 2008
31
13
Update: In a conversation after the transfer, all attachments appear correctly, so I located a correct attachment and replaced the file with a different one/renamed it the same and the new image appeared in the conversation thread; therefore, if there is a way to find the expected location of the attachment, I can move everything around. All I can find is the file name (using quick look) though.
 
  • Like
Reactions: DBird846

Mcmeowmers

macrumors 6502
Jun 1, 2015
427
268
Update: In a conversation after the transfer, all attachments appear correctly, so I located a correct attachment and replaced the file with a different one/renamed it the same and the new image appeared in the conversation thread; therefore, if there is a way to find the expected location of the attachment, I can move everything around. All I can find is the file name (using quick look) though.
I'm interested in your method. I was never able to get any old messages to load unless I manually opened them
 

boston04and07

macrumors 68000
May 13, 2008
1,834
935
If you need help transferring messages from your iPhone, let me know, as I've done it plenty of times and it always works!

Hi again @Converseallstar! Thanks for the offer to help! I've finally found myself with the time to try this, so I think I'm going to go for it. Long story short, I've had an iPhone since 2008, and the oldest message threads in my Messages app on my iPhone date that far back. I'm sort of a digital hoarder and don't want to lose them! So it's always bothered me that they're only ever kept on my iPhone, and I've always wanted Messages to have real syncing of backlogs across devices. However, it sounds like your method could work just as well! Just a few questions before I try this, though...

Now that Messages on OS X handles SMS messages, will all the messages on my iPhone transfer across to the OS X Messages app (i.e. not just iMessages, but SMS as well?)

Did you ever solve your issue with the attachments? It sounds like you did, but I just want to double check!

Finally, for new messages coming in after setting all this up, does it work normally? I.e. do new messages from, say, Contact X get delivered to the transferred thread from Contact X or is a new thread created?

Thank you very much for your help with this! If nothing else I'm happy that my old threads will at least be backed up on my Mac! :)
 

Converseallstar95

macrumors member
Original poster
Sep 24, 2008
31
13
Hi again @Converseallstar! Thanks for the offer to help! I've finally found myself with the time to try this, so I think I'm going to go for it. Long story short, I've had an iPhone since 2008, and the oldest message threads in my Messages app on my iPhone date that far back. I'm sort of a digital hoarder and don't want to lose them! So it's always bothered me that they're only ever kept on my iPhone, and I've always wanted Messages to have real syncing of backlogs across devices. However, it sounds like your method could work just as well! Just a few questions before I try this, though...

Now that Messages on OS X handles SMS messages, will all the messages on my iPhone transfer across to the OS X Messages app (i.e. not just iMessages, but SMS as well?)

Did you ever solve your issue with the attachments? It sounds like you did, but I just want to double check!

Finally, for new messages coming in after setting all this up, does it work normally? I.e. do new messages from, say, Contact X get delivered to the transferred thread from Contact X or is a new thread created?

Thank you very much for your help with this! If nothing else I'm happy that my old threads will at least be backed up on my Mac! :)

Regarding SMS messages, it works flawlessly, even with out messages, just make sure you've set up the Messages app on the Mac first, so set up SMS forwarding and everything (Don't worry about what shows up in the mac app as it will all be replaced)

Regarding the attachment issue, not entirely, If I could just figure out a way to see the file location the Mac app references it I can just organize all the folders myself.

After the transfer everything works as expected, iMessages go to the correct contacts, SMS messages go to the correct contacts, iMessages groups, SMS groups, everything. Although, the Mac app combines multiple threads for the same person, i.e., an iMessage to a phone number and email address of the same person will be in the same chat conversation on the Mac, but not the iPhone. I don't understand why Apple hasn't added that feature on the iPhone yet.

Quick list of steps:
Backup iPhone to computer through iTunes
Use a backup extractor/explorer to export the sms.db and the Attachments folder from your iPhone's directories (I use iExplorer)
Make sure Messages on your Mac is set up with SMS forwarding
Go to User/Library/Messages and make a backup in case, then delete the contents and add the sms.db and Attachments folder there
Rename sms.db to chat.db
Go to User/Library/Containers and delete the iChat container

Reboot

Launch Messages and all should we working perfect (Except attachments)
Send some iMessages/SMS messages from your Mac to verify!
 

boston04and07

macrumors 68000
May 13, 2008
1,834
935
Hi again @Converseallstar! I know it's been a while, but I'm just transferring my messages over now - I ended up having to reinstall a fresh copy of OS X due to an unrelated issue, and now I currently have no messages on my Mac. I followed everything, but for some reason Messages is still displaying no message histories. When I checked the Messages folder in the user library, I found that some new files had appeared there that I'd never added myself. One of them was named chat.db.incompatible.v9006.sqlitedb, and it was there next to the original chat.db file, which is really strange. Any ideas? I'm totally stumped with this one!
 

boston04and07

macrumors 68000
May 13, 2008
1,834
935
So just a few minutes after my last post, on a whim, I decided to change the chat.db file (the non "incompatible" one) to sms.db just to see what would happen. Now, whenever I try to open Messages, I get a message saying "Messages is updating...the Messages database is being upgraded, please wait while it finishes or Quit Messages and relaunch it later." (I've attached a screenshot). This has been going on for about an hour now, and the progress bar hasn't inched up, but at the same time I have an absolutely enormous Messages database from my phone and my computer's currently doing a bunch of other things in the setup process. Still...thought it was weird.
 

Attachments

  • Screen Shot 2016-05-26 at 6.49.08 PM.png
    Screen Shot 2016-05-26 at 6.49.08 PM.png
    110.9 KB · Views: 411

boston04and07

macrumors 68000
May 13, 2008
1,834
935
Hello again...sorry for all the posts, but I just wanted to let you guys know that no matter what I've done, I just can't get this to work. I'm so bummed!! I've tried extracting the sms.db from both my iPhone and my iPad multiple times but to no avail. It's pretty bizarre. And now for some reason since I reinstalled OS X my old Time Machine backups won't load, so I'm left with a completely empty Messages app. :( I'm open to any and all suggestions anyone might have....I'm kind of pulling my hair out over this!
 

Converseallstar95

macrumors member
Original poster
Sep 24, 2008
31
13
Hi, I've had both of those problems happen to me before. Did you open the messages app and set it all up after your clean install? I think that help solve a lot of the problems. If you didn't, do it now (regardless of what shows up in your messages app now). Reboot. Follow my steps above. Reboot. Then launch messages.

Also, last time I did it (iOS 9 and macOS 10.11) they were on the latest available updates, but I don't think that should make a difference as the .x upgrades are not major, maybe so though.

P.S.
That upgrading popup never finishes I left it open for days. Make sure to extract a new sms.db, as it may have been corrupted on extraction (being such a big database, as you mentioned).
 

boston04and07

macrumors 68000
May 13, 2008
1,834
935
Hi, I've had both of those problems happen to me before. Did you open the messages app and set it all up after your clean install? I think that help solve a lot of the problems. If you didn't, do it now (regardless of what shows up in your messages app now). Reboot. Follow my steps above. Reboot. Then launch messages.

Also, last time I did it (iOS 9 and macOS 10.11) they were on the latest available updates, but I don't think that should make a difference as the .x upgrades are not major, maybe so though.

P.S.
That upgrading popup never finishes I left it open for days. Make sure to extract a new sms.db, as it may have been corrupted on extraction (being such a big database, as you mentioned).

Hey @Converseallstar, first of all, thanks so much for all your help with this - I really appreciate it a lot! Yeah, it's been kind of frustrating on my end! I've tried all that you suggested above and it's still not working at all - I end up with my extracted chat.db files getting changed to have "incompatible" in their names and new, empty "chat.db" files generated alongside them. I've extracted the sms.db database like 5 times from my iPhone and iPad to no avail. At this point I kind of want to get it to work just for the sake of solving the puzzle!

I'm running public release beta software on all three devices - no idea if that affects things, but I don't know why it would. I also found this slightly older Github page describing my exact problem and also describing a way to merge the "incompatible" chat.db files into the empty ones, but it's a biiiit too advanced for me, so I'm still at a loss. Maybe I'll try restoring my iPhone's backup on a different non-beta device and seeing if the sms.db files extracted there will work...who knows...
 

Er-c

macrumors newbie
Sep 10, 2016
1
0
Hi,

I'm interested in getting this to work. I encounter the same issues as @boston04and07.

@Converseallstar, since you got this to work and very few others on the internet have had success getting this to work, could you please provide some further insight into how you did this. You're step by step is great and it appears both myself and @boston04and07 have followed it. But perhaps you can clarify even more.

I'm curious to see what the contents of your ~/Library/Messages look like when you load in the Attachments directory and the chat.db. Did you run some sort of SQL magic on it to upgrade the sqlite version? this appears to be at least part of the difficulty.

If we could get this sorted out, it would be a great asset to the community at large.

Thanks.
 

DenBeke

macrumors regular
Aug 11, 2011
192
8
Antwerp
Today I spent a lot of time into trying to copy messages from my iPhone to my Mac. In the end after trying the method described above, I stumbled on this topic and was like the others stuck on transferring the attachments. (and the issue of @boston04and07 with incompatible database)

I then spent some time in the sms.db file and noticed that the paths to the attachments where hardcoded, as well as the version number for the chat.db en sms.db files.
I got everything to work on my Mac! I successfully imported thousands of messages and attachment from my iPhone (running iOS 9.3.2) to my Mac (running OS X 10.11.6). @Er-c @Converseallstar

I explained everything in this blogpost: Exporting messages and attachments from iPhone to Mac
(shameless link to my own blog, but I think it's useful for the others here!)
The blogposts explains everything you have to do. Feel free to ask questions if things are not clear...
 

Converseallstar95

macrumors member
Original poster
Sep 24, 2008
31
13
Hello all,

Sorry for the delay in response, I have been busy with school and haven't had the time to try my method again (I needed too, as Sierra screwed up the .db file on my Mac). I will give it a shot this weekend.

EDIT:
Turns out I was beaten to the solution by @DenBeke just a few minutes before :)
I will now try his solution this weekend and report back. Thanks!
 

boston04and07

macrumors 68000
May 13, 2008
1,834
935
@Converseallstar, @DenBeke, @Er-c...

Thank you all for keeping this going! The "incompatible" files just kept appearing so I kind of stopped trying to make it work for a while, but @DenBeke's method sounds very promising. I knew I needed a way to just get the Mac to recognize that the renamed sms.db files were the same thing, but I had no idea how to do it on my own. I'll try that as soon as I can, hopefully one of the next few weekends. Very cool!

I noticed that @DenBeke did this on 10.11.6 and 9.3.2...I've already upgraded to iOS 10 and the Sierra GM - do you think this method will work there too?

Thanks again everyone, and good luck with school @Converseallstar!
 

Converseallstar95

macrumors member
Original poster
Sep 24, 2008
31
13
@Converseallstar, @DenBeke, @Er-c...

Thank you all for keeping this going! The "incompatible" files just kept appearing so I kind of stopped trying to make it work for a while, but @DenBeke's method sounds very promising. I knew I needed a way to just get the Mac to recognize that the renamed sms.db files were the same thing, but I had no idea how to do it on my own. I'll try that as soon as I can, hopefully one of the next few weekends. Very cool!

I noticed that @DenBeke did this on 10.11.6 and 9.3.2...I've already upgraded to iOS 10 and the Sierra GM - do you think this method will work there too?

Thanks again everyone, and good luck with school @Converseallstar!

My only assumption that will be different in Sierra/iOS 10 is 9007 value from the chat.db (from DenBeke's post). My guess is the value changed in Sierra so look at the number first before you delete the chat.db. And thanks for the well wishes!
 

Converseallstar95

macrumors member
Original poster
Sep 24, 2008
31
13
For those interested, I am trying it now and the client version for Sierra is 10013 :)

EDIT:
Worked as described, all iMessages/SMS/MMS, attachments and files transferred over perfectly. The Mac handles going back farther in history (scrolling up) much better than the iPhone handles it. Tested on iOS 10 and macOS 10.12. Thanks @DenBeke for figuring out the SQLite missing link!
 
Last edited:
  • Like
Reactions: DenBeke

DenBeke

macrumors regular
Aug 11, 2011
192
8
Antwerp
Worked as described, all iMessages/SMS/MMS, attachments and files transferred over perfectly. The Mac handles going back farther in history (scrolling up) much better than the iPhone handles it. Tested on iOS 10 and macOS 10.12. Thanks @DekBeke for figuring out the SQLite missing link!

Thanks for letting us know!
 

Converseallstar95

macrumors member
Original poster
Sep 24, 2008
31
13
Just noticed, as I did it again post-iOS 10, stickers do not transfer (even after copying the StickerCache from the iOS backup), any thoughts @DenBeke?
 

DenBeke

macrumors regular
Aug 11, 2011
192
8
Antwerp
Just noticed, as I did it again post-iOS 10, stickers do not transfer (even after copying the StickerCache from the iOS backup), any thoughts @DenBeke?

I haven't updated to iOS 10 yet, but if you need to copy a folder for the stickers from your iPhone to your Mac, you probably also need to update the paths in the SQL database as you did for the attachments...
 
  • Like
Reactions: Converseallstar95

melchior

macrumors 65816
Nov 17, 2002
1,241
120
I probably should have tried before upgrading to OS X 10.12 but here I am. My phone is 9.3.3

When I follow all the steps, including changing the version number to 10013, I get a list of contacts who have sent me messages, but their messages are not visible.

The Messages folder only has:

Archive
Attachments
chat.db
chat.db-shm
chat.db-wal

Any ideas?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.