Thanks for the replies. I have added delete FGDB and create file GDB and but it seems as my input features are not supported.I would still just like to replace it instead of deleting the FGDB.Traceback (most recent call last): File "C:\GIS\Python\BackupCCAP.py", line 20, in <module> arcpy.FeatureClassToGeodatabase_conversion(CCAP, CCAP2) File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\conversion.py", line 1569, in FeatureClassToGeodatabase raise eExecuteError: Failed to execute. Parameters are not valid.ERROR 000732: Input Features: Dataset 'Database Servers\DSD15_SQLEXPRESS.gds\TonyTwoWay (VERSION:dbo.DEFAULT)\TonyTwoWay.DBO.CCAP' does not exist or is not supportedFailed to execute (FeatureClassToGeodatabase).my current code
import arcpy
from arcpy import env
import os
from datetime import datetime as d
startTime = d.now()
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "C:\Temp\CCAP.gdb"
TonyTwoWay_DBO_CCAP = "C:\Temp\CCAP.gdb\TonyTwoWay.DBO.CCAP"
CCAP = r'Database Servers\DSD15_SQLEXPRESS.gds\TonyTwoWay (VERSION:dbo.DEFAULT)\TonyTwoWay.DBO.CCAP'
CCAP2 = "C:\Temp\CCAP.gdb"
if arcpy.Exists(CCAP2):
arcpy.Delete_management(CCAP2)
arcpy.CreateFileGDB_management("C:\Temp", "CCAP.gdb")
arcpy.FeatureClassToGeodatabase_conversion(CCAP, CCAP2)
try:
print '(Elapsed time: ' + str(d.now() - startTime)[:-3] + ')'
except Exception, e:
# If an error occurred, print line number and error message
import traceback, sys
tb = sys.exc_info()[2]
print "Line %i" % tb.tb_lineno
print e.message