How can we help?

Search for answers or browse our knowledge base.

Table of Contents

How to archive the WordPress activity log events

Note: archiving of WordPress activity log events is available in the premium edition of the WP Activity 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 activity 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:
    • Database Name
    • Database User
    • Database Password
    • Database Hostname
    • 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 activity log in the archive database

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

The drop down menu in the logs viewer to select 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.