ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Create a file geodatabase

  • Run the Create File Geodatabase tool
  • Run a Python script

Creating a file geodatabase involves creating a special file folder on disk using ArcGIS. This can be done several ways:

  • From an ArcGIS Pro project
  • Use the Create File GDB tool
  • Run a Python script that calls the CreateFileGDB_management function

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. This allows you to share data with people who have older releases of ArcGIS, which may not be able to open newer releases of the geodatabase.

Note that file geodatabase schemas have not changed since ArcGIS 10.

  1. Open the Create File Geodatabase tool in ArcGIS for Desktop.

    You can use search to find the tool or open it directly from the Workspace toolset of the Data Management toolbox.

  2. Specify the folder location where you want the file geodatabase created.
  3. Type a name for the geodatabase.
  4. Choose which ArcGIS version you want the file geodatabase to be.

    The functionality available in the geodatabase will be limited to the release you choose.

  5. Click OK (ArcMap) or Run (ArcGIS Pro).

    A file geodatabase is created in the location you specified.

Run a Python script

If you want to create a file geodatabase from a machine where ArcGIS for Server or ArcGIS Engine with the Geodatabase Update extension is installed, you can run a Python script that calls the CreateFileGDB_management function. You would do this if you are creating 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 slightly and use to create all your file geodatabases from Python.

Because Python scripts are running in Wine on your Linux box, directory paths should use the Windows path separator (\). In the examples provided, Z: is the root directory.

The following steps provide some examples of how you would use Python to create a file geodatabase:

  1. Open a Python command prompt.
  2. Either run a stand-alone script or type commands directly into 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
    env.workspace = "Z:\home\user\mydata"
    
    # Set local variables
    out_folder_path = "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 is typed at the command prompt to create a file geodatabase (myfgdb.gdb) in the directory gdbs in the user's home directory on a Linux machine:

    import arcpy
    
    arcpy.CreateFileGDB_management("Z:\home\user\gdbs", "myfgdb.gdb")
    

    This example creates a version 10.0 file geodatabase (myoldfgdb.gdb) in the user's oldgdbs directory:

    import arcpy
    
    arcpy.CreateFileGDB_management("Z:\home\user\oldgdbs", "myoldfgdb.gdb", "10.0")
    

Related topics

  • File geodatabase size and name limits

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal