Select to view content in your preferred language

Recover survey data from .sqlite database on mobile device

7865
12
11-06-2017 11:13 AM
SimonAllard2
Regular Contributor

https://community.esri.com/thread/183922-download-survey-from-device-after-upload-failed 

Has anyone developed a python script to extract the feature class data from the sqlite database? We had a schema change in a survey which overwrote the data on the hosted layer in ArcGIS Online and we would like to recover the data from the device and append this to the new survey layer.

Thanks for any help,

Cheers,

Simon

12 Replies
by Anonymous User
Not applicable

try using the tool within desktop named "Copy Runtime Geodatabase to File Geodatabase" and this should do the trick for you.

Here is the online help page - Copy Runtime Geodatabase To File Geodatabase—Help | ArcGIS for Desktop 

Hopefully that works well for you.

Mike

0 Kudos
SimonAllard2
Regular Contributor

Hi Mike,

Thanks for that. The ‘copy runtime to file geodatabase’ doesn’t run on .sqlite database – the tool fails. I changed the extension to .geodatabase and the tool ran but the result is a table – the same table that you can view directly as a .sqlite database in ArcCatalogue.

When I used this tool on a .geodatabase file from Collector for ArcGIS – the output is a feature class with the relationship class and attachment table (if attachments are enabled).

Therefore, this isn’t really working for me.

Any other tips?

Cheers,

Simon Allard

GIS Analyst

Bay of Plenty Regional Council Toi Moana

0 Kudos
by Anonymous User
Not applicable

Simon,

Interesting to know as so far we have not had to recover surveys from the devices as of yet. I thought that this tool would possibly work on the data set in the same manner as we have for this same issue with Collector.

There are these two posting from other users asking a similar question that could be of use.

Extracting Survey123 data from Device 

Download survey from device after upload failed 

Mike

0 Kudos
SimonAllard2
Regular Contributor

Thanks Mike,

We ended up downloading the Desktop App of Survey123, loading the survey, and pasting the .sqLite database in the parent directory for the database of that survey. We then clicked on the 'Fix Database' button and that seemed to reconcile the database changes and we able to ship on those surveys that were stored on the device to AGOL.

Cheers,

Simon

by Anonymous User
Not applicable

Simon,

No worries and glade it helped you out.

Mike

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Simon,

Please refer to GitHub - tedrick/ReadS123DB: Convert the survey data stored in the Survey123 Field App into a set of...  

Note that Survey123 does not use the runtime GDB format of sqlite.

0 Kudos
JamesWilson2
Regular Contributor

This is brilliant! Any chance of getting it to work with repeats? All I get is a reference to the related table, none of the data (I need the details from >TreeDet):

0 Kudos
RobBlash
Frequent Contributor

I tried to use this script (via a toolbox, added new script and pointed to the .py fle) and it runs in less than 1 second with no output. Any ideas on how to figure out what's going on? I also tried pasting the code directly into the python window in catalog and running it that way (both times I updated the scrip to hard code the path to sqlite db and the out folder ) wit no luck.

0 Kudos
SethPaine1
Occasional Contributor

I created a script to allow importation of a Survey123 SQLite database downloaded from a device into a geodatabase:

arcpy - Importing Survey123 SQLite Database from Device - Geographic Information Systems Stack Excha... 

0 Kudos