blog archive contact about feed

Transferring Old Contacts To The Nokia 7610

One problem I've had with my new Nokia 7610 phone was transferring the contact information from my old Nokia 7250 to it.

As the SIM cards seemed incompatible, I had saved my contacts from the old phone using the Nokia PC Suite. However, it seems that the 7610 phone is not compatible with the "Contacts and messages" application. The 7610 uses vCards to store contact information.

Hunting about on my hard drive, I found that the "Contacts and messages" application saves the details into a Microsoft Access compatible database called Contacts2.mdb. Once I had discovered this all I had to do was import the database into Access and save it as XML. I then wrote the following Perl script to extract the name, number and email information from the XML file and generate vCards for each contact. The generated vCards are then just dropped into the phones contacts folder when it is connected to the computer with the DKU-2 USB cable or with Bluetooth.

#!/usr/bin/perl -w ## Perl script to take a Nokia contacts database saved from the Nokia PC Suite, ## that has been converted to XML with MS Access, and then turn the contents ## into individual vCards suitable for importing into a Nokia 7610 phone. ## ## Robert Price - 02/07/2004 ## http://www.robertprice.co.uk use strict; use XML::LibXML; ## create a new XML parser object. my $parser = XML::LibXML->new(); ## parse the contacts file. my $document = $parser->parse_file('Contacts2.xml'); ## find each Contacts2 node. foreach my $contacts2_node ($document->findnodes("//Contacts2")) { ## extact the name, number and email from the contacts2 node. my $name = $contacts2_node->findvalue('./Name/text()'); my $number = $contacts2_node->findvalue('./Number1/text()'); my $email = $contacts2_node->findvalue('./Text1/text()'); ## write the data to a vCard with the same filename as the contacts name. open(CONTACT, ">contacts/$name.vcf"); print CONTACT "BEGIN:VCARD\r\n"; print CONTACT "VERSION:2.1\r\n"; ## we should make REV dynamic with a current timestamp, ## but as we're only running it once we won't bother. print CONTACT "REV:20040802T093000Z\r\n"; print CONTACT "N:;$name;;;\r\n"; print CONTACT "TEL;CELL:$number\r\n" if ($number); print CONTACT "EMAIL:$email\r\n" if ($email); print CONTACT "FN:$name\r\n"; print CONTACT "END:VCARD\r\n"; close(CONTACT); }

I am using the excellent XML::LibXML module to parse and extract the values.

Each record is wrapped in a node called Contacts2. The contacts name is in a node called Name, number is in Number1 and email is in Text1.

I should really generate the REV entry dynamically as it's a timestamp to keep the data in sync, but as I only need to run the script once, I've hardcoded it.

In conclusion, the Nokia 7610 is a really nice phone, but it doesn't link to the Nokia PC Suite very well. Hopefully this script with make it easier for others to retrieve their old names and numbers from series 40 phones and import them into their new series 60 phone.

Entered: 2004-08-02 10:54:49
Modified: 2004-08-03 23:41:20
TRACKBACK - http://www.robertprice.co.uk/cgi-bin/robblog/trackback.pl?id=399

Rob's Other Blog Entries

See other blog entries for August 2004, or an index of all blog entries.