Extract data from a geodatabase

GIS datasets often contain much more data than you need. Using the Extract Data From Geodatabase geoprocessing tool, you can extract a subset of data from one geodatabase to another geodatabase or to an .xml file.

This tool provides similar functionality to copying data from one geodatabase to another and also supports the following:

  • Extracting the schema and data or schema only
  • Using definition queries or selected features to specify a subset of data to extract
  • Copying a subset of data by specifying the features whose geometry will be used to define the area to extract.
  • Copying a subset of data by setting the Extent environment
  • Extracting data to a different spatial reference

Extract data to a different spatial reference

To extract data to a different spatial reference, complete the following steps:

  1. Use the Extract Data From Geodatabase geoprocessing tool to extract only the schema of the datasets to the new spatial reference specified in the Output Coordinate System setting under Environments.
  2. Once the schema is extracted to the geodatabase in the new spatial reference, run the Extract Data From Geodatabase tool again and use the Reuse Schema parameter's Reuse option to extract the data to the new spatial reference.

Dataset types to extract

The dataset types that you can extract using the Extract Data From Geodatabase tool include the following:

Note:
For information about feature class and table name lengths and other size limits, see a table summarizing feature class and table name rules and limitations in Define feature class properties.

The following geodatabase behaviors are supported and will persist on the data after the supported dataset types are extracted using the Extract Data From Geodatabase tool:

Determine data to extract

Prior to using the Extract Data From Geodatabase tool, you must determine the necessary data to extract from one geodatabase to another geodatabase or to an .xml file.

Note:

Metadata for the data you extract is copied when using the Extract Data From Geodatabase geoprocessing tool.

Extract all data

The Extract Data From Geodatabase tool allows you to extract all the data in the layers that you include in the Datasets to Extract parameter.

Note:

For nonspatial tables, only the table schema is extracted by default. To extract table rows, do one of the following:

Create a subset of data to extract

Sometimes, you may only want to extract a subset of the features in the dataset. There are multiple ways to specify the subsets of data to extract:

Use definition queries

Definition queries are written in SQL syntax and allow you to define a subset of features or rows to work with in a layer by filtering which ones are retrieved from the dataset. To extract a subset of features or rows, follow these steps to first create a definition query for a layer in ArcGIS Pro.

Definition queries are applied to the layers in the map and are not saved with the dataset in the geodatabase. If you are extracting a subset of data based on a definition query, apply the definition queries to your data first. Then use the Extract Data From Geodatabase tool along with one of the following options to add datasets containing a subset of data.

Datasets to Extract parameter on the Extract Data From Geodatabase geoprocessing tool
  • Drag the layer containing a definition query from the map Contents pane to the Datasets to Extract parameter.
  • Choose the layers from the drop-down menu in the Datasets to Extract parameter to add datasets containing a subset of data to be extracted.
Note:

Do not use the browse button for the Datasets to Extract parameter to add datasets with a definition query applied. If the browse button is used for this parameter to select datasets containing a subset of data instead of the drop-down menu, the definition queries applied to the datasets in the map will not be honored, and the default behavior will be applied.

Use a selection set

Selecting features allows you to highlight a subset of features on the map to use in subsequent exploration or analysis of the data. After you select features, you can extract the selection sets of individual feature classes and tables. Use the Datasets to Extract drop-down menu in the Extract Data From Geodatabase geoprocessing tool to ensure the selected datasets in the map are extracted.

Specify an extent

Use the Extent environment setting to define the spatial extent of the data to be extracted. This setting only processes and includes features that exist in the extent specified.

Note:

The extent you provide is assumed to be in the coordinate system of the input data, even if you set the Output Coordinate System environment setting to a different coordinate system. If the tool takes multiple input datasets, the first dataset added to the tool defines the coordinate system of the extent.

Use geometry features

When you run the Extract Data From Geodatabase geoprocessing tool, you can specify a layer that contains one or more features with the Extract Using Geometry Features parameter, and any data that intersects the geometry or aggregate geometries in the layer will be included in the extracted data.

Extract data from a geodatabase workflow

