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/Export Individual Prefixes?
Pages: [1]

Author Topic: Import/Export Individual Prefixes?  (Read 1208 times)

DerekL

  • I post frequently
  • ***
  • Posts: 132
  • Karma: 1
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.54
  • PHP version: 5.2.17
Import/Export Individual Prefixes?
December 06, 2011, 12:45:47 pm
Hi Guys,

Me again :/

Do you guys know of any clean way to import/export Individual prefixes and suffixes from install to install?

I've got a list of 60 different prefixes/suffixes that I find myself entering manually way too often...

Using API:

I can hit up option groups 6 & 7 (prefix and suffix)

/civicrm/ajax/rest?json=1&debug=1&version=3&entity=OptionGroup&action=get&id=6
/civicrm/ajax/rest?json=1&debug=1&version=3&entity=OptionGroup&action=get&id=7

And I can also pull a list of existing values in each option group with:

/civicrm/ajax/rest?json=1&debug=1&version=3&entity=OptionValue&action=get&option_group_id=6
/civicrm/ajax/rest?json=1&debug=1&version=3&entity=OptionValue&action=get&option_group_id=7


Oh boy. Answered my own question...and gave myself some homework. I'm going to have to add this to my civi-importer module.


And....for search posterity, and those in a rush:

You can use Xavier's wonderful php CLI csv import/export tools.

They are here: /civicrm/bin/csv/

Usage in this scenario would be as such:

php bin/csv/export.php -u username -p password  -s default OptionValue option_group_id=6

To dump all prefixes into a csv.

php bin/csv/export.php -u username -p password   -s default OptionValue option_group_id=7

for suffixes, and so on and so forth.


Thanks for letting me on here still!


« Last Edit: December 06, 2011, 01:13:33 pm by DerekL »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Import/Export Individual Prefixes?

This forum was archived on 2017-11-26.