SSH'ing Contacts and SMS

Discussion in 'Jailbreaks and iOS Hacks' started by iannufc, Oct 27, 2009.

  1. macrumors newbie

    iannufc

    Joined:
    Jul 7, 2009
    Location:
    Newcastle, UK
    #1
    Folks.

    Apologies if this has been discussed earlier, but I did search with the above terms and received no hits, so have decided to post here.

    It isn't a question as such, just reassurance/opinions/experiences of what it is that I want to do. The issue is as follows:

    I'd like to re-JB my phone using a cooked firmware this time, as opposed to Blackra!n this time, as I'm having problems with regards to Apps crashing, especially Facebook which I use all the time.

    After that, I'd like to restore my Contacts and SMS's that I have previously backed up, by SSH'ing them back on the phone.

    I'm confident with SSH, but I was just wondering if anyone had done this before, and was it successful, or if there are any issues with it, or if it really is as straightforward as it appears to be?

    Many thanks in advance. :)
     
  2. macrumors 68030

    bytethese

    Joined:
    Jun 20, 2007
    Location:
    Cranford, NJ
    #2
    I'm not sure why you would want to. You just said you have a previous backup, why not restore that?

    You couldn't simply SCP (SSH is the tunnel, SCP is the secure copy. :)) the files over as the Contacts and SMS messages are databases I believe.
     
  3. macrumors 6502

    Joined:
    Feb 2, 2009
    Location:
    Jupiter, FL
    #3
    if you copied the databases off of the phone prior to restore, you can put them back in the same place, same way. BUT - it will only work if you fix permissions and ownership.

    chmod -R 0755 directoryname
    and
    chown -R mobile:mobile directoryname

    directory name are CaSeSenSiTive

    if you don't do this, the app will either crash or won't save any of the messages.
     
  4. thread starter macrumors newbie

    iannufc

    Joined:
    Jul 7, 2009
    Location:
    Newcastle, UK
    #4
    Hi, thanks for the reply.

    I didn't explain that one very well, so I'll try to clear it up.

    I want to set my phone up as a new phone, without restoring a backup from iTunes, but don't want to lose my SMS messages.

    The backups I mention were done with SCP, as my phone is jailbroken.

    I copied sms.db from /private/var/mobile/Library/SMS and both files from /private/var/mobile/Library/AddressBook as I have read that it is a simple case of copying them back onto a new phone. I realise that the contacts don't really matter, as I can sync them with my Exchange account, but I'd like to keep my SMS messages.

    Do the chmod and chown both need to be run on each directory (AddressBook and SMS) and when you refer to mobile:mobile, what do you mean exactly?

    Many thanks.
     
  5. macrumors 6502

    Joined:
    Feb 2, 2009
    Location:
    Jupiter, FL
    #5
    you explained it fine. that will work just as you want. type it in exactly like:

    chmod -R 0755 /private/var/mobile/Library/SMS

    and


    chown -R mobile:mobile /private/var/mobile/Library/SMS

    this will ensure the owner is "mobile" and the permissions are correct. When you copy using SSH (at least for me) it copies it as owner "root" which disallows the SMS app (or whatever) from writing to the file, so you need to set "mobile" as the owner.

    run it on each directory, just changing the dir name, and make sure the case is correct. you can verify by entering

    ls -la
    you should get a listing that looks like:

    -rwxrw-rw- 1 mobile mobile 10240 Oct 27 12:28 filename
     
  6. thread starter macrumors newbie

    iannufc

    Joined:
    Jul 7, 2009
    Location:
    Newcastle, UK
    #6
    Thanks very much for that, very helpful.

    Mine does also copy over as root, so thanks for clearing that one up.

    I should be able to manage that one OK now, that's all I was after!

    Thanks again! :)
     
  7. macrumors newbie

    Joined:
    Jul 7, 2009
    #7
    Excuse my n00bness, but how exactly do I run these commands?

    Thanks.
     
  8. macrumors regular

    Joined:
    Nov 27, 2006
    Location:
    Up North, UK
    #8
    Great stuff, i was wondering how you setup a new iPhone but kept your SMS.

    @zigmondski: Use putty or something similar to SSH into your phone, then run the commands from there
     
  9. macrumors 6502a

    medicscott

    Joined:
    Aug 9, 2009
    Location:
    san diego
    #9
    check out the tutorials on hackthatphone.com buddy. look for the ssh one, really good one, this is how i learned how to.
     

Share This Page