Skip to main content

GROWING AND SUSTAINING RELATIONSHIPS

GROWING AND SUSTAINING RELATIONSHIPS
Close
Katy Jockelson

Implementor, administrator

Third Sector Design

http://thirdsectordesign.org

We work with non-profits to help them use and understand Civi. It's such an important tool for these organisations and it's great to see people using it in different and interesting ways. Using and working with Civi is made so much more fun and useful by the enthusiastic and talented community surrounding it.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Arthur Richards

DEVELOPER

WIKIMEDIA FOUNDATION

http://wikimediafoundation.org

At the Wikimedia Foundation, we leverage CiviCRM to maintain millions of records of donors and their contributions. Working with the product and particularly with the community has been a terrific experience. There's nothing quite like two open source organizations working together to meet their respective goals while ultimately strengthening the open source community as a whole.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Tim Otten

DEVELOPER AND IMPLEMENTER

CiviCRM

http://civicrm.org
GROWING AND SUSTAINING RELATIONSHIPS
Close
Allen Gunn

Ally, FanBoy

Aspiration

http://aspirationtech.org/

By giving the nonprofit sector a values-driven, free/open source solution for CRM needs!

GROWING AND SUSTAINING RELATIONSHIPS
Close
Xavier Dutoit

Developer and Implementor

Tech to the People

http://techtothepeople.com

Over the past 15 years I've been involved in several open source communities.
CiviCRM is without any doubt the one that has the strongest focus in welcoming "newbies" and letting everyone feel at home here. Another impressive feature is the focus on shipping. No matter what you think of CiviCRM today, you are almost sure that there will be a newer and better version in a few months.

GROWING AND SUSTAINING RELATIONSHIPS
Close
David Moreton

Consultant

Circle Interactive

http://www.civisites.com

We help many not for profits implement CiviCRM through consultancy, training, configuration and custom development. Many of them come from a painful world of old Access databases, multiple spreadsheets and even paper. It's really satisfying to
help people move on with a system that's so much in tune with their own ethics of sharing and collaboration. We also 'eat our own dog food' and use Civi in-house for our client records because we love the flexibility and control it gives us.

For us it's important to share code and advice with other members of the community when we can because we know we get it back in help at other times. The community really is awesome and one of the friendliest and undaunting I've come across. We appreciate the huge value of the software to us and our clients so we try to contribute back and make it even better.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Donald Lobo

Implementor, Developer

CiviCRM LLC

http://civicrm.org

Still thinking of a deep deep quote. Basically:

It is super important for non-profits, advocacy and related groups to take charge of their destiny. Having control of your data is a good start. The crowd-sourced nature of an open source project in so in line with the co-operation and principles of most non-profits

CiviCRM is a project that strives to make the above possible. It is FREE as in kittens.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Jamie McClelland

DEVELOPER AND IMPLEMENTER

PROGRESSIVE TECHNOLOGY PROJECT

http://progressivetech.org
GROWING AND SUSTAINING RELATIONSHIPS
Close
Abril Rocabert

Administrator and End-user

http://www.alternativasycapacidades.org

CiviCRM is a powerful tool that could be really useful for many non-profits in Mexico.
Unfortunately the community is very small in my country. I hope that in the next years the community expands around Latin America.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Michael Daryabeygi

Implementor

Ginkgo Street Labs

http://ginkgostreet.com

CiviCRM enables me to empower my clients with a database that suits their unique needs.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Brylie Oxley

End-user and Developer

Woolman Sierra Friends Center

http://woolman.org

Working with CiviCRM enriches our commonwealth. Any investment in CiviCRM is
shared by the community as a whole. Community organizations naturally complement the spirit of Free/Libre Software.

GROWING AND SUSTAINING RELATIONSHIPS
Close
Peter McAndrew

Implementor, Developer

Third Sector Design

http://www.thirdsectordesign.org

Being part of the CiviCRM community is really something to shout about! Not only is CiviCRM an amazing software package, its designed for organisations that make a difference in the world. We help non-profits across the UK gain control of their data through the power of CiviCRM.

It is without a doubt the best piece of software I've ever worked with, and I'm constantly discovering cool new features. More recently I've been working on CiviMobile as part of a project for my course at University. I'm really looking forward to seeing this being used by organisations across the globe.

LOGIN | REGISTER
  • Create new account
  • Request new password

Search form

  • BLOG
  • DEMO
  • Find An Expert
  • NEED HELP
  • SUPPORT US
  • DEVELOPER RESOURCES
