Results 1 to 4 of 4

Thread: Need help importing Bugs into sugarcrm from csv

  1. #1
    gmckone is offline Junior Member
    Join Date
    Dec 2006
    Posts
    3

    Default Need help importing Bugs into sugarcrm from csv

    Hi, I was surprised to notice today that in Version 4.0.1c of Sugar CRM, a user can Export bugs, but not import them. I failed to notice this before I spent 6 hours updating and manipulating bugs in a CSV file. To say the least, I don't want to re-enter the bugs using a web interface if I could simply import them.

    I am using a Mysql database, and can see the BUGS table which is similar (not identical) to the output of the "export csv"
    I would just write a script to insert all the values into the bugs table, but I don't want to cause any system stabiltiy problems. In particular there are some fields I'm not sure what to do with.

    id This appears to be an MD5 hash of something, containing hyphens???
    bug_number (I think this is clear)
    date_entered (I think this is clear)
    date_modified (I think this is clear)
    modified_user_id (I think this is clear)
    assigned_user_id (I think this is clear)
    deleted (I think this is clear)
    name (I think this is clear)
    status (I think this is clear)
    priority (I think this is clear)
    description (I think this is clear)
    created_by (I think this is clear)
    resolution (I'll leave this NULL)
    found_in_release (I'll leave this NULL)
    type (Feature / Defect)
    fixed_in_release (I'll leave this NULL)
    work_log (I'll leave this NULL)
    source (InboundEmail)
    product_category (I'll leave this NULL)

    Can someone point me in the right direction regarding this ID field?
    Apart from that I'm planning to write a standard SQL script to insert these bugs into the database using the data I have in the CSV.

    Thanks for your help, I'm stuck on this one.
    Last edited by gmckone; 2006-12-15 at 08:09 PM.

  2. #2
    roblaus's Avatar
    roblaus is offline Sugar Community Member
    Join Date
    Dec 2006
    Location
    Vienna / Austria
    Posts
    2,850

    Default Re: Need help importing Bugs into sugarcrm from csv

    just on the technical side - you might want to look up the UUID() function in MySql.

    No idea what sugar is doing in older versions but I assume they generate their keys upon import with exactly this function.

    rgds
    rl

  3. #3
    gmckone is offline Junior Member
    Join Date
    Dec 2006
    Posts
    3

    Default Re: Need help importing Bugs into sugarcrm from csv

    Thank you, I will test with that function to see if it will work. (I figure I can always delete the bad record if it fails).
    Greg.

  4. #4
    gmckone is offline Junior Member
    Join Date
    Dec 2006
    Posts
    3

    Default Re: Need help importing Bugs into sugarcrm from csv

    OK, I've started reading about UUID() but I'm not sure I've got the right idea.

    insert into bugs (id,name,... etc) values (UUID(), 'bugname',... etc)

    The best I was able to do was insert the string "UUID()" into the ID field haha.
    I'm pretty new to mysql, and have only ever worked with it using the PHPMYADMIN application.

    Here is the SQL I'm hoping to use (minus the UUID part of the solution)

    INSERT INTO `bugs` ( `id` , `bug_number` , `date_entered` , `date_modified` , `modified_user_id` , `assigned_user_id` , `deleted` , `name` , `status` , `priority` , `description` , `created_by` , `resolution` , `found_in_release` , `type` , `fixed_in_release` , `work_log` , `source` , `product_category` )
    VALUES (
    UUID() , '12', '2006-12-14 00:00:00', '2006-12-21 00:00:00', '1', '1', '0', 'TestBug', 'Assigned', 'High', 'TestBug to test the u u i d function for scripting in SQL to insert many bugs from modified csv file.', NULL , NULL , NULL , 'Feature', NULL , NULL , NULL , NULL
    );

    Sorry I'm unable to put the pieces together, but I really do appreciate your help.

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
  •