Migrating your contacts from iPhone to Android
This article shows you how to transfer your contacts from iPhone to Android without using googles sync server
Recently I got my first Android phone. As for most of the hacking affiliated people I felt a bit more comfortable with Android that with iOS. How long have I dreamed of having a phone with full access to the source code, with full access to the system. The manufacturer does not force me to buy his over-priced hardware to develop applications for the device. I can install every application I like to install. There are at least 100 more reasons why Android ‘feels’ better than iOS.
However, as I started to move my personal data from one device to the other, I noticed that also Android produces a feeling of discomfort. The system is designed to back up all the data on google servers. This includes contacts, photos, sms, emails, wifi-passwords (they can come in handy for google the next time the street view car passes by😉 )
So either you lose control over your device or you lose control over your data. The best solution to that problem for me is to use an Android phone and try to avoid as much as possible the Google services.
But… already the transfer of my contacts proved to be more complicated than I thought. The usual way to do so is to sync your iPhone contacts with Google and get them beamed to your Android device automatically. That’s exactly how I don’t want to do it. And apparently, there isn’t an easy solution to avoid Google to get all my contacts. The fault here is more on Apples side as they don’t offer a way of exporting the contacts on your phone.
For solving this issue I wrote a little python script which takes the iPhone address book database and transforms it into a vCard file, which should be readable by most of the email client, etc. Oh, and yes, Android offers a direct way of importing vCard files without going through google servers.
What you need to do:
- Download the address book database from your iPhone via ssh: /var/mobile/Library/AddressBook/AddressBook.sqlitedb (You’ll find many guides on how to do that)
- Download my python script from here: https://bitbucket.org/befi/general/src/d741cbdcf9e6/iphone_addr_book_2_vcard/iphone_addr_book_2_vcard.py
- Execute the script in the same folder with the AddressBook.sqlitedb with no parameters
- Use the generated ‘contacs.vcf’ as you like🙂
You might want to adapt the phone number types starting at line 46 of the script. Just play around with the script and check the output (vcf file is in ASCII). Please note that this script only processes names, birthday, telephone numbers, email addresses and addresses. The script is tested with iOS 4.0.1.