jahed.dev

Importing vCards into an iPhone

Recently, I had to transfer some contacts from an old Android device to a newer iPhone. The usual approach here is to export the contacts as a vCards file (.vcf) and importing them. On Android, it's straight forward, just opening the menu from the Contacts app and export. On iPhone however, it's a bit more tricky.

Running a web search for "iphone import vcards" and "ios import vcards" leads to a bunch of dead ends. Community forums with no answers, Apple's official support pages lead to soft 404s, and so on. There is no way to import vCards on iOS, it has to be done via iCloud.

Following the instructions, the import failed with a generic error. Something like "problem reading vcards". Running that through a search lead to multiple different discussions as expected, all leading again to dead ends or unrelated topics. The single thing tying most of them together was the vCard version.

I checked the vCard version of my old Android export: v2.1. Maybe upgrading it to v3 will work? Luckily someone's written a script for that: vcard2to3 by jowave. I'm on Windows though and I don't want to install Python. Oh right, I've got WSL enabled which I barely use now. Switch over to that, checkout the git repo, run the script, import the result and it worked. v3 has some syntax differences so I guess iCloud wasn't checking versions before parsing the file.

The takeway here is to always check the version of a document before trying to parse it. And if you're defining document format, always include a version.

Thanks for reading.