Summary
Recovers data from a file geodatabase that has become corrupt.
Usage
The Recover File Geodatabase tool can only recover simple feature classes and tables. Complex data and relationships will not be recovered.
Syntax
arcpy.management.RecoverFileGDB(input_file_gdb, output_location, out_name)
Parameter | Explanation | Data Type |
input_file_gdb | Input corrupt file geodatabase. | Workspace |
output_location | Output folder location for the recovered file geodatabase. | Folder |
out_name | Name for the output file geodatabase. | String |
Derived Output
Name | Explanation | Data Type |
out_file_gdb | The updated geodatabase. | Workspace |
Code sample
The following Python window script demonstrates how to use the RecoverFileGDB tool in immediate mode.
arcpy.RecoverFileGDB_management('C:/fgdb/Whistler.gdb', 'C:/recoveredData', 'recoveredWhistler.gdb')
The following Python window script demonstrates how to use the RecoverFileGDB in a stand-alone script. This script will clean up nonuseful tables.
# Name: RecoverFileGeodatabase.py
# Description: Use the RecoverFileGeodatabase tool to recover the data
# contained in a damaged file geodatabase.
# Import system modules
import arcpy
# Set local variables
geodatabase = "C:/fgdb/Whistler.gdb"
output_location = "C:/recoveredData"
recovered_name = "recoveredWhistler.gdb"
# Process: Recover the data
arcpy.RecoverFileGDB_management(geodatabase, output_location, recovered_name)
Environments
This tool does not use any geoprocessing environments.
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes