Where is "Contact" information stored within iOS4 I have a problem in iOS4.0.1 on my 3GS where not all contacts I have saved show up in the "Contacts" app or tab within "Phone". However, when I enter names in a new text message contact field, they automatically show up - the same happens when I manually dial a contact's number in the "Phone" app.

I'm wondering in which file/directory is this information stored within the filesystem so I can harvest it manually? I have jailbroken the phone and have access to the filesystem. I believe the data may be stored in a sqlite database, though I'm not certain.

Also, would anyone be able to shed some light on how the database may have corrupted itself and if there are any possible fixes.

Any help is greatly appreciated.
I can't address the data corruption issue, but I can tell you where your PIM data is stored.

SSH into your phone and go to /private/var/mobile/Library/. There, you will find and AddressBook subfolder, along with SMS, Calendar, Notes, etc. The contents of these directories are the data that you need for each respective service.