CiviCRM Community Site logo CiviCRM Community Site
  • WHAT IS CIVICRM
    • Community
    • Case Studies
    • Experts
    • Contributors
    • Core Team
    • Licensing
    • Contact Us
  • WILL CIVICRM MEET YOUR NEEDS?
    • Contacts
    • Contributions
    • Communications
    • Peer-To-Peer Fundraisers
    • Advocacy Campaigns
    • Events
    • Members
    • Reports
    • Case Management
  • GET STARTED
    • Evaluate Your CRM Needs
    • Evaluate CiviCRM Features
    • Read Books
    • Demo CiviCRM
    • Download CiviCRM
    • Find An Expert
  • PARTICIPATE
    • Join the CiviCRM Community
    • Read Our Blog
    • Community Forum
    • Attend a Training or Meetup
    • Make It Happen
    • Contribute
    • Become A CiviCRM Developer
    • Issue Tracker
    • Help with Documentation
    • Translate

You are here

Home » Blogs » xavier's blog

Blog

  • Architecture Series
  • CiviCampaign
  • CiviCase
  • CiviCon
  • CiviContribute
  • CiviCRM
  • CiviCRM API
  • CiviCRM Code Sprint
  • CiviCRM Meetups
  • CiviCRM Release
  • CiviCRM Solutions (case studies and user stories)
  • CiviCRM Team
  • CiviCRM Training
  • CiviCRM v1.6
  • CiviCRM v1.7
  • CiviCRM v1.8
  • CiviCRM v1.9
  • CiviCRM v2.0
  • CiviCRM v2.1
  • CiviCRM v2.2
  • CiviCRM v2.3
  • CiviCRM v3.0
  • CiviCRM v3.1
  • CiviCRM v3.2
  • CiviCRM v3.3
  • CiviCRM v3.4 and v4.0
  • CiviCRM v4.1
  • CiviCRM v4.2
  • CiviEvent
  • CiviMail
  • CiviMember
  • CiviMobile
  • CiviPledge
  • CiviReport
  • Documentation
  • Drupal
  • Extensions
  • Finance and Accounting
  • Interface Design and Layout Standards
  • Internationalization and Localization
  • Joomla
  • Older Versions
  • Schools
  • WordPress

New tools to automate the configuration and staging/production migration

Submitted by xavier on April 15, 2011 - 04:22

Have you ever clicked a few zillion time on the admin interface to create a lot of groups, tags, values for a custom field... ?

Have you ever screamed having to do the same tedious tasks you did on the staging one more time on the production site?

Have you cursed the import wizard after having clicked again and again on the next button ?

Friends of the shell, rejoice, the API is there to the rescue and tech to the people has contributed a few simple tools. As of civicrm 3.4, we have introduced 3 scripts: bin/csv/export.php bin/csv/import.php and bin/csv/delete.php

They allow to import (create or update), export and delete any entity exposed by the API (almost everything).

The syntax is simple: the first line is the name of the fields all the others are entities. you can find the name of these fields using the getfields action on any entity from the API explorer

Say that you want to create several tags. create a file /tmp/tag.csv

name,description
Tag A, description A
Tag B, description B
...


cd your/civicrm/root
php bin/csv/import.php -uyourlogin -pyourpass -syoursite Tag /tmp/tag.csv
line 2: created Tag id= 26
line 3: created Tag id= 27

...

 

You can then export them all

php bin/csv/export.php -uyourlogin -pyourpass -syoursite Tag > /tmp/tagall.csv

or filter the exports, eg only the Tag A (filtering by name)

php bin/csv/export.php -uyourlogin -pyourpass -syoursite 'name=Tag A' > /tmp/tagA.csv

equivalent of filtering by id

php bin/csv/export.php -uyourlogin -pyourpass -syoursite id=26

 

and delete in batch too

php bin/csv/delete.php -uyourlogin -pyourpass -syoursite taga.csv

 

We have been using it for a while. Beside offering a faster tool to create or edit a lot of entities, that has been proven very convenient to migrate data between environments. And we are using it with git as a way of backuping and keeping an history of some key configuration elements and being able to restore/apply them on a more granuar basis than sql dumps.

 

We also have found it very convenient to configure civicase to create the needed relationships and activity types.

eg. to export all the activity types (and by importing OptionValue with the column option_group_id = 2 you will create/update them)

php bin/csv/export.php -uyourlogin -pyourpass -syoursite  OptionValue option_group_id=2

It works as well for the values of custom fields that are a list (select/radio...)

 

