Extract contacts names and numbers from ActiveSync and HTC Xbackup backup files
Over at a non-English PDA board, I was asked to help with a pretty common problem: extracting WindowsCE databases from ActiveSync STG files. Unfortunately, the only tool to be able to extract stuff from STG files, STGViewer, is unable to do this – it can only extract files, but not databases.
Unfortunately, ActiveSync is pretty useless when it comes to restoring backup files to other device types (even after a ROM upgrade), and, unlike with FSC Backup, it can't be hacked either (see this thread on making FSC Backup cross-restore backup files) to do so. (Not to say Sprite Backup, the by far the best Pocket PC backup app, also supports cross-restoration).
This is pretty annoying with the Windows CE PIM databases, which are 100% compatible and, therefore, could be freely restorable on Pocket PC's running the same Windows Mobile version.
This is why I've set out to scrutinize the more closely the STG format and succeeded in finding the contacts database and writing a tool that does this automatically.
The utility, finally, has turned out to be not only compatible with STG, but also with the HTC Xbackup Contacts format. On the other hand, it won't restore FSC Backup (it stores the name/number pairs in the opposite direction) and iPAQ/Sprite (the number/name pairs are separated by several bytes) contacts, however.
Getting it:
It's, as usual with my apps, free. Download the Java class from here. As usual, I also make the source code freely available, get it from here.
Usage:
If you already have a Java Virtual Machine on your desktop PC (if you don't have one, get it from here. Note that, if you want to reduce bandwidth/disk usage – older JVM's are smaller – the app will work even with older JDK versions – even with JDK 1.1), just issue the
java STGContactNumberAndNameExtract inputfile outputfile.csv
command (using any inputfile and outputfile name; the latter should have the csv extension).
After doing this, go to Outlook and in the Contacts view, go to File/Import and Export; choose Import from another program or file, click Next, choose Comma Separated Values (Windows) and click Next again. After this, it'll be pretty easy to go on.
Other stuff:
You may also want to check out this thread on my Xbackup file extractor tool – you may find it useful if you have a HTC Phone Edition device.
Also, here're my posts on Yahoo -> Outlook/PDA export. Note that it's a bit outdated: when I wrote it, Yahoo had no explicit Outlook-specific export capabilities. The current Outlook export file is 100% compatible with Outlook on the desktop.
I've cross-posted this tutorial to the following URL's: PPCT, AximSite, PPC Magazine, FirstLoox, BrightHand (iPAQ HQ was down while posting).
- Login or Register to post comments
Printer-friendly version




I really need to extract my contacts db from the stg file. However i am not technical and cannot understand how to use the java things you have indicated. Please can you hand hold me through the process step by step. I have downloaded the items you indicated but what do i do with them now??
PLease help.
After hours of searching, worrying, and fretting over how to retrieve my contacts (lost after an upgrade to WM5 on my Samsung i730) It occurred to me that WirelessSync would have all my contact info. I am a Verizon customer, and understand that many folks may not have this available, or may not have ever used it.
NONE of the suggestions I found on the different boards worked for me.
What is important is that NOWHERE did I see suggestion to attempt retrieving from WirelessSync.
I have every lastone of my MANY contacts, phone #s, addresses and other info BACK. SWEET!!!
I really need to extract my contacts db from the stg file. However i am not technical.I have downloaded the items you indicated but what do i do with them now?? I also downloaded the java runtime environment - but if i start your applet i get an errormessage.
Java startfile error -
Missing field
MissingFieldException[ Das folgende erforderliche Feld fehlt in der Startdatei: ]
at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.Main.main(Unknown Source)
Please Help - what is to do that your applet does the right thing?