AnsweredAssumed Answered

Python Script to Automate a FC to FC/FGDB opertation ArcGIS Pro

Question asked by vrenforth on Dec 10, 2018
Latest reply on Jan 4, 2019 by jskinner-esristaff

I am trying to create a script that will automate a Feature Class to Feature Class OR Feature Class to File Geodatabase Conversion. I want to save this in a folder as a back up once a week in case I lose my current data for any reason or need to revert to that download date. So far I have the following code just for the FC to FC operation, and am recieving the error that follows.:

import arcpy
arcpy.env.workspace = "https://services.arcgis.com/T2graiaSQnlmwwmp/arcgis/rest/services/Target_Address_7_6_Backup/FeatureServer"
arcpy.FeatureClassToFeatureClass_conversion("Target Address New",
"C:\\Users\vmrenfor\Consumers Folders\VSR\BackupExports\VSR Back up\VSR Back up.gdb",
"Target_Adrress_12_10_2018")

Traceback (most recent call last):
File "<string>", line 5, in <module>
File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\conversion.py", line 860, in FeatureClassToFeatureClass
raise e
File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\conversion.py", line 857, in FeatureClassToFeatureClass
retval = convertArcObjectToPythonObject(gp.FeatureClassToFeatureClass_conversion(*gp_fixargs((in_features, out_path, out_name, where_clause, field_mapping, config_keyword), True)))
File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py", line 496, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Output Location: Dataset C:\Users mrenfor\Consumers Folders\VSR\BackupExports\VSR Back up\VSR Back up.gdb does not exist or is not supported
Failed to execute (FeatureClassToFeatureClass).

Any thoughts on how I can fix this error would be appreciated. I would then like this to be run each subsequent week, naming the file "Target_Address_{Current Date}.

Outcomes