To make easier to generate an empty csv with the right column names, add a criteria id=0, eg. to prepare the file to create tags:

php bin/csv/export.php -uyourlogin -pyourpass -syoursite  Tag id=0
id,name,description,parent_id,is_selectable,is_reserved,is_tagset,used_for,created_id,created_date

In that example, you can delete most of the columns beside the name if you don't need them, the API is trying to have sensible defaults (eg a tag will be for contacts).

 

A last tip, you can also use it to export/import contacts, for instance to export the name and email of the organisations in the group 42

php bin/csv/export.php -uyourlogin -pyourpass -syoursite Contact contact_type=Organization return=sort_name,email

1,"Inner City Arts",Organization,0,95,cityart@example.com
42,"Compasspoint  ",Organization,0
47,"Social Source Foundation  ",Organization,0,32,socialsourcefoundation@yahoo.co.in
52,"Compasspoint  ",Organization,0
71,"Cisco Systems  ",Organization,0,40,ciscosystems@aol.co.pl
73,"Conservation Corp  ",Organization,0,44,conservationcorp@yahoo.net
75,"Conservation Corp  ",Organization,0,38,conservationcorp@indiatimes.edu.in
93,"Project Open Hand  ",Organization,0,42,projectopenhand@tsec.net
95,"Eastmont Computing Center  ",Organization,0,36,eastmontcomputingcenter@brown.net.in
101,"Conservation Corp  ",Organization,0,34,conservationcorp@yahoo.edu

 

Next time you have batch actions, try using these API tools, you'll love it, and who knows, you might even find a new nice feature one of the api is missing and contribute back?

 

Why is that a shell tool? Isn't there a web interface too I can almost hear you asking?

 

Because the cli is a much more convenient tool to handle these batch tasks and deal much better with files that are a lot bigger (eg if you start exporting/importing loads of contacts). It's also made to be scripted, so for instance sending you by email weekly the organisations above is a trivial oneliner. Really, you should have a server that offers you a ssh access and spend the time to learn bash, at least for the basic stuff.

 

This being said, if enough of you are interested of having a web interface too, you can make it happen...

 

X+

  • xavier's blog
  • Log in or register to post comments

Comments

Good stuff

Permalink Submitted by ErikHommel on April 15, 2011 - 11:08

Nice one, tech to the people!

  • Log in or register to post comments

OMG OMG OMG OMG

Permalink Submitted by kylejaster on April 15, 2011 - 12:33

somebody is owed much warm beer :)

 

 

this is AWESOME.

  • Log in or register to post comments

Wow, this is great

Permalink Submitted by jalama on April 16, 2011 - 13:47

Kyle can get the first round, I'll buy the rest!

  • Log in or register to post comments

Very cool.  By integrating

Permalink Submitted by dalin on April 16, 2011 - 23:18

Very cool. 

By integrating with Drush you could skip the u/p requirements and be able to a lot of other cool things. 

  • Log in or register to post comments

Agree, would be nice

Permalink Submitted by xavier on April 17, 2011 - 00:14

It would apply as well to the other bin scripts (eg. to send emails/process bounces...). Could you try patching bin/cli.php so it's drush aware ?

 

X+

  • Log in or register to post comments

Does this still work?

Permalink Submitted by Joseph (not verified) on October 20, 2011 - 14:19

I've tried it on 3.4.6 and 3.4.7, and I can't get either the import or export scripts to work (I haven't tried the delete script.)

For import, I don't get any errors, but nothing is put into the DB.

For export, I don't get any errors, the file is created, but it is empty.

  • Log in or register to post comments

CIVICRM


GROWING AND SUSTAINING RELATIONSHIPS

WHAT IS CIVICRM
  • Community
  • Case Studies
  • Experts
  • Contributors
  • Core Team
  • Licensing
  • Contact Us
WILL CIVICRM MEET YOUR NEEDS?
  • Contacts
  • Contributions
  • Communications
  • Peer-To-Peer Fundraisers
  • Advocacy Campaigns
  • Events
  • Members
  • Reports
  • Case Management
GET STARTED
  • Evaluate Your CRM Needs
  • Evaluate CiviCRM Features
  • Read Books
  • Documentation
  • Demo CiviCRM
  • Download CiviCRM
  • Find An Expert
PARTICIPATE
  • Join the CiviCRM Community
  • Read Our Blog
  • Community Forum
  • Attend a Training or Meetup
  • Make It Happen
  • Contribute
  • Become A CiviCRM Developer
  • Issue Tracker
  • Help with Documentation
  • Translate