Results 1 to 10 of 11

Thread: MySQL structure

Hybrid View

  1. #1
    Join Date
    Dec 2006
    Posts
    5
    Rep Power
    9

    Default MySQL structure

    I am new to Zimbra. I am having trouble finding documentation on the structure of the MySQL database, particularly the contacts. Can anyone point me in the right directions?
    Last edited by binnacle; 12-18-2006 at 04:37 PM.

  2. #2
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default Please use the APIs

    Please don't operate directly on the database. The system expects that the database won't change out from under it, and if you do make such changes it can get out of sync with bad results. If your changes aren't well-formed, the web UI won't even run.

    You can import and create contacts using the SOAP and REST APIs. Please use them.

    (The contact contents are stored in BEncoded format in the database's METADATA column.)
    Bugzilla - Wiki - Downloads - Before posting... Search!

  3. #3
    Join Date
    Dec 2006
    Posts
    5
    Rep Power
    9

    Default

    I was not expecting to change it, but I would like to know the structure.
    Last edited by binnacle; 12-18-2006 at 03:47 PM.

  4. #4
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default Curiouser and curiouser...

    Um... why? You can get at the data as XML via SOAP and as VCF and CSV via REST, so what's the point in accessing the database directly?

    Anyways, if you're determined to go this route, to get the fields of the contact:
    1. apply the BDecoding algorithm to the METADATA column of the contact's database row
    2. the METADATA should decode to a "directory"
    3. the value of the "fld" attribute is the key/value "directory" holding the contact's fields as strings


    Note that values are stored in the database as UTF-8 and Zimbra's BEncoding implementation handles strings containing multibyte characters by assuming that the BEncoded string has been decoded from UTF-8 before the character counts on string values are considered.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  5. #5
    Join Date
    Dec 2006
    Posts
    5
    Rep Power
    9

    Default Further on...

    Thank you for hanging with me on this.

    Here is the deal. We are looking at how to integrate Zimbra into a specialized set of data that we have built. We don't want to recreate all of the contact management work that you guys have done so well but we also don't want to have to upload the entire database to the Zimbra server. So, we are going to build a Zimlet. To do so though I need a unique identifier. (Our database has over 50,000 unique contacts in it which means more than one person with the same name. Moreover it is a relationship database that cannot easily be flattened.) So, I am assuming that there is a GUID on your side that I could use. I could upload some basic flat information to the Zimbra server and then keep on my side a link table linking your GUID to something on my side. Then I could build a Zimlet that would dynamically build the additional relational type data through an AJAX call.

    If there is a better way to think of this I would appreciate knowing about. (I am also frustrated by the limited set of data fields that appear to be available for user edits. There don't appear to be any user defined fields so if I cannot find another route, I'll have to repurpose a field that is not likely to be used such as Email3.)

  6. #6
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default Oh!

    You don't want our internal contact format, you just want a GUID.

    The "id" attribute of a contact is unique across the mailbox. If you want a GUID, compose the user's account ID ("zimbraId") with this numeric item ID. If you're working from a zimlet, you don't even need to look at our database -- the contact's ID should be available from the zimlet.

    As for the contact field display/editing, you may need to make your zimlet extend the contact UI.
    Bugzilla - Wiki - Downloads - Before posting... Search!

Similar Threads

  1. Zimbra fails after working for 2 weeks
    By Linsys in forum Administrators
    Replies: 10
    Last Post: 10-07-2008, 01:42 AM
  2. Mysql does not start on RHEL 64
    By cryptogram in forum Installation
    Replies: 11
    Last Post: 01-18-2007, 02:39 PM
  3. Replies: 18
    Last Post: 03-20-2006, 02:22 PM
  4. Can't start MySQL to init db - Gentoo
    By fak3r in forum Installation
    Replies: 3
    Last Post: 10-10-2005, 07:59 PM
  5. more fedora install problems
    By jlynch3 in forum Installation
    Replies: 13
    Last Post: 09-14-2005, 10:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •