Skip to content

Instantly share code, notes, and snippets.

@natanlao
Last active January 12, 2023 18:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natanlao/1ff4f5c3aa549e05f67f342069b6c00f to your computer and use it in GitHub Desktop.
Save natanlao/1ff4f5c3aa549e05f67f342069b6c00f to your computer and use it in GitHub Desktop.
Importing birthdays and contact images from Google Contacts to Fastmail

Fastmail offers an automated Google Contacts import feature, and also supports importing contacts by CSV and vCard. Unfortunately, I've noticed that all of these import features are lossy. Regardless of import method:

  • Contact profile pictures stored in Google Contacts are not imported. (Google exports profile photos by including a link to the photo in the CSV.)
  • Birthdays without associated years (i.e., just the month and day) are sometimes not imported at all.
  • Empty ('') phone numbers are sometimes added to contacts. (This issue may have been a result of me trying to fix the two issues above, and not Fastmail itself).

I've confirmed with Fastmail support that profile picture and birthday import are not fully supported and opened a feature request on my behalf. In the interim, I've found this workaround that uses the macOS Contacts app:

  1. Add your Google account to Contacts by signing in; importing contacts as a CSV or vCard is insufficient.
  2. Add your Fastmail account to Contacts by signing in.
  3. Select all contacts associated with your Google Account and click and drag them to the listing for your Fastmail account in the left sidebar. (Exporting contacts from Contacts.app and reimporting them to Fastmail is insufficient.) This will probably take a few tries or more, the app is really finicky. Try:
    • Start from the top of the contacts list. Click the first contact.
    • Press Cmd+A to select all contacts.
    • Scroll to the bottom of the contacts list.
    • Hold down the shift key while clicking the last contact on the list, then without releasing the shift key, drag the selection.

This method has seemed to be more or less successful in transferring my contacts with birthdays and profile pictures intact.


Edit: This ended up not working perfectly; I think I did something in the process of debugging this issue to actually delete birthday information from my Google Contacts, which is really weird. My hunch is that this may have been because I added my Google accout to macOS contacts, but who knows.

Anyway, I looked at a recent Takeout and saw that I didn't have a lot of profile pictures set, and I decided to forget those. I did find out how to solve the Fastmail contacts issue more nicely, though. When exporting contacts from Google Contacts in the vCard format, I found that contacts with birthdays without years were saved in one of two formats:

BDAY:--1231

or

BDAY:16041231

. Fastmail only likes the second version (maybe because it's nonstandard? I didn't bother checking). This is easy enough to fix:

$ sed -i 's/BDAY:--/BDAY:1604/g contacts.vcf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment