Answers.Body: <p>The CLI Contact import is meant to work on a per-entity basis, since it uses the API.  So Contact is a separate entity from Address.  The Contact entity API has a couple of hacks to accept certain parameters from other APIs - e.g. primary email address - but generally speaking, what you're doing is unsupported.</p>
  
  <p>If you'd like to do what you're doing via command-line, you have a couple of options:</p>
  
  <ul>
  <li>Pull the contact ID into your CSV, and do a second import using the Address entity.</li>
  <li>Write a small PHP script that handles this using the API Chaining rules.</li>
  <li>If you're super-ambitious, you could write support for API Chaining into the existing CLI import, or submit a paid issue queue item to the core team to do so.</li>
  </ul>
  
  <p>If this is a one-time import and you're not a coder, the first choice is the easiest.  Do your initial contact import first.  I use a tool called Pentaho Kettle to automate the process of substituting contact IDs into my address etc. imports - but it's got a steep learning curve if this is a one-off job.  Instead, export contact ID and external identifier from Civi, open it in a spreadsheet program, and use a VLOOKUP formula to generate your address import.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2016-01-29T21:37:26.780Z
Answers.LastActivityDate: 2018-12-31T03:27:34.600Z
Answers.LastEditDate: 2018-12-31T03:27:34.600Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I have a local test environment on a mac where the site is installed.</p>
  
  <p>I'm trying to do a CLI import via the mac terminal and unfortunately, address details are not being imported.</p>
  
  <p>Command Used:
  php [absolute path]/sites/all/modules/civicrm/bin/csv/import.php -e Contact --file [absolute path]/csv/test.csv</p>
  
  <p>Column headers:
  "contact_type","email","first_name","middle_name","last_name","street_address","city","state_province","country","gender","custom_1"</p>
  
  <p>Sample CSV:
  "Individual","person.email@local.dev","FirstName","MiddleName","LastName","Street Address Details","City Name","State Name","Country Name","Female","custom_1 value"</p>
  
  <p>As you can see above, there's even a custom value and it get's imported, but address details are not.</p>
  
  <p>Please help.</p>
  
  <p>Mac: El cap, Drupal: 7, CiviCRM: 4.7</p>
  
Tags: <api><import><error><cli>
Title: CLI Contact Import is not importing address details
ThreadText: # CLI Contact Import is not importing address details
  
  (Asked by: username_0 on 2016-01-29)
  
  I have a local test environment on a mac where the site is installed.
  
  I'm trying to do a CLI import via the mac terminal and unfortunately, address details are not being imported.
  
  Command Used:
  php [absolute path]/sites/all/modules/civicrm/bin/csv/import.php -e Contact --file [absolute path]/csv/test.csv
  
  Column headers:
  "contact\_type","email","first\_name","middle\_name","last\_name","street\_address","city","state\_province","country","gender","custom\_1"
  
  Sample CSV:
  "Individual","person.email@local.dev","FirstName","MiddleName","LastName","Street Address Details","City Name","State Name","Country Name","Female","custom\_1 value"
  
  As you can see above, there's even a custom value and it get's imported, but address details are not.
  
  Please help.
  
  Mac: El cap, Drupal: 7, CiviCRM: 4.7
  
  **Tags:** api, import, error, cli
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-01-29. Score: 4
  
  The CLI Contact import is meant to work on a per-entity basis, since it uses the API. So Contact is a separate entity from Address. The Contact entity API has a couple of hacks to accept certain parameters from other APIs - e.g. primary email address - but generally speaking, what you're doing is unsupported.
  
  If you'd like to do what you're doing via command-line, you have a couple of options:
  
  * Pull the contact ID into your CSV, and do a second import using the Address entity.
  * Write a small PHP script that handles this using the API Chaining rules.
  * If you're super-ambitious, you could write support for API Chaining into the existing CLI import, or submit a paid issue queue item to the core team to do so.
  
  If this is a one-time import and you're not a coder, the first choice is the easiest. Do your initial contact import first. I use a tool called Pentaho Kettle to automate the process of substituting contact IDs into my address etc. imports - but it's got a steep learning curve if this is a one-off job. Instead, export contact ID and external identifier from Civi, open it in a spreadsheet program, and use a VLOOKUP formula to generate your address import.
  
  
  ---
  
  