Consolidate Project (Data Management)

Summary

Consolidates an ArcGIS Pro project (.aprx file) and referenced maps and data into a folder.

Usage

  • The data and elements in the project will be consolidated and included in the .aprx file, including maps, the data referenced by the layers, toolboxes, styles, layouts, and connections when appropriate.

  • The Share outside of organization parameter controls whether the data referenced from networked resources will be consolidated into the folder.

    • Unchecked—Packages will be created for your internal environment, meaning the data will not be consolidated. Data stored on UNC paths, enterprise geodatabase layers, feature services, styles, and connections will remain referenced in the consolidated project.
    • Checked—All required data sources for the package will be copied to the consolidated folder. Items that would be unavailable outside your network—such as enterprise geodatabase connections, feature services, and data stored on shared folders—will be converted or copied to the output folder.

    Note:

    Data and maps will be consolidated if the project references them from a local path, such as c:\gisdata\landrecords.gdb\, regardless of the Share outside of organization parameter value.

  • Templates can be created using the Consolidate as template parameter. You can use a project template to define layers, maps, and data, as well as required connections when creating a project.

    Learn more about creating a project template

  • Use the Analyze Tools For Pro and Analyze Toolbox for Version tools to analyze toolboxes that are part of a project before consolidation. Errors that are identified can stop the consolidation process. You must either fix the errors or remove the tool from the project.

  • Connections—such as folder, server, database, workflow, and data reviewer—will only be included in an internal package. These items will be removed if the package is created to be shared outside your organization.

  • Items such as attachments, styles, and tasks will be referenced for internal packages if they were part of the project from a UNC path. These items will be copied and packaged in all other situations.

  • For feature layers, use the Extent parameter to select the features that will be consolidated. For raster layers, use the Extent parameter to clip the raster datasets.

Parameters

LabelExplanationData Type
Input Project

The project (.aprx file) that will be consolidated.

File
Output Folder

The output folder that will contain the consolidated project and data. If the specified folder does not exist, a folder will be created.

Folder
Share outside of organization
(Optional)

Specifies whether the project and all data will be consolidated into a single folder (for sharing outside your organization) or referenced to network data (for sharing within your organization).

Note:

Data and maps will be consolidated and packaged if the project references them from a local path, such as c:\gisdata\landrecords.gdb\, regardless of this parameter value.

  • Unchecked—Data stored on networked resources such as enterprise geodatabases, feature services, and file shares (UNC path) will be referenced as is. The data will not be converted or included in the package. This is the default.
  • Checked—Data stored on networked resources will be converted or copied into the package. The format of the data will be preserved when possible.
Boolean
Extent
(Optional)

Specifies the extent that will be used to select or clip features.

  • Current Display Extent Map View—The extent will be based on the active map or scene.
  • Draw Extent Square and Finish—The extent will be based on a rectangle drawn on the map or scene.
  • Extent of a Layer Layer—The extent will be based on an active map layer. Choose an available layer or use the Extent of data in all layers option. Each map layer has the following options:

    • All Features Select All—The extent of all features.
    • Selected Features Area from Selected Features—The extent of the selected features.
    • Visible Features Extent Indicator—The extent of visible features.

  • Browse Browse—The extent will be based on a dataset.
  • Intersection of Inputs Intersect—The extent will be the intersecting extent of all inputs.
  • Union of Inputs Union—The extent will be the combined extent of all inputs.
  • Clipboard Paste—The extent can be copied to and from the clipboard.
    • Copy Extent Copy—Copies the extent and coordinate system to the clipboard.
    • Paste Extent Paste—Pastes the extent and coordinate system from the clipboard. If the clipboard does not include a coordinate system, the extent will use the map’s coordinate system.
  • Reset Extent Reset—The extent will be reset to the default value.

When coordinates are manually provided, the coordinates must be numeric values and in the active map's coordinate system. The map may use different display units than the provided coordinates. Use a negative value sign for south and west coordinates.

Extent
Apply Extent only to enterprise geodatabase layers
(Optional)

Specifies whether the extent will be applied to all layers or to enterprise geodatabase layers only.

  • Unchecked—The extent will be applied to all layers. This is the default.
  • Checked—The extent will be applied to enterprise geodatabase layers only.

Boolean
Consolidate as template
(Optional)

