How To Mirror The WordPress Activity Logs To An External Database

Search Knowledge Base by Keyword

You are here:

Apart from storing the WordPress activity log in an external database, you can also mirror the activity log to an external database, so you have two copies of it. This document explains how to mirror the activity log of your WordPress site to an external database, using the WP Activity Log plugin.

The process consists of two steps:

  1. Setting up a external database connection in the plugin
  2. Configuring the mirroring of the activity logs to the external database.

Setting Up an External Database Connection for the Activity Log

To setup an external database connection in the plugin:

  1. Click on DB/Archive/Mirror node in the plugin menu.
  2. Click the Create a Connection button to launch the connection setup wizard.

Configuring an external database connection

  1. Select MySQL Database from the Type of Connection drop down menu in the first step of the wizard.
  2. 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 last step of the wizard, specify a name for the connection. Connection names are just reference for you and can be up to 25 characters long and can only consist of letters, numbers and underscores.

Configuring the Mirroring of the Activity Log to the External Database

Once the external database connection is setup you have to configure it as a mirroring connection as per the below procedure:

  1. Click on DB/Archive/Mirror in the plugin menu.
  2. Navigate to the Mirroring tab and click the Setup an Activity Log Mirror button.

Choosing a connection to setup mirroring

  1. In the first step of the wizard specify a name for the mirror. Names are just for your reference and can be 25 characters long, and only consist of letters, numbers and underscores.
  2. Select the MySQL database connection you’ve just setup from the Connection drop down menu.
  3. In the second step of the wizard specify how often the activity log mirroring process should run.
  4. In the last step of the wizard you can configure activity log filtering rules for the mirroring connection. By default the connection is set to  Send all events option, though if you’d like to setup any filtering rules refer to configuring filtering rules for activity log mirroring connections.
  5. Click Save mirror to save the new mirroring process.

Other Integrations

Refer to the getting started guide for external databases & third party services for more information on other integrations and activity log management.