Here’s how to back up your iPhone SMS and contacts via SSH. Of course, you will have to know how to SSH first.
How to save Contacts Database:
* SSH into the iPhone and go to /private/var/mobile/Library/AddressBook * you will find 2 files there. save them on your computer.
How to save Messages Database:
* SSH to your phone and go to /private/var/mobile/Library/SMS * Save sms.db on your computer