Select to view content in your preferred language

Append extracted data to SDE (Collector for ArcGIS Workaround)

6077
4
Jump to solution
11-12-2015 08:54 AM
JacquelineKovarik
Deactivated User

Hello,

I have been unable to synchronize collected data in one of my Collector apps (I believe this might be due to the number of attachments). I've tried all suggestions in this forum, and now have manually extracted and converted my collected data into a File Geodatabase.

I'm wondering how to go about "merging" this file geodatabase into my SDE geodatabase on our GIS Server, while maintaining the Global IDs and related attachments I've configured.

Has anyone been through this process? If so, could you provide some info on how you did it?

Thank you!

Jacqueline

1 Solution

Accepted Solutions
JacquelineKovarik
Deactivated User

Hi Dan,

Thanks for the quick reply! I stumbled upon this amazing Python script this afternoon that did exactly what I was looking for:

bnadler/Append-Features-With-Attachments · GitHub

It saved me hours of work, and I hope it does the same for others looking for an easier solution!

Thanks,

Jacqueline

View solution in original post

4 Replies
danbecker
Frequent Contributor

Here are instructions I wrote for myself a few months ago. A few of the steps regarding new feature class you can omit because you already have a "new feat class" which is your original SDE gdb. Rem. to add field, as specified in step 2.

HOW TO MOVE FEATURE ATTACHMENTS FROM 1 GDB TO ANOTHER

1. create new geodatabase

2. create new feat. class in new geodatabase

    -geometry has to be the same as the source feature class that has feat. attachments

    -for fields, use the import button and specify source feature class

    -add additional field name: alias_GID type: text, length: 150

3. enable attachments on new feature class

4. append source feature class to new feature class

    -NO TEST

    -add field source.GlobalID to target.alias_GID

5. create new field in new feature attachment table named "REL_alias_GID" type: text, length: 150

5. append source feature attachment table to new feature attachment table

7. field calculate new feature attachment table REL_alias_GID to [REL_GLOBALID]

8. join new feature class.alias_GID .. TO .. new feature attachment table.REL_alias_GID

left table is new feature attachment table

right table is new feature class

9. field calculate new feature attachment table REL_GLOBALID to new feature class.GLOBALID

JacquelineKovarik
Deactivated User

Hi Dan,

Thanks for the quick reply! I stumbled upon this amazing Python script this afternoon that did exactly what I was looking for:

bnadler/Append-Features-With-Attachments · GitHub

It saved me hours of work, and I hope it does the same for others looking for an easier solution!

Thanks,

Jacqueline

by Anonymous User
Not applicable

Hi Jacqueline,

I have a same issue. I want to transfer my FGDB with Collector attachments to SDE without losing attachments. I tried to run this script but I am getting an error. I just changed the updateFeatureClass & targetFeatureClass parameters in the entire script

def main():
    updateFeatureClass = r'\\central\gis\development\slm_pj\PJ\OSC_SurveyData_Final.gdb\osc_lito'
    targetFeatureClass = r'Database Connections\GISDATA@gdbmaint@stgisgdb1.sde\gdbmaint.GISDATA.OSCTest\gdbmaint.GISDATA.osc_lito'

Error:

File "U:\PJ\SLM\Codes\Append-Features-With-Attachments-master\AppendFeaturesWithAttachments.py", line 74, in appendFeatures
    editor= arcpy.da.Editor(desc.path)
RuntimeError: cannot open workspace

Any idea what should I do to run it successfully?

Thanks in Advance.

PJ

0 Kudos
CraigPrisland2
Regular Contributor

Hi Dan,

Thanks for the instructions.  I just had one quick question.  In your last step you mention to field calculate the GlobalID field.  I cannot figure out how you did this.  Since this is a GlobalID field type, the Field Calculate option is grayed out.  Am I missing something?  Thanks in advance!

Craig 

0 Kudos