Results 1 to 6 of 6

Thread: Sync to Zimbra contacts

  1. #1
    eleventeenth is offline Junior Member
    Join Date
    Nov 2007
    Posts
    2

    Default Sync to Zimbra contacts

    Hi,

    been battling with one-way sync of SugarCRM contacts into Zimbra and we've finally cracked it. Thought the world would like to know. Attached is the script we are using (kudos to all refs in that file).

    The system we have in place is:

    * Zimbra&Sugar installed on same box
    * Both using OpenLdap for authentication
    * OpenLdap on same machine (concurrent with Zimbra install) and being used for Samba

    Ask any questions!
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2007
    Location
    San Jose, CA
    Posts
    1,169

    Default Re: Sync to Zimbra contacts

    Hi there,

    Please consider making this a project on SugarForge! You'll automatically get a few more tools to help your project progress (like your own forums area, plus a better method for having people get your code).

    You can easily create a project on Sugarforge by clicking on this link to get started.
    Susie Williams

  3. #3
    ryanwilliams is offline Junior Member
    Join Date
    Sep 2007
    Posts
    2

    Default Re: Sync to Zimbra contacts

    Hey, cool

    I wrote the code you found on pastebin

    Thanks for overhauling it and posting it back to the community.

    Cheers

  4. #4
    Dieter_be is offline Junior Member
    Join Date
    Oct 2010
    Posts
    4

    Default Re: Sync to Zimbra contacts

    Hi eleventeenth, thanks for the script.
    I prefer it over the others because using the higher level API's like soap and zimbra's commandline tool and web interfacel is more robust then querying the database directly.

    However, when the script does the curl http request to zimbra, I get this:
    Code:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
    <title>Error 500 system failure: csv formatter failure</title>
    </head>
    <body><h2>HTTP ERROR 500</h2>
    <p>Problem accessing /service/home/user@ourzimbra.net/sugarexport. Reason:
    <pre>    system failure: csv formatter failure</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>  
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    
    </body>
    </html>
    I've checked the /tmp/SugarCRMContacts.csv file myself and it seems a correct CSV file at first (in our case 684 lines, 220kB), although I notice some lines seem truncated.
    For example, I've got a line ending on:
    Code:
    "Street 11","http://ourcrm//index.php?action=DetailView&module=Contacts&record=someidentifier",""
    "","","","","","","BTW 123456
    I'll be debugging this further.

  5. #5
    Dieter_be is offline Junior Member
    Join Date
    Oct 2010
    Posts
    4

    Default Re: Sync to Zimbra contacts

    Ok, i figured it out.
    it was not a truncated line, i had newlines in some fields like description. i thought that was the issue, but stripping out all those newlines (except the newline at the end of course) didn't help.

    It turned out that since we use zimbra 6, we need to use curl -T instead of curl --data-binary, as documented on http://wiki.zimbra.com/wiki/Calendar...acts_Migration

    it seems to work nicely, i just need to fix some encoding issues, and a nice way to prune the contacts first (the script does not run on the zimbra machine, so we can't invoke zmprov).
    When I'm done with that, I'll publish the new version.

  6. #6
    Dieter_be is offline Junior Member
    Join Date
    Oct 2010
    Posts
    4

    Default Re: Sync to Zimbra contacts

    Okay guys, here you go:
    http://github.com/kangaroot/sugarzimbrasync

    basically the code from eleventeenth, but various improvements and some bugfixes.
    Comes with a readme and by using Git and Github, we get version control, easy collaboration, issue tracking, etc for free.
    I find this tool much easier to use then the datasyncsuite.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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