0

I have a series of surveys on ODK Aggregate and want to access the resultant information as tables in a database hosted via MySQL Server. Of course, I can just download the data off of ODK Aggregate and manually add it to a database on MySQL. My question is how to link ODK Aggregate to MySQL so that every time a new entry is added to the spreadsheets in ODK Aggregate it shows up in a MySQL database. (I have installed ODK Aggregate via Google’s App Engine)

ODK Aggregate gives a number of options for "publishing" data, all of which offer the ability to "stream new submissions," which is what I'm looking for. What I can't figure out is how to get from the publishing options they give into MySQL.

The options they give are 1. Google FushionTables 2. Google Spreadsheet 3. Z-ALPHA Google Maps Engine 4. Z-ALPHA REDCap Server 5. Z-ALPHA JSON Server 6. Z-ALPHA Ohmage JSON Server

Can one of these be set up to send data into MySQL?

If not, is there another way to create surveys whose results are automatically sent to a database on MySQL Server?

A thousand thanks.

Jason
  • 311
  • 3
  • 5

3 Answers3

0

The easiest way to solve your problem is to install ODK Aggregate on a Tomcat install with a MySQL backing. http://opendatakit.org/use/aggregate/tomcat-install/ has instructions.

yanokwa
  • 1,408
  • 1
  • 12
  • 23
0

Another option that is not supported by the official ODK community is to use a docker image of aggregate that Sean Herman created from the Aggregate source code. Once you get Docker installed by following this guide you can simply run two commands that fetch the docker image and launch both the MySQL container and the ODK aggregate container. Here is an example of the two commands: (please note that the environment variables should be changed to suit your needs.)

$ docker run -d --name <your mysql container name> -p 3306:3306 -e MYSQL_ROOT_PASSWORD=<your password> -e MYSQL_DATABASE=<your schema name> -e MYSQL_USER=<your MySQL user name> -e MYSQL_PASSWORD=<your MySQL user password>  mysql:5.7  

Note that for the port mapping (-p) option accepts arguments as follows: ($HOSTPORT:$CONTAINERPORT)

Now run an ODKAggregate image with this command:

$ docker run -d --name <your aggregate container name> --link <your      mysql container name> -p 8080:8080 -e DB_CONTAINER_NAME=<your mysql container name> -e MYSQL_DATABASE=<your schema name> -e MYSQL_USER=<your MySQL user name> -e MYSQL_PASSWORD=<your MySQL user password> -e ODK_HOSTNAME=<wherever you are hosting your container... this must be the same as the url> -e ODK_ADMIN_USERNAME=<your admin user name> kharatsa/odkaggregate:latest

This saved me many hours of setting up ODK with Tomcat and I hope it helps you!

Ethan Keller
  • 963
  • 3
  • 10
  • 26
0

You can use: https://github.com/ilri/odktools ODK Tools is a toolbox for processing ODK survey data into MySQL databases

acoto
  • 9
  • 1