Transfer Messages/attachments from iPhone backup to Mac Messages app

Discussion in 'OS X El Capitan (10.11)' started by Converseallstar, Nov 16, 2015.

  1. Converseallstar macrumors newbie

    Joined:
    Sep 24, 2008
    #1
    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!
     
  2. boston04and07 macrumors 65816

    boston04and07

    Joined:
    May 13, 2008
    #2
    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!
     
  3. Converseallstar thread starter macrumors newbie

    Joined:
    Sep 24, 2008
    #3
    If you need help transferring messages from your iPhone, let me know, as I've done it plenty of times and it always works!
     
  4. Converseallstar thread starter macrumors newbie

    Joined:
    Sep 24, 2008
    #4
    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.
     
  5. Mcmeowmers macrumors 6502

    Joined:
    Jun 1, 2015
    #5
    I'm interested in your method. I was never able to get any old messages to load unless I manually opened them
     
  6. Converseallstar thread starter macrumors newbie

    Joined:
    Sep 24, 2008
    #6
    I'm not quite sure what you mean, but I'd be happy to help!
     
  7. boston04and07 macrumors 65816

    boston04and07

    Joined:
    May 13, 2008
    #7
    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! :)
     
  8. Converseallstar thread starter macrumors newbie

    Joined:
    Sep 24, 2008
    #8
    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!
     
  9. mcvaughan macrumors 6502

    Joined:
    Aug 9, 2007
    Location:
    Houston, TX
  10. boston04and07 macrumors 65816

    boston04and07

    Joined:
    May 13, 2008
    #10
    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!
     
  11. boston04and07 macrumors 65816

    boston04and07

    Joined:
    May 13, 2008
    #11
    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.
     

    Attached Files:

  12. boston04and07 macrumors 65816

    boston04and07

    Joined:
    May 13, 2008
    #12
    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!
     
  13. Converseallstar thread starter macrumors newbie

    Joined:
    Sep 24, 2008
    #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).
     
  14. boston04and07 macrumors 65816

    boston04and07

    Joined:
    May 13, 2008
    #14
    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...
     
  15. Er-c macrumors newbie

    Er-c

    Joined:
    Sep 10, 2016
    #15
    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.
     
  16. DenBeke macrumors regular

    Joined:
    Aug 11, 2011
    Location:
    Antwerp
    #16
    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...
     
  17. Converseallstar thread starter macrumors newbie

    Joined:
    Sep 24, 2008
    #17
    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!
     
  18. boston04and07 macrumors 65816

    boston04and07

    Joined:
    May 13, 2008
    #18
    @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!
     
  19. Converseallstar thread starter macrumors newbie

    Joined:
    Sep 24, 2008
    #19
    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!
     
  20. DenBeke macrumors regular

    Joined:
    Aug 11, 2011
    Location:
    Antwerp
    #20
    I would indeed try the same thing, @boston04and07...
     
  21. Converseallstar, Sep 15, 2016
    Last edited: Sep 16, 2016

    Converseallstar thread starter macrumors newbie

    Joined:
    Sep 24, 2008
    #21
    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!
     
  22. DenBeke macrumors regular

    Joined:
    Aug 11, 2011
    Location:
    Antwerp
    #22
    Thanks for letting us know!
     
  23. Converseallstar thread starter macrumors newbie

    Joined:
    Sep 24, 2008
    #23
    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?
     
  24. DenBeke macrumors regular

    Joined:
    Aug 11, 2011
    Location:
    Antwerp
    #24
    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...
     
  25. melchior macrumors 65816

    melchior

    Joined:
    Nov 17, 2002
    #25
    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?
     

Share This Page