Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Importing Data

Tim Morgan edited this page Sep 30, 2015 · 4 revisions

OneBody is most useful to your community when it can be used as a directory to find people by name, location, picture, etc. Importing all your data will seed your database with profiles for every member.

As of OneBody 3.5.0 we have a brand-new CSV import that rocks.

Depending on your needs, you can either do a one-time import or regularly sync your data. Choose the appropriate section below:

One-Time Import

  1. Create a CSV (Comma Separated Values) file in Excel or Google Drive, or whatever program you use. The first row should contain headings like first_name, last_name, email, etc.

    The minimum recommended columns are:

    • first_name
    • last_name
    • email
    • mobile_phone
    • family_name
    • address
    • city
    • state
    • zip
  2. Visit your OneBody site and go to the Admin dashboard. Click the small CSV upload button in the bottom-right.

  3. Select your CSV file and follow the steps to import your data.

Regular Sync with an External DB

You probably already have a Church Management System (ChMS) and you'd like to sync the data between it and OneBody.

You could manually import data using the UI on a regular basis, but it is better to automate.

To sync data nightly (or whatever frequency you choose), you will need to find a way to export data from your existing ChMS automatically. One way to do that is to query data directly from the SQL database. (Unfortunately, this part is the hardest and there is no one-size-fits-all solution.)

Here are some tips to help you get the most out of your data:

  • Use legacy_id and legacy_family_id columns to link your external database IDs. This will make sure people and family records in the OneBody database can always be tied back to the records in your ChMS database.
  • You can sync relationship data from your ChMS to OneBody using the relationships string. Use the legacy_id and separate relationships with a comma, like this: legacy_id[relationship],legacy_id[relationship], e.g. 1234[son],2345[daughter].
  • Use classes string of the form code,code[role], e.g. e123,s345[leader]. See How Group Membership Works for more info. Roles are optional and do not currently display in the OneBody UI (though there is an issue to expose them in the UI).
  • Use this ruby script to sync data from your command line.
  • Automate calling the script every night using cron or another scheduling software.