Specifies whether the project will be consolidated as a template or a regular project. Templates can include maps, layouts, connections to databases and servers, and so on. A project template allows you to standardize a series of maps for use in a project and ensure that the correct layers are immediately available for use.

  • Unchecked—The project will be consolidated as a project into a folder. This is the default.
  • Checked—The project will be consolidated as a template into a folder.

Boolean
Preserve Mobile Geodatabase
(Optional)

Specifies whether mobile geodatabases will be preserved or converted to file geodatabases.

Note:

This parameter applies only to mobile geodatabases (.geodatabase) used primarily for offline workflows in ArcGIS Runtime apps. SQLite databases with .sqlite or .gpkg file extensions will be converted to file geodatabases.

  • Unchecked—Mobile geodatabases will be converted to file geodatabases. This is the default.
  • Checked—Mobile geodatabases will be preserved.

Boolean
Version
(Optional)

Specifies the ArcGIS Pro version to which objects such as projects, maps, and layers will be persisted. Saving to an earlier version is useful if the project will be used with earlier versions of ArcGIS Pro.

Note:

A project saved to an earlier version may lose functionality or properties that are only available in later versions.

  • Current version The contents of the consolidated folder will match the current version of the ArcGIS Pro release.
  • ArcGIS Pro 2.2 The contents of the consolidated folder will be ArcGIS Pro version 2.2.
  • ArcGIS Pro 2.3The contents of the consolidated folder will be ArcGIS Pro version 2.3.
  • ArcGIS Pro 2.4The contents of the consolidated folder will be ArcGIS Pro version 2.4.
  • ArcGIS Pro 2.5The contents of the consolidated folder will be ArcGIS Pro version 2.5.
  • ArcGIS Pro 2.6The contents of the consolidated folder will be ArcGIS Pro version 2.6.
  • ArcGIS Pro 2.7The contents of the consolidated folder will be ArcGIS Pro version 2.7.
  • ArcGIS Pro 2.8The contents of the consolidated folder will be ArcGIS Pro version 2.8.
  • ArcGIS Pro 2.9The contents of the consolidated folder will be ArcGIS Pro version 2.9.
  • ArcGIS Pro 3.0The contents of the consolidated folder will be ArcGIS Pro version 3.0.
  • ArcGIS Pro 3.1The contents of the consolidated folder will be ArcGIS Pro version 3.1.
  • ArcGIS Pro 3.2The contents of the consolidated folder will be ArcGIS Pro version 3.2.
  • ArcGIS Pro 3.3The contents of the consolidated folder will be ArcGIS Pro version 3.3.
  • ArcGIS Pro 3.4The contents of the consolidated folder will be ArcGIS Pro version 3.4.
String
Keep only the rows which are related to features within the extent
(Optional)

Specifies whether the specified extent will be applied to related data sources.

  • Unchecked—Related data sources will be consolidated in their entirety. This is the default.
  • Checked—Only related data corresponding to records within the specified extent will be consolidated.
Boolean

arcpy.management.ConsolidateProject(in_project, output_folder, {sharing_internal}, {extent}, {apply_extent_to_enterprise_geo}, {package_as_template}, {preserve_sqlite}, {version}, {select_related_rows})
NameExplanationData Type
in_project

The project (.aprx file) that will be consolidated.

File
output_folder

The output folder that will contain the consolidated project and data. If the specified folder does not exist, a folder will be created.

Folder
sharing_internal
(Optional)

Specifies whether the project and all data will be consolidated into a single folder (for sharing outside your organization) or referenced to network data (for sharing within your organization).

  • INTERNALData stored on networked resources such as enterprise geodatabases, feature services, and file shares (UNC path) will be referenced as is. The data will not be converted or included in the package. This is the default.
  • EXTERNALData stored on networked resources will be converted or copied into the package. The format of the data will be preserved when possible.
Boolean
extent
(Optional)

Specifies the extent that will be used to select or clip features.

  • MAXOF—The maximum extent of all inputs will be used.
  • MINOF—The minimum area common to all inputs will be used.
  • DISPLAY—The extent is equal to the visible display.
  • Layer name—The extent of the specified layer will be used.
  • Extent object—The extent of the specified object will be used.
  • Space delimited string of coordinates—The extent of the specified string will be used. Coordinates are expressed in the order of x-min, y-min, x-max, y-max.
Extent
apply_extent_to_enterprise_geo
(Optional)

