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) »
  • Using bin/csv/import.php
Pages: [1]

Author Topic: Using bin/csv/import.php  (Read 1074 times)

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Using bin/csv/import.php
September 01, 2014, 02:48:08 am
I just discovered the import.php+export.php+delete.php!
But I can't get the to work, I tried these commands:
Code: [Select]
Manu@TENNOX c:\xampp\apps\drupal\htdocs\sites\all\modules\civicrm\bin\csv
# php import.php -u admin -p admin -s localhost Tag tags.csv
# php export.php -u admin -p admin Tag > tagall.csv
# php export.php -u admin -p admin -s localhost Contact > contacts.csv

But the output is always empty, and imports aren't working either...

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: Using bin/csv/import.php
September 01, 2014, 08:42:48 am
My favorite tool!  I use this almost daily.

php /full/path/to/import.php -e Entity --file /full/path/to/file/to/import.csv

Since you're on Windows, you'll be using backslashes, not slashes, but an example:
php /var/www/mysite/sites/all/modules/civicrm/bin/csv/import.csv -e Contact --file /home/jon/importfiles/contacts.csv
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Re: Using bin/csv/import.php
September 04, 2014, 03:30:20 am
SOLUTION:

Somehow there's no error if the site name is wrong. Very weird.
When I used the right name 'cividev' (didn't know which name to use) It worked!

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Using bin/csv/import.php
September 05, 2014, 02:52:55 am
You might want to report a bug for that so people are aware and it can be fixed to avoid it tripping up others in the future :)
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Re: Using bin/csv/import.php
September 06, 2014, 09:08:16 am
Quote from: Michael McAndrew on September 05, 2014, 02:52:55 am
You might want to report a bug for that so people are aware and it can be fixed to avoid it tripping up others in the future :)

Done. :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Using bin/csv/import.php

This forum was archived on 2017-11-26.