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) »
  • Import moved contacts
Pages: [1]

Author Topic: Import moved contacts  (Read 468 times)

Anja_mh

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: Drupal 7.24
  • MySQL version: 5.5.31
  • PHP version: 5.4.4
Import moved contacts
May 23, 2014, 04:58:14 am
Hi,

we have some problems with importing moved contacts. We got a list containing a Civi ID (Internal Contact ID) and columns with old Street, Postal Code, City and the current Street, Postal Code and City (one column for each).
We'd like to instert the old adress with the adress type "old" and the current adress with the adress type "Privat". And the current adress should be tagged as "primary location". Both adress types exist.
To import the list isn't the problem. But Civi always tagged the the old adress as "primary location".  ???
I tried to import both adresses at the same time. I also tried to import the old adress first and import the old adress afterwards and to import the old adress first and then the current. But in every case the adress type "old" is tagged as "primary location".
I checked the settings and the adress type "Privat" is marked as default.

The import options for duplicate contacts need to be "update", because some contacts have a old adress which needs to be updated and every contact has a current adress, which needs to overwrite.

(Also checked it on the demo version of Civi with the same result I described).

Does anyone know a solution? I imported the current adress now, but we want to save the old adress, too.
Thank you in advance!

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Import moved contacts
May 26, 2014, 12:14:13 am
Hmm sounds like a little bug in the import fuction. Is it an option to update the data in the database directly after the import? You could update the field 'is_primary' in table civicrm_address using the 'location_type_id' ?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Anja_mh

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: Drupal 7.24
  • MySQL version: 5.5.31
  • PHP version: 5.4.4
Re: Import moved contacts
May 27, 2014, 05:55:52 am
Thank you Erik. Unfortunately, I'm just a "normal" user with no access to the database. I will ask our development-team whether they can do this update function you descibed.

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Import moved contacts
May 27, 2014, 07:19:11 am
I don't think "is_primary" is exposed to the import UI.  However, there IS this extension, which should allow you to import addresses directly, and you can set an "is_primary" column in your CSV: https://civicrm.org/extensions/api-csv-import-gui

Note:  Use that extension on a COPY of your database until you're sure you've got it right!
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

endres.systopia

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: Drupal
  • MySQL version: 5.5.29
  • PHP version: 5.4.10
Re: Import moved contacts
May 27, 2014, 07:36:58 am
Hi Erik!

Quote from: Erik Hommel on May 26, 2014, 12:14:13 am
Hmm sounds like a little bug in the import fuction. Is it an option to update the data in the database directly after the import? You could update the field 'is_primary' in table civicrm_address using the 'location_type_id' ?

You mean like this:
Code: [Select]
UPDATE civicrm_address SET is_primary=0 WHERE location_type_id = @old;
or like this:
Code: [Select]
UPDATE civicrm_address SET is_primary=1 WHERE location_type_id = @private;

Both cases raise the question what happens if we produce two or zero address entries for one contact with the is_primary flag set.

We could extend the SQL query to take care of this, but I wonder if this is really the kind of thing we want in CiviCRM. Shouldn't we rather file a bug report?

Cheers,
Björn

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Import moved contacts

This forum was archived on 2017-11-26.