How to Archive Alerts from the WordPress Audit Trail

You are here:
Back

Note: archiving of WordPress activity log events is available in the premium edition of the WP Security Audit Log plugin.

By archiving events from the activity logs of WordPress sites the main database remains manageable and fast. Once the events are archived in the archiving database they can still be viewed, searched through and included in the reports. This article explains how to configure the archiving of WordPress activity log events.

How to Archive Old Events from the WordPress Audit Log

The process of archiving old events consists of two steps:

  1. Create the external database connection
  2. Configure the activity log archiving using the external database connection.

1. Create the External Database Connection

  1. Click on DB/Archive/Mirror node in the plugin menu.
  2. Click the Create a Connection button to launch the connection setup wizard.
  3. Select MySQL Database from the Type of Connection drop down menu in the first step of the wizard.
  4. In the second step of the wizard specify all of the following in the respective placeholder:
    1. Database Name
    2. Database User
    3. Database Password
    4. Database Hostname
    5. Database Base Prefix (if you want to use the website’s URL as a table prefix, enable the setting Use Website URL as table prefix).

Note: If your MySQL server is configured to accept SSL encrypted communication, enable the SSL setting and specify the paths to the CA SSL certificate and Server SSL Certificate. If your server requires a client certificate you can also configure that.

  1. In the third and last step of the wizard, specify a friendly name for the connection in the Connection Name placeholders. Connection names are just reference for you and can be up to 12 characters long and can only consist of letters and numbers.

Refer to configuring and managing external databases connections for the activity log for more information on managing such connections.

2. Configure the Activity Log Archiving

  1. Click on DB/Archive/Mirror node in the plugin menu.
  2. Click on the Archiving tab.

Configuring the archiving database for the activity log

  1. Select the newly configured external database connection you want to use for the archiving from the Connection drop down menu.
  2. Configure how old events should be for them to be archived from the Archiving Options settings. You can specify a number of months or years.
  3. Configure the activity log data retention period in the Activity Log Retention setting. You can specify a number of months or years.

Note: The retention period should be longer than the archiving period. For example if the archiving period is set to one year, then the retention period should be set to something that is more than one year, otherwise the events will not be archived but will be purged instead. Also, once you configure archiving the retention settings of the activity log are moved from the Activity Log settings to the Archiving settings.

  1. Specify how often should the plugin run the archiving process by selecting a time from the Run archiving process every drop down menu.

Viewing the Audit Trail in the Archiving Database

Once you enable archiving and events from the WordPress security audit trail are archived, a drop down menu will be available in the Audit Log Viewer that allows you to select which database to view, as shown in the below screenshot.

Drop down menu in Audit Log Viewer to view the archiving database

Note that all the premium features, such as WordPress report and activity log search fully support the archiving database. Therefore when creating a report, or searching for specific activity, if there are events in the archiving database that match the criteria you will be alerted about it and can select to view such alerts as well, or include them in the reports.

Refer to the External database & third party services integration tools getting started guide for more information on the add-on and its other features.