Let the platform do the work

Data Archiver


The Data Archiver in Sugar lets an administrator archive or delete Sugar records from their database either on demand by manually triggering a job or at regular intervals via the Run Active Data Archives/Deletions scheduler. While archiving records simply moves the data to a hidden table, deleting records via Data Archiver frees up space in your database by allowing administrators to selectively and permanently prune records.

In addition to the Data Archiver module, the Archive Runs module is displayed as a subpanel under the record view of any data archiver record. The Archive Runs subpanel displays a history of runs that have occurred for the parent data archiver record, giving the administrator a clear history of what has occurred in the system and access to the affected record IDs.

Data Archiver Fields

The Data Archiver module contains the following fields. For information on using and editing various field types, refer to the User Interface documentation. 

Field Description
Active The enabled or disabled state of the job for scheduled runs; only active records will be processed by the Run Active Data Archives/Deletions scheduler. An administrator will still be able to click on "Perform Now" to run the job manually even if the Active field is set to false.
Filter The filter(s) that should be applied to the module records in order to identify the subset of records to archive or delete.
Module The module that contains records you want to archive or delete; all modules are available in the Data Archiver module list.
Name A unique and descriptive name for the job.
Process Type Select whether you want to archive or hard delete the records identified by this job.

Note: Fields, layouts, and columns for the Data Archiver module and related Archive Runs module are not available for customization in Studio.

Archive vs Hard Delete

Jobs created in the Data Archiver module can have one of two process types: Archive or Hard Delete. Please note that it is recommended to run the Archive or Hard Delete jobs during low usage or off-hours as it can affect system performance.

An archive process type will remove specified records from the active table of the chosen module and transfer them to a newly created archive table. The archive table is a clone of the active table. Because archiving simply moves records from one part of your database to another, it does not free up any room in your database, but it does remove old or non-essential data from the view of users. Once archived, the data can no longer be accessed via the Sugar user interface. SugarCloud customers can access their archived data by making and downloading a database backup to access their archive tables.

A hard-delete process type will permanently remove specified records from the active table of the chosen module, freeing space on your database. When hard deleting records such as notes, documents, and emails, the record's file attachments will also be removed. Hard deleting records gives administrators the ability to selectively prune their databases and not just mark entries as deleted as the standard "soft delete" does when users delete records via the application's interface. As an added benefit, you can filter jobs in the Data Archiver on the "Deleted" database field, which is hidden from standard filters in Sugar, letting you manually prune user-deleted records as needed if you prefer not to enable the automated Prune Database on 1st of Month scheduler. Hard deleting is not reversible, so this information can never be retrieved again. For that reason, we recommend performing regular backups and storing them locally before performing hard-delete actions. 

Creating and Running a Data Archiver Job

Data Archiver jobs will run automatically on regularly set intervals when the Run Active Data Archives/Deletions scheduler is active. Whether the scheduler is active or not, an administrator may also run Data Archiver jobs manually as needed by clicking the "Perform Now" button on a data archiver record.

Use the following steps to clean up your database by creating an archive or hard-delete job in the Data Archiver module:

  1. Navigate to Admin > Archive Records.
  2. Click "Create" to define a new set of records to archive or delete.
  3. Complete the form fields, using the field descriptions above as guidance. Use the Add button at the end of the filter row to create additional filter criteria if needed.
  4. Click "Save".

After saving an active Data Archiver record, the archive or deletion will automatically process the next time the Run Active Data Archives/Deletions scheduler runs. Alternatively, you may click on "Perform Now" in the data archiver job's record view to run the job immediately without activating or waiting for the scheduler.

Note: It is recommended to run the data archiver job during low usage or off-hours as it can affect system performance.

Each time a Data Archiver record runs, a new entry will appear in its Archive Runs subpanel, which includes the following information:

  • Date of Process: The date and time that the Data Archiver job ran.
  • Process Type: Whether the job archived or hard-deleted records.
  • Module: The module which contained the processed records.
  • Filter Definition: The filters that were applied to identify the processed records.
  • Number Processed: The number of records that were identified and processed by the job.
  • Source: The ID of the user who initiated the run.

Retrieving Archived Records and Deleted Record IDs

When you hard-delete data via the Data Archiver, Sugar will preserve the IDs (and only the IDs) of the records that are deleted in a database table called archive_runs. All other data related to the hard-deleted records will be gone and not recoverable from any means other than a local backup. Therefore, we recommend backing up your database before performing hard-delete actions. Customers with access to their database can retrieve the list of IDs that were hard deleted in the row of the archive_runs table that is associated with the job that ran from the parent data_archivers record. SugarCloud customers can make and download a database backup to access the archive_runs table or create a report in the Advanced Reports module if they are using Sugar Sell, Serve, or Enterprise. Once you have the deleted IDs, you may be able to restore hard-deleted records by comparing the IDs with your backup.

Records that are archived via the Data Archiver are stored in the database in a table cloned from the originating module table. The clone will have _archive appended to the end of its table name (e.g., accounts_archive). Customers with access to their database can find their archived data in these archive tables. SugarCloud customers can make and download a database backup to access their archive tables or create an Advanced Report if they are using Sugar Sell, Serve, or Enterprise.