Trim archive history

If you've been using geodatabase archiving for a while or take data offline and you frequently edit your archive-enabled tables and feature classes, your archive tables will grow over time as edits are maintained.

Large archive tables can impact decisions about storage and backup management and may affect performance if the data outgrows the system. Some organizations may use nonversioned archiving because it is required for certain functionality, though they have no need for historical records. Other organizations may only be interested in recent history and may want to trim records older than a specific age or trim the archived history of data changes that are no longer relevant.

Trim Archive History tool

To decrease the size of these tables, you can use the Trim Archive History geoprocessing tool to delete retired rows from nonversioned archived datasets without disabling archiving or disrupting sync workflows in your enterprise geodatabase.

Trim Archive History geoprocessing tool

Work with related data

The Trim Archive History geoprocessing tool only allows a single dataset to be specified for the input. If the input dataset participates in a relationship with any other dataset, the input dataset and all related tables are trimmed using the same setting (for example, all retired rows or retired rows by input date).

Work with replicated data

The Trim Archive History geoprocessing tool honors replica sync moments. If the input table or any related tables are referenced by a replica, the input trim date must be older than the last sync date of any referenced replica. If the input trim date is more recent than the last sync date, the Trim Archive History geoprocessing tool will fail, citing the replica name and the last sync date in coordinated universal time (UTC). Leaving the input trim date empty is the same as inputting the current date and time.

If any replica is preventing the trim archive operation from happening, you must either input an earlier date or unregister the replica using the Unregister Replica geoprocessing tool. Replica information can be obtained from either the Manage Replicas pane in ArcGIS Pro or for feature service-based replicas, from the feature service you can get the list of replicas using the Replicas (Feature Service). Only unregister replicas that will no longer be used. Once a replica has been unregistered, it cannot be used again to synchronize edits.

Trim the archive history

Complete the following steps to delete retired rows from a dataset using the Trim Archive History geoprocessing tool:

  1. In ArcGIS Pro, in the Geoprocessing pane, search for the Trim Archive History geoprocessing tool.

    The Trim Archive History dialog box appears.

    Trim Archive History geoprocessing tool

  2. For Input Table, use the browse button to add a nonversioned archived dataset from which you want to trim archived rows. You can use the drop-down menu to add nonversioned archive-enabled datasets that are in the map.
    Caution:

    • The input table must be archive enabled.
    • The input table must be nonversioned. Versioned tables are not supported.

  3. For Trim Mode, choose Delete to trim the archive history.
    Note:

    At the current version of ArcGIS Pro, only Delete is available for the Trim Mode.

  4. Optionally, provide a value for Trim Before Date. The following options are available:
    Trim Archive History tool with the Trim Before Date options
    • If the Trim Before Date parameter is left empty, the tool will attempt to delete all retired rows, and if any of the rows are referenced by a replica that has not already synced those rows, the operation will fail.
    • If the Trim Before Date parameter is populated with some value, the tool will attempt to delete retired rows that are older than the input date. If the retired rows are referenced by a replica that has not already synced those rows, you must input an earlier trim before date or unregister the replica.
    Caution:

    Archiving nonversioned data uses UTC to represent time; therefore, the Trim Before Date value must also be in a UTC time stamp format.

    For example, if a feature is created at 3:30 p.m. EDT on 4/24/2020, the GDB_FROM_DATE field records 2020-04-24 19:30:00, which is the date and time of the edit represented in UTC, not the date and time of the machine.

Review the trimmed archive history

If the input dataset or related datasets have no rows to trim, the Trim Archive History tool will successfully complete and return a warning for any tables that had no rows trimmed. Once the trim completes, you can access the last trimmed date of a dataset on the Source tab on the feature class or table properties dialog box. In addition, on the Source tab, you can also see the Archiving property with the data and time (UTC) archiving enabled and the Archive Name property populated.

The feature class properties display when the Trim Archive History geoprocessing tool was last run.