Migrating Zaurus AddressBook database to OS X Address Book
This is the second article about the data migration from Sharp Zaurus to Nokia N800. This time it is about the PIM information, particularly the Address Book contents. Actually you can do it using the desktop software, but in my case I did not have this option. Zaurus does not synchronize with Mac and, in fact, I did something weird with my Zaurus and I could not synchronize it anymore even with the old Linux and Windows software. So, the goal was to export the address book contents from the Zaurus, merge it into OS X Address Book and then synchronize the latter one with N800 (this is the topic for another article :) ).
Old versions of the Zaurus firmware used plain-text XML files for the PIM data. Newer versions of the firmware use QPE database for the address book contents. Thus, first I needed to export the data from Zaurus. Native Address Book application cannot export all the data in one shot, all you can do is to beam the items one by one.
After relatively long search I have found an interesting tool called ZDBat made by a Japanese developer. This tool can export and import the PIM database content to/from CSV format. If you run it like this on your Zaurus:
$ zdbat address -r -c utf8 > abook.csv
you will export your Address Book to the CSV file. Make sure you use appropriate encoding (for most of us utf8 should work fine).
The next challenge was to identify the CSV fields. They have 4-letter cryptic names and, unfortunately, the description is in Japanese. I have decided that creating a test record and using it to match the field names to the address book fields is a bit easier than to learn this beautiful language, so here is the mapping:
CSV header name | Description |
CARDID | CardID |
CATEGORY | Category |
FULL | Full name |
TITL | Title (not used) |
LNME | Last name |
FNME | First name |
MNME | Middle name |
SUFX | Suffix |
FLAS | Last name, First name,Middle name |
LNPR | Last name |
FNPR | First name |
NAPR | Last name,First name, Middle name |
CPNY | Company |
CPPR | Company |
SCTN | Department |
PSTN | Job title |
TEL2 | Work phone |
FAX2 | Work fax |
CPS2 | Work mobile |
BSTA | Work state |
BCTY | Work city |
BSTR | Work street |
BZIP | Work ZIP |
BCTR | not used |
BWEB | not used |
OFCE | not used |
PRFS | not used |
ASST | not used |
MNGR | not used |
BPGR | not used |
CPS1 | Home mobile |
TEL1 | Home phone |
FAX1 | Home fax |
HSTA | Home state |
HCTY | Home city |
HSTR | Home street |
HZIP | Home ZIP |
HCTR | not used |
HWEB | not used |
DMAL | emails |
MAL1 | emails |
SPUS | not used |
GNDR | Gender(1=male, 0=female) |
BRTH | Birthday |
ANIV | not used |
NCNM | not used |
CLDR | not used |
MEM1 | Notes |
GRPS | not used |
Please note that not all the fields are used for the address book data and some values are duplicated. You can actually pass the list of the desired fields to zdbat to select only the ones you are interested in. After that, importing the CSV data in the OS X Address Book is simple - just select the appropriate CSV headers for each address book field and you are done.
In the next article I will explain how you can synchronize the OS X address book with N800.
blog comments powered by Disqus