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
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.
Thank you for your reply Seth. There was no .zip file attached in response. Perhaps you could email me directly at simon.allard@boprc.govt.nz<mailto:simon.allard@boprc.govt.nz>
Here is the error I was getting….
My tool looks like this
What are your input and output data types?
Simon Allard
GIS Analyst
Bay of Plenty Regional Council Toi Moana
Hi Simon,
I am running the tool in ArcMap 10.6.1 but the version shouldn’t have too much impact unless its really old.
Try copying the file and folder in this zip to the same location and adding to ArcMap. The script may need editing if your .sqlite file format is substantially different than mine.
Seth
Seth Paine
Geographic Information Systems Specialist
Office of Spill Prevention and Response
California Department of Fish and Wildlife
1700 K Street, Suite 250
Sacramento, CA 95811
Office Phone: (916)324-9817
Seth.Paine@Wildlife.ca.gov<mailto:Seth.Paine@Wildlife.ca.gov>
http://www.wildlife.ca.gov/OSPR
Hi Seth,
Thank you for writing this script!
You mentioned that this script needs to be run from an Arc Toolbox. Do you mean a python toolbox or a normal ArcToolbox? I don’t have much experience creating my own script tools and was having some difficulty getting the toolbox to fetch the input and output parameters.
Also, what version of ArcGIS/ArcGIS Pro have you tested this script in?
Any chance you could set this up in an ArcToolbox and package it up in a .zip file?
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 Exchange
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):
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.
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
Please refer to GitHub - tedrick/ReadS123DB: Convert the survey data stored in the Survey123 Field App into a set of CSV files
Note that Survey123 does not use the runtime GDB format of sqlite.
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?
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.
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.