Create an archive rule in Core UI
Define the criteria for archiving records by creating an archive rule.
Before you begin
Because you can define multiple archive rules for a table, verify any existing archive rules to avoid potential conflicts. For example, if there's a rule for archiving records older than six months, creating another rule to archive records older than three months could cause a conflict. In such cases, either rule could potentially run, each archiving records under different conditions.
Role required: admin
Procedure
- Access the new archive rule form in one of the following ways.
| Option | Steps |
|---|---|
| Using the Data Management Console |
|
| Using a data management policy |
|
| Using the Archive Rules module |
|
- On the form, fill in the fields.
| Field | Description |
|---|---|
| Name | Name that identifies the rule. Used as the display value for references to this archive rule. |
| Table | The table with records that you want to archive. - You can't change the table in an existing archive rule. To archive records in a different table, create a new archive rule. - You can't select a table in a different application scope. - You can't create an archive rule for a table where update_synch is set to true in the dictionary entry for the table. - You can't create archive rules for some internal system tables or peripheral tables. For example: - Sys Audit [sys_audit] - Audit Deleted Record [sys_audit_delete] - Audit Relationship Change [sys_audit_relation] - Attachment [sys_attachment] - Journal Entry [sys_journal_field] |
| Retain references | Option to keep the sys_id for a reference field instead of storing the display name as a string in the archive table. Important: The Retain references check box becomes read only after you select it and save the archive rule. When you enable this option on a table with archived records, the system automatically reprocesses all existing archive records and enables references. This process can take time to complete for larger archive tables. You can track the status by viewing the Archive Rule Reference Migrations [sys_archive_ref_migration] table. For details on manually retaining references, see Migrating non-reference fields to reference fields. |
| Description | Description of the archive rule. |
| Conditions | Condition builder for specifying filter conditions that define the records to be archived. For example, you might archive inactive records older than a certain date. Make sure that the correct records are selected by testing the conditions in a list view before you activate the archive rule. For example,
|
| Auto Rearchive | Option that enables a restored record to be automatically rearchived after a set time period. |
| Auto Rearchive Duration | The time interval before the restored record is automatically archived. |
Estimate the number of records to archive by selecting the Recalculate Archive Estimate related link.
The estimate only includes primary records and excludes any related records added to the archive rule. The estimate helps you determine if the archive rule affects the number of records you expect it to. If the estimate is too high or low, change the archive rule conditions accordingly.
The updated count appears in the Record estimate field.
Select Submit.
Parent Topic:Archiving records in Core UI
Activate an archive rule
Preview the records that you want to archive, and then activate an archive rule.
Before you begin
Role required: admin
About this task
You must activate the archive rule and its corresponding data management policy for the archive rule to run.
The sample archive rules are inactive by default.
Procedure
- Access the archive rule that you want to activate in one of the following ways.
| Option | Steps |
|---|---|
| Using a data management policy |
|
| Using the Archive Rules module |
|
Estimate the number of archive records by selecting the Recalculate Archive Estimate related link.
The estimate only includes primary records and excludes any related records added to the archive rule. The estimate helps you determine if the archive rule affects the number of records that you expect. If the estimate is too high or low, change the archive rule conditions accordingly.
The updated count appears in the Record estimate field.
Activate the archive rule by selecting the Active check box.
Archive records immediately by selecting the Run Archive Now related link.
The Run Archive Now related link is only available if the corresponding data management policy is activated.
Result
Records that meet the archive rule criteria are archived during the next archive run.
What to do next
View the archived records by navigating to All > System Archiving > Archive Tables and selecting the module for the archived table, for example, Archive Incidents.
Create a destroy rule
Delete archived records and related records after a specified amount of time.
Before you begin
Role required: admin
About this task
You can associate a destroy rule with any archive rule in a data management policy.
If you need to amend the destroy rule properties running against your archived data, see System properties.
Procedure
On the archive rule form, select Create Destroy Rule.
In the Destroy Rule tab, fill out the fields.
| Field | Description |
|---|---|
| Active | Option to activate the destroy rule. |
| Destroy Related Records | Option to automatically destroy related records associated with the archived records.Note: Peripheral records, which include records in the Journal Entry [sys_journal_field], Attachment [sys_attachment], and Sys Audit [sys_audit] tables are deleted automatically, even if you decide to preserve related records. |
| Archive Duration | Specify the amount of time that records stay in the archive table before the system deletes them.Important: Archive records are destroyed immediately if the Archive Duration field is empty or set to 0. |
Estimate the number of archived records marked for deletion by selecting the Recalculate Destroy Estimate related link.
Select Submit.
Result
Records that have been archived longer than the archive duration value are destroyed when the scheduled job runs. You can verify the progress by checking the archive destroy log.