Label | Explanation | Data Type |
Input Project
| The project (.aprx file) to 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 (for sharing inside your organization). Data paths referenced from enterprise geodatabases or a UNC file system can be shared internally. If the project was not built with data paths like this, the data will be consolidated into the project package. 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's setting.
| Boolean |
Extent
(Optional) | Specifies the extent that will be used to select or clip features.
| Extent |
Apply Extent only to enterprise geodatabase layers
(Optional) | Specifies whether the Extent parameter will be applied to all layers or 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.
| 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.
| Boolean |
Version
(Optional) | Specifies the ArcGIS Pro version that the consolidated project will be saved as. Saving to an earlier version will ensure tool backward compatibility. If you attempt to consolidate a toolbox to an earlier version and capabilities that are only available in the newer version are included, an error will occur. You must remove tools that are incompatible with the earlier version, or specify a compatible version.
| 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.
| Boolean |
Summary
Consolidates a project (an .aprx file) and referenced maps and data into a specified output folder.
Usage
All elements of a 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 will be consolidated into the folder.
- Unchecked—Packages will be created for your internal environment, meaning the data will not be consolidated. UNC paths and enterprise geodatabase layers, 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 not be available outside your network, such as enterprise geodatabase connections and paths to UNC folders, will not be included. However, if data from these sources is included in a map or layout in the project, it will be 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 setting.
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.
Use the Analyze Tools For Pro tool to analyze toolboxes that are part of a project before the consolidation routines are performed. Errors that are identified will stop the consolidation process. You must either fix these errors or remove the tool from the project. Input data that the tools require will be consolidated regardless of whether the data is part of a map in the project.
Connections such as folder, server, database, workflow, and data reviewer will only be included in an internal package. These items are 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
arcpy.management.ConsolidateProject(in_project, output_folder, {sharing_internal}, {extent}, {apply_extent_to_enterprise_geo}, {package_as_template}, {preserve_sqlite}, {version}, {select_related_rows})
Name | Explanation | Data Type |
in_project | The project (.aprx file) to 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 the output folder so it can be shared externally.
| Boolean |
extent (Optional) | Specifies the extent that will be used to select or clip features.
| Extent |
apply_extent_to_enterprise_geo (Optional) | Specifies whether the extent parameter will be applied to all layers or 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 project templates
| 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.
| Boolean |
version (Optional) | Specifies the ArcGIS Pro version that the consolidated project will be saved as. Saving to an earlier version will ensure tool backward compatibility. If you attempt to consolidate a toolbox to an earlier version and capabilities that are only available in the newer version are included, an error will occur. You must remove tools that are incompatible with the earlier version, or specify a compatible version.
| String |
select_related_rows (Optional) | Specifies whether the specified extent will be applied to related data sources.
| Boolean |
Code sample
The following Python script demonstrates how to use the ConsolidateProject function from the Python window.
import arcpy
arcpy.management.ConsolidateProject('c:\\projects\\SE_Pipelines\\PipeDevelopment.aprx',
'E:\\gisShare\\projects\\Pipelines\\SE_Pipeline',
'INTERNAL')
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 = "\\\\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.
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes