Load json to ODKAggregate


(Luis Carrillo) #1

hi!

Is there a way to load a json file, which contains all forms answers, to ODKAggregate? the json file is downloaded from another Aggregate server, which no longer exists, and I only have the json downloaded


(A N M AL IMRAN (Imran)) #2

Hi,

I don't think you can upload json file to Aggregate server. If you have taken any backup using ODK briefcase, you will be able to restore all data.

Thanks


(Dr. Gareth S. Bestor) #3

Do you have the original form that was loaded into the no-longer-existent Aggregate server?


(Luis Carrillo) #4

hi, yes i have the original form.


(Luis Carrillo) #5

unfortunately, do not use briefcase. :pensive:


(Dr. Gareth S. Bestor) #6

If you have the original form you can try to load it into Aggregate, and then convert the JSON you have for the old submissions to their equivalent XML representation, and 'resubmit' them... Although you can technically do a blind JSON-to-XML conversion (eg https://www.freeformatter.com/json-to-xml-converter.html), there's a good chance the XML will have to be tweaked to get it to match, hence why you'd need the original form to determine precisely what its got to look like. It'd take some work, but if you have the JSON and the original form, you might be able to get the data back into Aggregate, with a bit of grunt work.

Alternatively, you could walk thru the JSON data and attempt to directly insert the necessary fields directly into the Aggregate database tables. Again, grunt work.


(Luis Carrillo) #7

It's what I had in mind, and indeed the xml must be adjusted. Thank you


(Dr. Gareth S. Bestor) #8

Good luck! Let us know how you get along. :slight_smile: