Import your Nokia S40 Contacts to Google or the like

Nokia S40 phones’ can’t sync with Google or any other good online web services. So if you wanted to export your contacts from your phone and import them into your GMail contacts/other contact management, how would you accomplish this?

It’s a little complicated, but easy once you do it for the first time.

From your Nokia S40 phone:
Take a backup of only your contacts, and transfer this backup file to your computer, running GNU/Linux(if anyone can replicate this process on Windows, drop a comment).

On your desktop:
The NBF file is a simple zipped file. Unzip this zip file, and navigate your way to the contacts folder:

$ unzip Backup000.NBF
$ cd predefhiddenfolder/backup/WIP/32/contacts/

If the above specified path does not exist, then look for the directory contacts in the extracted directory.
The contacts are stored in the most popular vcard format, all the contacts you have are in a separate vcard for each contact. Let’s combine all of these into one single vcard file:

$ cat *.vcf > ~/Desktop/phone-contacts.vcf

Now you can import this file into any contact management application that supports the vcard format.

For GMail:
Navigate to Contacts(it’s located a the top left corner), then under More actions, click on Import. Choose the newly created combined vcard file(located on your desktop) and click on Import.

To clean up things, in the Contacts view in GMail, again select More actions, and click on Find & merge duplicates…, this will ensure that you don’t have duplicate contacts, and clean up your contacts as well.

If someone accomplishes this in Windows, please leave a comment on doing so.