Purging can be done using the below steps first configure what work types you want to purge and next schedule it.
Phase 1: Configure the activity — Define the dataset that will be purged/archived. The dataset comprises a work pool in your application, and a set of work types (classes), folders, and covers within the work pool. The dataset is also qualified by the age of resolved work items to be purged/archived. Each configuration is an instance in class Data-Admin-ArchiveSettings.
Phase 2: Schedule the activity — For each cycle you specify:
Start date and the frequency of each purge/archive cycle.
Number of items you want to purge and/or archive. If this value is less than the number of items in the age group defined in Step 1, the oldest items are purged. The others remain in the source tables until the next cycle.
A time limit for processing items within each purge/archive cycle. If the time limit is exceeded, the process stops and restarts after a defined number of hours has elapsed. These settings help spread out processing demands during a single cycle.
At the defined cycle start time, the purge/archive agent first populates an archive .zip file with the work items and their data as defined in Step 1. The agent then deletes the table data. Although the work items are purge/archived, the work item ID is left unchanged, to allow restoration or archived wok items without affecting current work items.
About the Zip File:
The .zip files created by the wizard uses the following naming convention:
<workpool name_dataset name_ file creation date_run n >
Note: A run value of 0 (zero) designates the first run.
The .zip files are stored in the Pega Platform system temporary directory configured for your installation.
Before you use the Purge/Archive Wizard, do the following:
Establish a destination archive system that is a copy (same rules and data schemas) of the source production system that you are archiving. Maintaining a copy system enables you to upload, import, archive, and access .zip file data without the need for subsequent clean-up and reconfiguration.
Identify the work pools and the work types you are purging/archiving.
Identify whether there are folder items and/or covers that you want to purge/archive. Note that if any data items within a folder or cover are unresolved, then none of the items are purged or archived during the cycle.
Estimate the average size of the work items and their related data. The wizard removes items by count, not by size. Knowing the size of your objects helps you estimate the archive .zip file sizes and the table sizes required for your target database. History, attachments, and links for each work item in your application are included in your .zip files.
Indexes created for work items are deleted but not archived. The indexes are recreated when the work items are recovered from the archive. For example, work party indexes (table pc_index_workparty ) are purged but not archived. When the work item is recovered, the work party index is recreated.
Using the Wizards:
Two wizards comprise the Purge/Archive wizard:
Configuration - select this tab when you are:
Creating and configuring a purge/archive agent dataset and defining the age of work items you want to purge/archive.
Modifying the configuration of a purge/archive agent dataset (change work types and work item age)
Schedule process - select this tab when you are:
Creating a purge/archive process schedule for an agent activity configuration (created in the Configuration wizard)
Reviewing the history of purge/archive activity and modifications to the agent work item
Modifying the schedule information for a purge/archive configuration
Removing the schedule for a purge/archive configuration
Restoring the archived work items:
To retrieve archived work items in your archive system, select Designer Studio > Application > Distribution > Import and select or upload the zip file containing the archived work objects. See About the .zip file for more details.