In ArcGIS Pro, the concept of branch history refers to the detailed record of changes made to datasets that are registered as branch versioned within a geodatabase. Each modification—whether it's inserting, updating, or deleting—is logged as a new entry in the business table. This meticulous tracking of changes ensures that a history of changes is preserved and allows you to effectively manage and review the evolution of your data over time. However, as data is edited, edits accumulate, and the archive can expand considerably, which may strain storage capacity.
Learn more about the branch history of datasets registered as branch versioned
Prune Branch History tool
To address this, the Prune Branch History geoprocessing tool is available and was designed to help manage and clean up branch versioning history. The process of pruning involves deleting retired archived records that are no longer referenced by any version or replica. The tool identifies which records can be safely pruned based on specific criteria, ensuring that only appropriate entries are deleted while preserving the necessary historical data.
Best practices for using the Prune Branch History tool
The Prune Branch History tool is a valuable resource for managing the size of branch-versioned datasets by removing unnecessary historical data. Following these best practices will help to optimize and ensure a smooth experience using this tool so that you can maintain an efficient and well-organized geodatabase.
Conduct regular maintenance—You should regularly reconcile and post changes to merge your edits into the default version-ideally daily or weekly. Unreconciled versions, unresolved conflicts, and undeleted versions after reconciling can prevent rows from being pruned.
Learn more about branch version scenarios and reconciling and posting edits to a branch version.
-
Establish pruning criteria—Clearly defining your criteria for pruning, such as specific dates or performance requirements, will help create more effective pruning workflows.
Identify data for pruning—Decide on a cutoff date for the data you want to prune, based on your workflow needs and the significance of the historical data.
Conduct a test run—Use the tool with the Report Only option enabled. This method will not prune any data; it simply provides a report in the Output Log File result on the number of archived records that could be pruned.
-
Log file review—After running the tool, review the Output Log File result created to see how many archive records are eligible for pruning. Monitor log files for any warnings or errors related to the pruning process and take appropriate action.
Backup your data—Always back up your entire database before using the Prune Branch History tool. This backup ensures that you can restore your data if necessary.
-
Timing of running the tool—To reduce system impact, it's best to run the tool during off-peak hours, on weekends, or at times when the feature service referencing the branch-versioned dataset can be stopped.
Avoid referenced moments—Ensure that any outstanding versions are reconciled.
Note:
You may encounter errors related to referenced moments when using the Prune Branch History tool.
-
Monitoring and review—Regularly evaluate branch versions to identify any historical data that may need to be pruned. Additionally, keep track of the size of your branch-versioned datasets and run the Prune Branch History tool as required to manage storage effectively.
Prerequisites for using the Prune Branch History tool
Before using the Prune Branch History geoprocessing tool, the following prerequisites must be met.
- The tool can only be run by the owner of the dataset specified in Input Dataset.
Tip:
Only the geodatabase administrator can see all private versions; therefore, dataset owners should consult with them to find out the oldest referenced moment for setting Prune Before Date.
- The Input Dataset selection must be registered as branch versioned.
Prior to specifying the Input Dataset selection, owners must verify that Versioning Type is set to Branch in Geodatabase Connection Properties dialog.
Learn more about how to configure a database connection for branch versioning
- The Input Dataset selection can be a single table, feature class, or feature dataset. If a feature dataset is selected, the tool will also process all feature classes within it and any related data outside of that dataset, excluding others in different feature datasets.
Tip:
If a feature class has been removed from a feature dataset, it is recommended to use the feature dataset itself for Input Dataset.
An exclusive schema lock is required on the Input Dataset data to ensure consistency in a multiuser environment. This lock prevents any schema changes while other users are accessing the dataset. Careful planning is essential; for instance, scheduling schema modifications when users are offline can help avoid impacting their work. If the dataset is published as a service, use ArcGIS Server Manager to stop the service prior to making any schema changes.
Learn more about how to view and manage locks on your datasets
Use the Prune Branch History tool
To use the Prune Branch History tool for deleting retired archived records from branch-versioned datasets, complete the following steps:
Tip:
The Prune Branch History tool prunes archived records only from the default version.
- To open the Prune Branch History geoprocessing tool, browse to the Analysis tab and click Tools in the Geoprocessing group. Alternatively, search for the tool in the Data Management Tools toolset in the Versions toolbox.
The Prune Branch History geoprocessing tool dialog box appears with default settings.
- For Input Dataset, from the drop-down menu, select a single dataset or use the browse button
to choose a feature dataset, feature class, or table containing branch versioned data that will be pruned.
- For Output Log File, use the browse button
to specify where the output log file will be saved.
- Optionally, check the Report Only parameter to generate only a report of the number of eligible archive records, or leave unchecked to proceed with pruning.
- If the Report Only parameter is checked, only the total count of eligible records will be reported to the Output Log File result; the records themselves won't be pruned. The Report Only option is checked by default.
- The eligible archive records will be pruned if the Report Only parameter is unchecked.
- If the Report Only parameter is checked, only the total count of eligible records will be reported to the Output Log File result; the records themselves won't be pruned. The Report Only option is checked by default.
- Optionally, to target only internal tables, check the Only Prune System Tables parameter.
When checked, only eligible internal system tables of the controller datasets will be listed or pruned.
- If the Only Prune System Tables parameter is checked, only the eligible internal system tables of the controller datasets will be pruned or reported to the log file.
- By default, this Only Prune System Tables parameter is unchecked, which means all eligible tables will be included.
Note:
With ArcGIS Pro 3.5, internal system tables refer specifically to the network topology tables of the utility network, which store all associations such as connectivity and containment. - Optionally, set a value for the Prune Before Date parameter to prune archived records dated before a specified date and time.
Tip:
Ensure the date is in UTC (Coordinated Universal Time) to maintain a consistent reference.
- If the Prune Before Date field is empty, the tool will prune as much of the eligible archive history as possible based on referenced moments.
- If the Prune Before Date field contains a specified date, only archived data up to that moment will be removed.
Note:
If the Prune Before Date value is invalid due to a version or feature service replica using a referenced moment before the requested prune date, the tool will provide a warning and indicate the earliest moment that can be used, along with details on the blocking version.Learn more about referenced moments, opening the versions view, managing branch versions, and managing feature service replicas.
- If the Prune Before Date field is empty, the tool will prune as much of the eligible archive history as possible based on referenced moments.
- Click Run to either report or prune the branch history on the specified branch versioned dataset.
Note:
You can also select Schedule Run to run the tool at a later time with optional recurrence by using the drop-down menu next to the Run button.
Once the Prune Branch History tool completes, open the properties dialog box of your table or feature class. Under the Source tab, the Archive History parameter shows the most recent date the tool was used to prune retired rows from this dataset.
Learn more about the Prune Branch History tool
Learn more about Branch history and key concepts when using the Prune Branch History tool.
Note:
Once records are pruned, they are permanently deleted. Historical queries at the specified moments can no longer be conducted since the data is no longer available.
Error handling during pruning
If the Prune Branch History tool encounters an error partway through the process (for example, due to memory issues or connection loss), resolve the error and rerun the tool.
A warning message will be displayed if the Prune Branch History tool encounters any referenced moments that block the operation. This message will include details about the referenced moments and the versions causing the block.
If the Prune Branch History tool returns an error indicating that the Prune Before Date value is invalid due to a referenced moment, review the common ancestor and previous common ancestor version properties in the versions view.
If the prune operation is blocked, you may need to adjust Prune Before Date to a later time that does not conflict with any referenced moment.
See Branch history to learn more about how the Prune Branch History tool works along with key concepts and considerations for pruning the branch history.