When switching from Android to iPhone or other iOS devices, it is important to transfer personal data. Both companies (Google and Apple) offer services like Navigation, Calendar, Contacts, Photos, etc. Currently, Apple allows connecting to a Google account to use most of the services on an iOS / macOS device, even though the data is stored in the cloud at Google. But once you get a taste of the integration possibilities in the Apple ecosystem, you will think about transferring your data from the Google services to Apple. This article is dedicated to the transfer of the contacts with the arising problems.
To solve the problems of missing data (birthday, address, profile picture, ...), export your Contacts from Google Contacts as vCard (
.vcf), run this Python script over the file(s) and import it in Apple iCloud Contacts in the browser.
Contact Import/Export Problem
Let's first discuss: How to transfer the contacts from Google to Apple? Currently, there are a bunch of contact storage locations. Just look back a few years where all your contacts are stored on your SIM card and automatically transferred to your new device thanks to this small piece of hardware. Today, most people store their contact data in the cloud, like Google. So the transfer of the data should be easy, right? First, go to the web interface of your Google Contacts. Then, export your contact(s) as a vCard (
.vcf file). Open the Apple iCloud Contacts web interface or your Contacts app on your Mac and import the file. Done! Sounds pretty easy and straightforward but the close observer recognizes that there are a lot of problems here. I created an example entry that looks as follows in the Google Contact web interface:
After the simple export and import step, I opened both data records in the macOS Contacts app. The left side shows the original entry, stored on the Google servers while the right side of the screenshot shows the result of the import process, stored in the iCloud.
When comparing, it is quickly noticeable that the profile picture and the second address that doesn't have a label are missing. Further, the birthday that is shown on the above screenshot in the web UI is completely missing. Other tests could reproduce the problems and showed that a full birthday with a year is transferred correctly whereas the day and month only don't work. These problems are discussed in different sections, articles, and threads online, like the official Apple Discussion forum, Reddit, and so on, without any solution.
The vCard / VSF File
Who is to blame for the problem now? Google or Apple? When looking directly into the exported vCard files, all missing data points are present. Therefore, Apple doesn't recognize the slightly different format from Google, although both use vCard version 3.0.
Let's compare the files. The google
.vcf file of the contact shown above looks as follow:
BEGIN:VCARD VERSION:3.0 FN:FirstExample Lastname N:Lastname;FirstExample;;; EMAIL;TYPE=INTERNET;TYPE=HOME:firstname.lastname@example.org EMAIL;TYPE=INTERNET;TYPE=WORK:email@example.com TEL;TYPE=HOME:+49 172 1234567 TEL;TYPE=CELL:+49 152 9876543 TEL;TYPE=WORK:+49 162 0000000 item1.TEL:+49 123 4567890 item1.X-ABLabel: ADR;TYPE=WORK:;2;Platz d. Republik 2;Berlin;;10557;DE;Platz d. Republik 2\n 2 10557 Berlin\nDE item2.ADR:;;Platz d. Republik 1;Berlin;;10557;DE;Platz d. Republik 1\n10557 Berlin\nDE item2.X-ABLabel: BDAY:--1212 PHOTO:https://lh3.googleusercontent.com/contacts/XXXXXXXXXX XXXXXXXXXXXXXXXX CATEGORIES:myContacts END:VCARD
After importing to iCloud Contacts and manual correction of the missing and broken fields and pictures, the resulting export looks like this:
BEGIN:VCARD VERSION:3.0 PRODID:-//Apple Inc.//macOS 12.2.1//EN N:Lastname;FirstExample;;; FN:FirstExample Lastname EMAIL;type=INTERNET;type=HOME;type=pref:firstname.lastname@example.org EMAIL;type=INTERNET;type=WORK:email@example.com TEL;type=HOME;type=VOICE;type=pref:+49 172 1234567 TEL;type=CELL;type=VOICE:+49 152 9876543 TEL;type=WORK;type=VOICE:+49 162 0000000 TEL:+49 123 4567890 ADR;type=WORK;type=pref:;;Platz d. Republik 2\n2;Berlin;;10557;DE ADR:;;Platz d. Republik 1;Berlin;;10557;DE BDAY;X-APPLE-OMIT-YEAR=1604:1604-12-12 PHOTO;ENCODING=b:XXX END:VCARD
As can be seen very well, there are a lot of differences in the content: Google adds some line breaks for long lines and uses different namings or formats. Further, the contact image is exported as an URL reference, while Apple uses a base64 encoding (I replaced it with
XXX above). So it is not surprising that the export / import process doesn't work properly.
In my opinion, the only solution is the transformation of the first format into the second one. Therefore, I created a little Python script that does the job. It is published in the GitHub Google iCloud Contact Converter repository.
Follow this step-by-step guide so successfully transfer the contacts:
- Open the Google Contacts website in a browser of your choice.
- Select the contacts you want to transfer. Then, click on the 3 dots icon --> Export --> select "vCard (for iOS-Contacts)" --> "Export" button and store the file on your PC.
- Check that you have Python 3 installed (follow this tutorial for macOS). Currently, the convert script imports
requests. Based on your local installation, you have to install them.
- Download the Google iCloud Contact Converter script, e.g. by cloning the repository with the following command (run in a terminal):
git clone https://github.com/mhellmeier/Google-iCloud-Contact-Converter.git
- Copy the
.vcffile of the export (step 2) in the
datafolder of the downloaded project from step 4.
- Open the main Python file (
google-icloud-contact-converter.py) in an editor of your choice (like VisualStudio Code, vim, PyCharm, ...).
- Change the value of the
AREA_CODEto your default location. Later, every phone number that starts with a
0will be replaced with the area code defined here.
- Change the
contacts_filenamevalue to the name of your exported
.vcffile from step 2 + 5 without the file extension. By default, this should be
contacts_filename = 'contacts'.
- Save the file and run the script with:
- A new file appears in the
datafolder. By default, this should be
- Open the Apple iCloud Contacts app in a browser of your choice.
- Click on the settings gear icon in the lower-left --> select "vCard import ..." --> upload the resulting file from step 10.
Transfer Contact Groups
The only thing that doesn't work here is the takeover of the contact groups. But there is also a little (manual) fix for it! Just create the same groups manually in iCloud contacts. Then, export your contacts group-wise from Google, convert every file with the script and import them group-wise again into Apple iCloud.
Hope this explanation and script solves your problems. If this should be the case, I am pleased about a star on the GitHub project. Also, feel free to start a discussion in the comment section below.