Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: How to connect different database for single module

  1. #1
    maniram2202 is offline Senior Member
    Join Date
    Aug 2008
    Location
    Bangalore,Karnataka
    Posts
    33

    Post How to connect different database for single module

    Hi Guys,

    i m using sugarcrm-5.0.0f version in Windows.
    i want to connect to different database with in the single module. Is it possible....?
    Thnx in Advance....!

    Regards,
    Maniram

  2. #2
    DragonflyMaster is offline Sugar Community Member
    Join Date
    Dec 2007
    Location
    Rimini, Italy
    Posts
    1,421

    Default Re: How to connect different database for single module

    Quote Originally Posted by maniram2202
    Hi Guys,

    i m using sugarcrm-5.0.0f version in Windows.
    i want to connect to different database with in the single module. Is it possible....?
    Thnx in Advance....!

    Regards,
    Maniram
    Do you mean you want to use a different db per module?
    This is not directly possible, as far as I know.
    Using stored procedures on a MS SQL Server you might be able to get somewhere....
    What do you think the cookie monster eats ?

  3. #3
    chad.hutchins is offline Sugar Community Member
    Join Date
    May 2007
    Location
    Texas
    Posts
    141

    Default Re: How to connect different database for single module

    I want to do nearly the exact thing.

    Our developers use FogBugz (http://www.fogcreek.com/FogBUGZ/) to keep up with bug and feature tracking. Our developers love FogBugz, but management and all other departments love Sugar.

    If we could create a shell module in Sugar that acts exactly as ever other Sugar module, EXCEPT it looks at the FogBugz database table, that would be absolutely perfect.

    OTHERWISE, I'll be writing some sort of syncing tool.

    Anyone have any creative ideas? I will have to implement this one way or another.

    Thanks,

    chad

  4. #4
    DragonflyMaster is offline Sugar Community Member
    Join Date
    Dec 2007
    Location
    Rimini, Italy
    Posts
    1,421

    Default Re: How to connect different database for single module

    You could use the section "portal" to link access fogbugz from sugar.
    This wouldn't permit a real data exchange between the two apps though...
    What do you think the cookie monster eats ?

  5. #5
    chad.hutchins is offline Sugar Community Member
    Join Date
    May 2007
    Location
    Texas
    Posts
    141

    Default Re: How to connect different database for single module

    I already proposed that solution, but it wasn't liked too much.

    They really want FogBugz dashlets in Sugar, to report on FogBugz bug table in Sugar with Sugar reporting and when a FogBugz case is updated, the corresponding Sugar case owner is notified.

    The real problem is the FogBugz does not have the similar SugarCRM logic hook abilities (someone please prove me wrong) or this would be a non-issue. It looks like I will have to make changes to our FogBugz base code.

    Thanks for the suggestion. Anyone else?

    -chad

  6. #6
    DragonflyMaster is offline Sugar Community Member
    Join Date
    Dec 2007
    Location
    Rimini, Italy
    Posts
    1,421

    Default Re: How to connect different database for single module

    Quote Originally Posted by chad.hutchins
    They really want FogBugz dashlets in Sugar, to report on FogBugz bug table in Sugar with Sugar reporting and when a FogBugz case is updated, the corresponding Sugar case owner is notified.
    These would be the same things I'd want if I were them...

    The real problem is the FogBugz does not have the similar SugarCRM logic hook abilities (someone please prove me wrong) or this would be a non-issue. It looks like I will have to make changes to our FogBugz base code.
    I'm sorry, I don't really know fogbugz...
    What do you think the cookie monster eats ?

  7. #7
    chad.hutchins is offline Sugar Community Member
    Join Date
    May 2007
    Location
    Texas
    Posts
    141

    Default Re: How to connect different database for single module

    Thanks for the response.

    I hope someone has an idea. Anyone from Sugar know how we might be able to pull this off?

    It seems that all of the queries from the Sugar code are automatically prefixed with the sugar database information across the board with no non-core-code fix to have the queries explicitly prefix with another database name.

    example:

    sugar currently - select sugarcrm-database-name.sugarcrm-table-name.sugarcrm-field-name from ....
    needs to be - select fogbugz-database-name.fogbugz-table-name.fogbugz-field-name from ....

  8. #8
    DragonflyMaster is offline Sugar Community Member
    Join Date
    Dec 2007
    Location
    Rimini, Italy
    Posts
    1,421

    Default Re: How to connect different database for single module

    Hey Chad, forgive me if I keep answering
    If all you need is a custom module that retrieves data from fogbugz's database and write back to that same database, without any data interchange to Sugar's database, then you could override the connection parameters set in config.php:
    PHP Code:
      'dbconfig' => 
      array (
        
    'db_host_name' => '192.168.10.100',
        
    'db_host_instance' => 'MYSQL'
        
    'db_user_name' => 'root',
        
    'db_password' => '1234',
        
    'db_name' => 'sugarcrm',
        
    'db_type' => 'mysql',
      ), 
    Redeclaring these variables for your custom module might work...
    What do you think the cookie monster eats ?

  9. #9
    chad.hutchins is offline Sugar Community Member
    Join Date
    May 2007
    Location
    Texas
    Posts
    141

    Default Re: How to connect different database for single module

    Please, by all means, keep replying ;-)

    Are you suggesting over-riding the db config information anytime the custom fogbugz module is used in sugar?

    It won't be the only module in my sugar instance (obviously), so I can't just make the change in the main config.php.

    Thanks again and keep the ideas rolling!

    -chad

  10. #10
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,858

    Default Re: How to connect different database for single module

    Chad,

    The first thing we did with FogBugz was alter both Sugar and FogBugz to get them talking to each other. Bad idea. The second thing we did when switching to JIRA was to instead of having a two way communication we overwrote the Bug bean to read from JIRA. The only thing on Sugar that was used for was the assigned_user_id and the relationships. This got rid of a bunch of integration issues for us. We first renamed Bug.php to Bug_sugar.php (and changed the class name) and then we added our own Bug.php which extends Bug_sugar.php. Attached is the new Bug.php and the custom JIRA.php file which connects to JIRA. I don't recall if FogBugz has an API. If it does you can make your calls in a FogBugz.php type file or just go directly to the database.

    This is some really cool stuff. BTW, we also use Mule as an ESB for some additional services so if you'd rather connect to an API you could extend or create your own API to FogBugz using Mule and have Sugar connect to Mule.

    Good luck!
    Attached Files Attached Files

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. connect sugarcrm to another database
    By shahrzad.khorrami in forum Developer Help
    Replies: 3
    Last Post: 2008-06-23, 08:39 AM
  2. Replies: 1
    Last Post: 2007-11-02, 11:18 PM
  3. MySQL Database Not Available
    By luisamato in forum Help
    Replies: 4
    Last Post: 2007-06-27, 06:58 AM
  4. Replies: 5
    Last Post: 2006-06-01, 03:18 PM

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
  •