To use the Extract Data From Geodatabase tool to extract schema information and data from one geodatabase and transfer it to another geodatabase, complete the following steps:

  1. To extract data from a geodatabase, open the Extract Data From Geodatabase geoprocessing tool using the Analysis tab and click Tools in the Geoprocessing group. You can also search for or browse to the Extract Data From Geodatabase tool in the Data Management Tools toolset in the General toolbox.
    Extract Data From Geodatabase tool under Analysis tab, Tools, and Geoprocessing

    The Extract Data From Geodatabase geoprocessing tool dialog box appears with default settings.

    Extract Data From Geodatabase geoprocessing tool dialog

  2. For Datasets to Extract, use the browse button Browse to select one or more datasets containing the data that will be extracted.
    Note:

    • At least one layer must exist in the map for the Add Many button Add Many to appear.
    • Use Add Many Add Many next to Datasets to Extract to add multiple datasets simultaneously.
    • If you are extracting a subset of data based on a definition query, apply the definition queries to your data first. Then, use the drop-down menu to add datasets containing a subset of data to be extracted. If the browse button is used to select datasets containing a subset of data instead of the drop-down menu, the definition queries will not be honored, and the default behavior will be applied.
    • If one of the Datasets to Extract datasets was selected from the map and has selected records, the Extract Data From Geodatabase tool will process those selected records as a subset.

  3. Optionally, for Extract, select whether the schema and rows of the data or only the schema will be extracted.
    • Data—The schema and rows will be extracted. This is the default.
      Note:

      When the Extract parameter is set to Data, the Processing Extent options can be set under Environments and Output Coordinate System is ignored.

      When Data is set as the extent for the Extract Data From Geodatabase tool, the processing extents under Environments are enforced.
    • Schema only—Only the schema will be extracted.
      Note:

      When the Extract parameter is set to Schema only, Output Coordinate System can be set under Environments and the Processing Extent setting is ignored.

      When Schema only is set as the extent for the Extract Data From Geodatabase tool, the output coordinate system under Environments is enforced.
  4. Optionally, for Output Type, select the output type that the data will be extracted to.
    • Geodatabase—The data will be extracted to an existing geodatabase. This is the default.

      In the Extract Data From Geodatabase tool, Output Type is set to Geodatabase.

      If you choose Geodatabase (the default setting), click the browse button Browse next to Geodatabase to Extract Data to and browse to the geodatabase where the data will be extracted to. This geodatabase can be a file or enterprise geodatabase.

      Tip:

      If you choose a database connection to an enterprise geodatabase, ensure that the database connection contains credentials for a user with privileges to create data in the database.

    • XML file—The data will be extracted to an XML workspace document.

      In the Extract Data From Geodatabase tool, Output Type is set to XML.

      If you choose XML file, click the browse button Browse next to XML File to Extract Data to browse to the location and provide a name for the .xml file that the data will be extracted to.

      Tip:

      You can later use the Import XML Workspace Document   tool to input this output .xml file into another geodatabase.

    • New file geodatabase—Using the Geodatabase Location and Geodatabase Name parameters, specify the location and name of the new file geodatabase.

      In the Extract Data From Geodatabase tool, Output Type is set to New file geodatabase.

      If you choose New file geodatabase, Geodatabase Location, and Geodatabase Name become active. Click the browse button Browse next to Geodatabase Location and browse to the location where the new file geodatabase will be created. Under Geodatabase Name, provide the name of the new file geodatabase that will be created for the extracted data.

  5. Click Advanced Setting to expand additional options to override the Extract Data From Geodatabase tool default options. If you are not changing the default options, skip to step 12.

    Advanced Setting in the Extract Data From Geodatabase tool

  6. Optionally, for Expand Feature Classes and Tables, from the drop-down menu, choose from one of the four available options to specify whether the expanded feature classes and tables—such as those in networks, topologies, or relationship classes—will be added.
    • Use defaults—The expanded feature classes and tables related to the feature classes and tables in the input datasets will be added. The default for feature classes is to extract all features intersecting the spatial filter. If no spatial filter has been provided, all features will be included. The default for tables is to extract the schema only. This is the default.
    • Add with schema only—The schema for the expanded feature classes and tables will be added.
    • All rows—All rows for expanded feature classes and tables will be added.
    • Do not add—No expanded feature classes or tables will be added.
  7. Optionally, for Reuse Schema, choose from one of the two options from the drop-down menu to specify whether the geodatabase containing the schema of the data to be extracted will be reused.

    Reusing the schema reduces the amount of time required to extract the data.

    • Do not reuse—The schema will not be reused. This is the default.
    • Reuse—The schema will be reused.
    Note:

    • Reuse Schema is only available if Output Type is set to Geodatabase.
    • Use Reuse Schema only if the output geodatabase contains the schema of your datasets and no data.

  8. Optionally, for Extract Related Data, from the drop-down menu, choose the option that specifies whether rows related to existing rows in the data will be extracted, for example, a feature (f1) is inside the geometry filter, and a related feature (f2) from another class is outside the filter.

    If you choose to get related data, feature f2 is included in the extracted data.

    • Do not get related—Related data will not be extracted.
    • Get related—Related data will be extracted. This is the default.
  9. Optionally, for Extract Using Geometry Features, click the browse button Browse and browse to the features that will be used to define the area to extract.
  10. Optionally, for Geometry Filter Type, from the drop-down menu, choose the option that specifies the spatial relationship between the Extract Using Geometry Features and Input Datasets parameter values and how that relationship will be filtered.

    The spatial relationship is applied to data in an extent defined by the area of interest (AOI) specified in the Extract Using Geometry Features parameter.

    • Intersects—Features in the Input Datasets parameter value that intersect features in the Extract Using Geometry Features parameter value will be extracted.
    • Contains—Features in the Input Datasets parameter value contained by the selected feature in the Extract Using Geometry Features parameter value will be extracted.
  11. Optionally, use All records for tables to specify whether all records or only the schema will be extracted for tables without filters (such as selections or definition queries).

    Tables with applied filters will be honored.

    • Checked—All records will be extracted to the geodatabase. This option will override the Expand Feature Classes and Tables parameter value.

    • Unchecked—Only the schema will be extracted to the geodatabase for tables. This is the default.
  12. Click Run to append your data.

    Note:

    You can click the Run drop-down menu and select Schedule Run to run the tool later and, optionally, with recurrence.

    Schedule Run

    Learn more about scheduling geoprocessing tools

Learn more about the Extract Data From Geodatabase tool

Related topics