We use CiviCRM for our nonprofit, and we're trying to figure out how we can export our raw data in order to upload it into some custom apps. Any help would be very much appreciated!

Cheers, Jillian

  • Thanks for your post Jillian. Could you say a bit more about what data you want to export and which apps you want to import it into? Is this a one off transfer or do you want to sync the data from CiviCRM to the apps? Oct 11 '16 at 23:04
  • 1
    Hi William- we're actually looking to access the SQL DB. I did some digging around in the help forums, and it looks like there's a PhpMyAdmin that we should have access to? I'm a very basic user myself, but we're working with a local Computer Science Department to build some apps for us, and they've specifically requested the SQL. Thanks!
    – Jillian
    Oct 12 '16 at 15:30
  • 2
    If supplying SQL dumps to a local CompSci department, consider that you potentially are giving students access to your organisation's entire contact database. This may have repercussions for you and your org; your supporters personal data is not something to be passed around too freely. I suggest discussing with your own advisors and with the relevant teaching institution. Privacy is a consideration for all organisations, but some NGO/nonprofit data can be especially sensitive. Please take care :) Oct 19 '16 at 1:45

The answer rather depends on what data you have in CiviCRM and what you want to export.

One option is to export the data as a CSV file as Demerit says. This will allow you to export certain types of data - for example: contacts, event participants, activities. You can do this via advanced search. See the manual for more details: Exporting your contacts.

Another option is to access the data directly from the database. This gives you more control to access the data that you need but would require some understanding of the database structure and SQL. If you have access to phpMyAdmin you will be able to export the SQL data using this (log in to phpMyAdmin and click on the Export tab). Alternatively your website hosting company may have a tool that allows you to export the SQL - you could contact them for help.

A third option to export the data via the API which would require some programming.

  • Thanks for all of your responses! We're looking for option 2- accessing the SQL directly in the database. We're working with a local Computer Science Department to build out some new apps, and we need the SQL. The CSV files won't be sufficient. Thanks very much!
    – Jillian
    Oct 12 '16 at 15:12
  • I've updated my question with information about phpMyAdmin. phpMyAdmin is a separate tool from CiviCRM so this isn't really a question about CiviCRM but I hope my answer helps. If you get stuck perhaps the Computer Science Department could help you with this? Oct 12 '16 at 17:54
  • Hi William, you said: "You have said that you've got access to phpMyAdmin"
    – Jillian
    Oct 12 '16 at 18:49
  • Sorry! I meant to continue to say that I do NOT have access to phpmyadmin. We just want to have access to the SQL DB. Other links in the knowledgebase mention phpmyadmin, but if there is some other way to get the SQL DB, we'll happily take any advice! We've emailed CV hosting several times for assistance, but have received no response. Thanks for your time!
    – Jillian
    Oct 12 '16 at 18:52
  • Ah, okay, apologies if I misunderstood. I've updated the answer accordingly. I'm afraid that you will need to have access to your hosting package. Do you have access to a control panel? Can the person who set up your CiviCRM site help? Oct 12 '16 at 20:00

Although it is possible to access the DB directly (it's just a MySQL database) that is not the recommended way to integrate with custom apps.

There are ongoing changes to the database tables which mean that even if your app integrates perfectly today, it may break tomorrow with the next release. The API tries hard to insulate you from underlying database changes.

Your local CS Dept should have little difficulty getting started with the API using the information here: https://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API and the built-in API explorer (see same doc) provides an easy way to experiment and learn.



(Adding some.text because it seems stackexchange wants at least 30 chars of text. Ignore this text and just follow the link.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.