Feature to Feature overwrite.

5915
11
01-20-2015 07:38 AM
lelaharrington
New Contributor III

i am looking to take features from SDE1 and send them to SDE2 and overwrite the features in SDE 2. i tried features to features tool but it doesn't overwrite it. it adds a _1 after the feature name. i am doing this in model builder but i would ike to have it in python when all is said and done with a result log.txt file as well. PLEASE Help!!!!

0 Kudos
11 Replies
Marco_AlejandroBonilla
Occasional Contributor
0 Kudos
lelaharrington
New Contributor III

that is the topic i am in as well. i still have no answer as to where to put the code properly in python to allow it to run.

Thank you

Lela Harrington

0 Kudos
Marco_AlejandroBonilla
Occasional Contributor

After the line "import arcpy..." you could give a return and paste the line as follows:

import arcpy, os,...

arcpy.env.overwriteOutput = True

That should work

0 Kudos
lelaharrington
New Contributor III

yes it does help however i keep getting a syntax error from it. 

i have tried the delete feature and then feature to feature but i can figure out how to prompt after delete to run the feature to feature automatically. so something like. 

delete A,B,C 

then 

SDE1- FEATUREA,B,C to SDE2 CREATE FEATURE A,B,C

Thank you

Lela Harrington

0 Kudos
lelaharrington
New Contributor III

UPDATE!

so i was able to get the arcpy.env.overwriteOutput = True

to work in the python script i got the whole script to run to replace feature class with feature class. when i came in this morning and checked the results. it in fact did not overwrite the data rather even with the code in there it still did the same thing of adding the same named feature class with an _1 after it.

i am using this script to update a feature process. so there is the example of what i am doing

field technicians collect information and populate information into Feature class A in SDE 1 in Midwest America, that information over night (in bulk, feature classes A-ZZ) get transferred to SDE 2 in East America feature class A still has to remain just get overwritten with updates from SDE 1 to SDE 2. This allows for everyone using a  mapping service to see updated information in East America without the server having to fetch the data from the Midwest. which makes the maps regeneration and generation faster as it is accessing local data. once the scrip is proven i plan on putting it on a scheduler and running it over the PM weekly for updating data. the only problem i am having is getting the overwrite of the features. between SDE 1 and SDE 2 as the name has to remain the same every time the data is transferred.

0 Kudos
JoeBorgione
MVP Emeritus

Sometimes killing a connection doesn't quite cut it: to be 100% sure, you should restart the service.

That should just about do it....
0 Kudos
lelaharrington
New Contributor III

I will try that and get back with you 

Thank you

Lela Harrington

0 Kudos
Marco_AlejandroBonilla
Occasional Contributor

Could you post the Py code and the results of the process please?

0 Kudos
lelaharrington
New Contributor III

Please see attached

0 Kudos