CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Exporting failed import records from DB
Pages: [1]

Author Topic: Exporting failed import records from DB  (Read 1524 times)

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Exporting failed import records from DB
March 13, 2009, 03:56:28 am
I love the CSVs CiviCRM now does for import errors, import duplicates and invalid rows when importing contacts. I hadn't noticed this feature until 2.2 so assume it's a recent addition.

I ran an import of approximately 12,000 contacts a few days ago, and left it overnight - in the morning it was sitting at 99% (with ~ 50 records to go) and not progressing.

I'm repeating the export now, and am thinking that I *may* encounter the same situation. If so, I hope to be able to export the same CSV files of invalid rows and duplicates, so that I can make sure those records are cleaned up and imported separately.

Can anyone tell me how I could best export the records which have not been imported? Looks like I can inspect the _status, _statusMsg and _id columns of the civicrm_import_job_* tables - is there any other data I should aim to preserve as well? Is there an easy way to extract the CSVs directly (ie by URL)?

Thanks in advance!
@xurizaemon ā— www.fuzion.co.nz

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Exporting failed import records from DB
March 13, 2009, 01:18:27 pm
OK, so the import looks like it's completed, because the civicrm_import_job_XXXX table which showed 11,000 contacts last night has been removed. But onscreen, it's still sitting at this point:

(http://forum.civicrm.org/index.php?action=dlattach;topic=7036.0;attach=898;image)

Because the civicrm_import_job table has gone, I can't extract the information from there as I'd anticipated. And because the importer hasn't yet completed (and I suspect never will), I won't be able to use the links to download the CSV reports for dupes and errors.

I had a dig around and it looks like the duplicates and errors has been left in the two files files/civicrm/upload/sqlImport.errors and files/civicrm/upload/sqlImport.duplicates instead. (If this isn't correct, please let me know!)

Is there a URL I could paste in to access the download of those CSVs, even though the final screen never displays?

I'm using 2.2-stable downloaded yesterday.

(I can supply a test SQL file and mapping for import if you want to test this?)

Also: If my assumption about those two files is correct, then the naming is slightly inconsistent. CiviCRM offers a download file BEFORE the import, which is labelled "import errors", and potentially two more downloads AFTER the import, labelled "invalid rows" and "duplicates". If I'm correct that the two files left behind are the files I could only access after the import, then the one named "sqlImport.import_errors" is actually the invalid rows file, not the import errors file.
« Last Edit: March 13, 2009, 01:29:48 pm by xurizaemon »
@xurizaemon ā— www.fuzion.co.nz

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Exporting failed import records from DB
March 14, 2009, 03:17:07 pm
Good reason to always accept the 'error' csv that gets offered at Step 3.

Also simple way to check if import is complete is just to search your civicrm for the last person on your import - my experience is the import is entirely 'linear', so the last one on the csv is the last one to import.

Also Chris we ran in to this or v similar problem and you supplied me with the error files I needed - maybe your request above is different, but does this post make sense http://forum.civicrm.org/index.php/topic,3619.msg16545.html#msg16545
Quote
When the import is done, the import file is stored in the directory files/civicrm/uploads

If the original upload was
   Parl.csv

Then the remaining files will be named like
   Parl_MD5STRING.csv.unknown
   Parl_MD5STRING.csv.unknown.duplicates
   Parl_MD5STRING.csv.unknown.error.log
   Parl_MD5STRING.csv.unknown.errors
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Exporting failed import records from DB
March 15, 2009, 01:25:04 pm
Quote from: peterd on March 14, 2009, 03:17:07 pm
Good reason to always accept the 'error' csv that gets offered at Step 3.

Did that; these additional duplicates and invalid records appear to be ones which CiviCRM detected after that stage. (Duplicates in the import can't be detected until it's loaded, etc. CiviCRM 2.2 seems to have improved reports on failed imports from 2.0.)

Quote from: peterd on March 14, 2009, 03:17:07 pm
Also simple way to check if import is complete is just to search your civicrm for the last person on your import - my experience is the import is entirely 'linear', so the last one on the csv is the last one to import.

Good tip, that would have confirmed that the import was finished, but as the civicrm_import_* table had been removed I figured this was the case anyway. Useful way to double check though.

Quote from: peterd on March 14, 2009, 03:17:07 pm
Also Chris we ran in to this or v similar problem and you supplied me with the error files I needed - maybe your request above is different, but does this post make sense http://forum.civicrm.org/index.php/topic,3619.msg16545.html#msg16545
Quote
When the import is done, the import file is stored in the directory files/civicrm/uploads

If the original upload was
   Parl.csv

Then the remaining files will be named like
   Parl_MD5STRING.csv.unknown
   Parl_MD5STRING.csv.unknown.duplicates
   Parl_MD5STRING.csv.unknown.error.log
   Parl_MD5STRING.csv.unknown.errors

Yes! Looks like the filenames are changed in CiviCRM 2.2, and for SQL imports the MD5 string is removed (which means that you may not get a chance to recover those files if you've done another import since).
@xurizaemon ā— www.fuzion.co.nz

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Exporting failed import records from DB

This forum was archived on 2017-11-26.