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!!!!
It seems that coding has no problem. It should be a locking issue. Considering that connection to SDE2 features remains active in the moment you try to replace them, the model won't be able to replace the feature class, instead of this it creates another feature with a new name.
You should try disconnecting users and if necessary stopping the services and then start them again as Joe said.
Also, I would try to empty the data inside the feature class in SDE2 and filling it again with the new data of SDE1 so the FC don't have to be deleted
Please see attached
Could you post the Py code and the results of the process please?
I will try that and get back with you
Thank you
Lela Harrington
Sometimes killing a connection doesn't quite cut it: to be 100% sure, you should restart the service.
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.
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
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
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.
This topic may help you
Overwrite Existing File - Model Builder
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.