Data Pruning Not Deleting Older Data as Expected

Hello,

I recently enabled data pruning in Ignition to manage database size. I've set a pruning age, expecting data older than this age to be deleted automatically. However, I've noticed that the older data is still present in the database.

Here are some details about my setup:

  • Version Ignition: 7.9
  • Database type: MySQL
  • Specific tables or data types I expected to be pruned: tag history
  • Pruning settings:
    - Enabled pruning
    - 1 day partitioning Length
    - enabled Preprocessed partitions (60s)

I'm wondering:

  1. Are there logs or indicators I can check to confirm if pruning is running and encountering issues?
  2. Is there something additional I need to configure at the database level for pruning to work?

How long did you wait? I think the pruning schedule starts with the time of the change and for a 1 day pruning schedule you might have to wait 24 hours before it deletes anything.

Sorry, some context was missing:

  • Data pruning age is selected for 2 years
    -> the database is keeping data from 2021.

Recommend checking logs, as in the following related thread:

If it's been longer than 10 minutes, the logs might let you know what's wrong. In the linked thread the gateway name had changed but the pruning routine only checks historian tables under the current name's drvid record (presumably to prevent pruning other gateways' data on the same DB).

1 Like

Thanks for the tip.
I've reinitiated the Pruning settings and like you said, after 10 minutes, it worked.

Since the servers' hard drive was full, I deleted the logs manually as a quick fix. The gateway seems to still want to delete these non existing logs and gives me a bunch of errors.
How can erase these?

Might need to verify that the Ignition User has permission to drop tables.

1 Like

You need to delete the corresponding entries in the sqlth_drv table; that's what the historian uses as the 'source of truth' for what data tables exist.

3 Likes