Errors importing targets from SugarCRM

Hi All,

I am trying to import targets from SugarCRM into a new install of SuiteCRM but am hitting errors on each attempt.

The first is that SuiteCRM thinks the IDs are more than 36 characters. But having counted them I can see that is not the case.

Secondly (if I discard the IDs) I get an error which states that the email addresses are invalid - which again they are not.

The data is a default CSV export from SugarCRM with commas for delimiters and quotes for qualifiers. I am wondering if the import is including the quotes as part of the field values which would explain these errors - but having checked the import settings where the data preview looks perfect I can’t see why that would be the case.

Can anyone help with this?

Colin

@colinr

Welcome to community!

I tested it and didn’t find some problems. Can you load the csv file into anything program which works with tables. I am using OpenOffice for it usually.

Yes, it opens fine in a plain text editor or LibreOffice (a fork of OpenOffice).

The data is as I would expect it to be. But perhaps I need to adjust the settings?

I’ve selected commas for delimeters and double-quotes for qualifiers.

The default character set is utf-8. Is that what you’re using?

Colin

@colinr

Yes, LibreOffice is normal. I am using utf-8 too.

For testing you can add the function to module object.

    public function beforeImportSave() {
        $GLOBALS['log']->fatal(get_class()." ". __FUNCTION__." this->id: ".print_r($this->id,true));
        $GLOBALS['log']->fatal(get_class()." ". __FUNCTION__." this->email1: ".print_r($this->email1,true));
    }

Thanks. Which file do I add this to?

@colinr

You wrote about targets, then it should be the file modules/Prospects/Prospect.php.

Thanks. I added this code, ran another import and have pulled this from the logs:

Wed May 19 10:30:17 2021 [70022][1][FATAL] SugarBean::populateDefaultValues $field_defs should be an array
Wed May 19 10:30:18 2021 [70022][1][FATAL] SugarBean::populateDefaultValues $field_defs should be an array
Wed May 19 10:30:18 2021 [70022][1][FATAL] SugarBean::populateDefaultValues $field_defs should be an array
Wed May 19 10:31:15 2021 [70466][1][FATAL] Caught error: stat(): stat failed for upload/import/error_1.csv
Wed May 19 10:31:15 2021 [70466][1][FATAL] Caught error: touch(): UploadStream::stream_metadata is not implemented!
Wed May 19 10:31:17 2021 [70466][1][FATAL] Caught error: stat(): stat failed for upload/import/status_1.csv
Wed May 19 10:31:17 2021 [70466][1][FATAL] Caught error: touch(): UploadStream::stream_metadata is not implemented!
Wed May 19 10:31:33 2021 [70597][1][FATAL] Prospect beforeImportSave this->id:
Wed May 19 10:31:33 2021 [70597][1][FATAL] Prospect beforeImportSave this->email1:
Wed May 19 10:31:33 2021 [70597][1][FATAL] Prospect beforeImportSave this->id: Bandar32Menjalara
Wed May 19 10:31:33 2021 [70597][1][FATAL] Prospect beforeImportSave this->email1:

Can you advise?

@colinr

Your csv file has 2 records? The data doesn’t read correctly. Look at id - Bandar32Menjalara. Is this id really or the data from other column?
As variants:

  • Some record has single character of double quote?
  • Do you use “the saved settings” for import?
  • Are names of column correctly?

… and if you can get stack traces of those fatal errors, it would be really helpful.

No. Only 2 are being imported. There are 1360 records.

Looking for “Bandar32Menjalara” I found “Bandar Menjalara” in the address field. I’ll remove this record and try again as that may be throwing the whole process.

Colin

Removing that record allowed all but 50 records to be imported. Thanks!

I will continue using the debugging script provided to fix these.

I also notice there is no way to import Target Lists - which would be ideal as the Targets were organised across a range of lists in SugarCRM.

I have a full SQL export from my old system. Can I extract the relevant tables and replace them in the database using SQL commands? Or are the table structures for Target Lists different in Suite CRM?

Colin

@colinr

Yes, you can do it.

  1. There are three tables: prospect_lists, prospect_lists_prospects, prospect_list_campaigns
  2. You should change data in columns assigned_user_id, modified_user_id, created_by.

I finally managed to get all my Targets to import and ran the SQL for the tables above which worked perfectly.

Are there any other tables which I can import directly using SQL which share the structure of SugarCRM? For example Leads and Contacts?

Colin

@colinr

You can do it. The structures is equal. SuiteCRM has some addition columns but it will not be problem.