Creating a file geodatabase involves creating a special file folder on disk using ArcGIS. Create a file geodatabase using one of the following methods:
- Use the New File Geodatabase option in the Catalog pane in ArcGIS AllSource.
- Use the Create File Geodatabase geoprocessing tool.
- Run a Python script that calls the CreateFileGDB_management ArcPy function.
Use the Catalog pane in ArcGIS AllSource
Follow these steps to create a file geodatabase from the Catalog pane in ArcGIS AllSource:
- Start ArcGIS AllSource and open the Catalog pane, if necessary.
- Right-click Databases or a folder under Folders in the Catalog pane and click New File Geodatabase.
- On the New File Geodatabase dialog box, browse to the location where you want to create a file geodatabase, type a name, and click Save.
A file geodatabase is created in the location you selected and is automatically added to the project under Databases in the Catalog pane.
Run the Create File Geodatabase tool
The Create File Geodatabase geoprocessing tool allows you to create a file geodatabase that corresponds to an older release of ArcGIS. In this way, you can share data with users who cannot open newer releases of the geodatabase.
Note that file geodatabase schemas have not changed since ArcGIS 10.
- Open the Create File Geodatabase tool in ArcGIS AllSource.
You can use search to find the tool or open it directly from the Workspace toolset of the Data Management toolbox.
- Specify the folder location where you want the file geodatabase to be created.
- Type a name for the geodatabase.
- Choose the ArcGIS version you want the file geodatabase to be.
The functionality available in the geodatabase will be limited to the release you choose.
- Click Run.
A file geodatabase is created in the location you specified.
Run a Python script
To create a file geodatabase from a machine where ArcGIS Server or ArcGIS AllSource is installed, you can run a Python script that calls the CreateFileGDB_management ArcPy function. This is useful if you need to create a file geodatabase from your ArcGIS client on a Linux machine or if you want to have a reusable, stand-alone script that you can alter and use to create all your file geodatabases from Python.
The following steps provide examples of how to use Python to create a file geodatabase:
- Open a Python command prompt.
- Either run a stand-alone script or type commands in the interactive interpreter.
In the first example, the createfgdb.py script contains the following information:
# Import system modules import os import sys import arcpy # Set workspace arcpy.env.workspace = r"Z:\home\user\mydata" # Set local variables out_folder_path = r"Z:\home\user\mydata" out_name = "myfgdb.gdb" # Execute CreateFileGDB arcpy.CreateFileGDB_management(out_folder_path, out_name)
After you alter the script to run at your site, you can call it from a command prompt or Python window.
In this example, the Python commands are typed at the command prompt to create a file geodatabase (myfgdb.gdb) in the gdbs directory in the user's home directory on a Linux machine:
import arcpy arcpy.CreateFileGDB_management(r"Z:\home\user\gdbs", "myfgdb.gdb")