Specifies whether the extent will be applied to all layers or to enterprise geodatabase layers only.

  • ALL The extent will be applied to all layers. This is the default.
  • ENTERPRISE_ONLYThe extent will be applied to enterprise geodatabase layers only.
Boolean
package_as_template
(Optional)

Specifies whether the project will be consolidated as a template or a regular project. Templates can include maps, layouts, connections to databases and servers, and so on. A project template allows you to standardize a series of maps for use in a project and ensure that the correct layers are immediately available for use.

Learn more about creating a project template

  • PROJECT_PACKAGEThe project will be consolidated as a project into a folder. This is the default.
  • PROJECT_TEMPLATEThe project will be consolidated as a template into a folder
Boolean
preserve_sqlite
(Optional)

Specifies whether mobile geodatabases will be preserved or converted to file geodatabases.

Note:

This parameter applies only to mobile geodatabases (.geodatabase) used primarily for offline workflows in ArcGIS Runtime apps. SQLite databases with .sqlite or .gpkg file extensions will be converted to file geodatabases.

  • CONVERT_SQLITEMobile geodatabases will be converted to file geodatabases. This is the default.
  • PRESERVE_SQLITEMobile geodatabases will be preserved.
Boolean
version
(Optional)

Specifies the ArcGIS Pro version to which objects such as projects, maps, and layers will be persisted. Saving to an earlier version is useful if the project will be used with earlier versions of ArcGIS Pro.

Note:

A project saved to an earlier version may lose functionality or properties that are only available in later versions.

  • CURRENT The contents of the consolidated folder will match the current version of the ArcGIS Pro release.
  • 2.2 The contents of the consolidated folder will be ArcGIS Pro version 2.2.
  • 2.3The contents of the consolidated folder will be ArcGIS Pro version 2.3.
  • 2.4The contents of the consolidated folder will be ArcGIS Pro version 2.4.
  • 2.5The contents of the consolidated folder will be ArcGIS Pro version 2.5.
  • 2.6The contents of the consolidated folder will be ArcGIS Pro version 2.6.
  • 2.7The contents of the consolidated folder will be ArcGIS Pro version 2.7.
  • 2.8The contents of the consolidated folder will be ArcGIS Pro version 2.8.
  • 2.9The contents of the consolidated folder will be ArcGIS Pro version 2.9.
  • 3.0The contents of the consolidated folder will be ArcGIS Pro version 3.0.
  • 3.1The contents of the consolidated folder will be ArcGIS Pro version 3.1.
  • 3.2The contents of the consolidated folder will be ArcGIS Pro version 3.2.
  • 3.3The contents of the consolidated folder will be ArcGIS Pro version 3.3.
  • 3.4The contents of the consolidated folder will be ArcGIS Pro version 3.4.
String
select_related_rows
(Optional)

Specifies whether the specified extent will be applied to related data sources.

  • KEEP_ONLY_RELATED_ROWSOnly related data corresponding to records within the specified extent will be consolidated.
  • KEEP_ALL_RELATED_ROWSRelated data sources will be consolidated in their entirety. This is the default.
Boolean

Code sample

ConsolidateProject example 1 (Python window)

The following Python script demonstrates how to use the ConsolidateProject function from the Python window.

import arcpy
arcpy.management.ConsolidateProject(r'c:\projects\SE_Pipelines\PipeDevelopment.aprx',
                                    r'E:\gisShare\projects\Pipelines\SE_Pipeline',
                                    'INTERNAL')
ConsolidateProject example 2 (stand-alone script)

The following script takes an input directory in which project files (.aprx) reside on a UNC share and consolidates the project onto a local drive. The data will still be accessible to the now local project, as the INTERNAL keyword is used.

import os
import arcpy

enterpriseProjectDir = r"\\centralFileServer\gisData\ArcGISProProjects"
localProjectDir = "c:\\GISdata\\localProjects"

walk = arcpy.da.Walk(enterpriseProjectDir, datatype="Project")

for dirpath, dirnames, filenames in walk:
    for fname in filenames:
        project = os.path.join(dirpath, fame)
        outputFolder = os.path.join(localProjectDir, 
                                    os.path.splitext(os.path.basename(project))[0])
        print("Consolidating: {0} to {1}".format(project, outputFolder))
        arcpy.management.ConsolidateProject(project, outputFolder, "INTERNAL")

Environments

Special cases

Parallel Processing Factor

If the environment is not specified, the tool will use one half of the available cores.

Related topics