Purge-old-archive-data don't work

Hello,

I have a problem with purge-old-archive-data on the command line.

1: mysqldump matomo_db log_action > log_action.sql
Size: 10 MB (data since 2014 inside)

2: ./console core:invalidate-report-data --dates=1996-01-01,2025-01-01 --ignore-log-deletion-limit
Checked: the database table archive_invalidations = full filled.
Size: 10 MB

3: ./console core:purge-old-archive-data all

4: mysqldump matomo_db log_action > log_action.sql
Size: 10 MB

Result: No report data are deleted.

In Matomo reports: The line is dashed in the “Visits over time” widget.

What is wrong? Please help.

What’s the problem?

mysql_dump archive_invalidations


LOCK TABLES `archive_invalidations` WRITE;
/*!40000 ALTER TABLE `archive_invalidations` DISABLE KEYS */;
INSERT INTO `archive_invalidations` VALUES
(369855,159,'done',1,'2014-01-01','2014-12-31',4,'2025-03-18 16:50:27',0,NULL,NULL,NULL,NULL),
(369856,162,'done',2,'2014-01-01','2014-12-31',4,'2025-03-18 16:50:27',0,NULL,NULL,NULL,NULL),
(369857,NULL,'done',3,'2014-01-01','2014-12-31',4,'2025-03-18 16:50:27',0,NULL,NULL,NULL,NULL),
...
(513492,NULL,'done',49,'2025-01-01','2025-01-01',1,'2025-03-18 16:50:35',0,NULL,NULL,NULL,NULL),
(513493,88194,'done',49,'2025-01-01','2025-01-31',3,'2025-03-18 16:50:35',0,NULL,NULL,NULL,NULL),
(513494,126848,'done',49,'2025-01-01','2025-12-31',4,'2025-03-18 16:50:35',0,NULL,NULL,NULL,NULL);

Logfile: ./console core:purge-old-archive-data all

Purging outdated archives for 1996_01...Done. [Time elapsed: 0.005s]
Purging outdated archives for 1996_02...Done. [Time elapsed: 0.002s]
Purging outdated archives for 1996_03...Done. [Time elapsed: 0.002s]
...
Purging outdated archives for 2025_02...Done. [Time elapsed: 0.004s]
Purging outdated archives for 2025_03...Done. [Time elapsed: 0.003s]
Purging outdated archives for 2025_04...Done. [Time elapsed: 0.001s]
Purging invalidated archives for 1996_01...Done. [Time elapsed: 0.003s]
Purging invalidated archives for 1996_02...Done. [Time elapsed: 0.006s]
Purging invalidated archives for 1996_03...Done. [Time elapsed: 0.002s]
...
Purging invalidated archives for 2025_02...Done. [Time elapsed: 0.011s]
Purging invalidated archives for 2025_03...Done. [Time elapsed: 0.008s]
Purging invalidated archives for 2025_04...Done. [Time elapsed: 0.002s]
Purging custom range archives for 1996_01...Done. [Time elapsed: 0.006s]
Purging custom range archives for 1996_02...Done. [Time elapsed: 0.002s]
Purging custom range archives for 1996_03...Done. [Time elapsed: 0.002s]
...
Purging custom range archives for 2025_02...Done. [Time elapsed: 0.014s]
Purging custom range archives for 2025_03...Done. [Time elapsed: 0.014s]
Purging custom range archives for 2025_04...Done. [Time elapsed: 0.007s]
Optimizing archive tables...
Optimizing table archive_numeric_1996_01...Done. [Time elapsed: 0.013s]
Optimizing table archive_blob_1996_01...Done. [Time elapsed: 0.005s]
Optimizing table archive_numeric_1996_02...Done. [Time elapsed: 0.006s]
Optimizing table archive_blob_1996_02...Done. [Time elapsed: 0.004s]
Optimizing table archive_numeric_1996_03...Done. [Time elapsed: 0.005s]
Optimizing table archive_blob_1996_03...Done. [Time elapsed: 0.004s]
...
Optimizing table piwik_archive_numeric_2025_02...Done. [Time elapsed: 0.043s]
Optimizing table piwik_archive_blob_2025_02...Done. [Time elapsed: 0.082s]
Optimizing table piwik_archive_numeric_2025_03...Done. [Time elapsed: 0.033s]
Optimizing table piwik_archive_blob_2025_03...Done. [Time elapsed: 0.048s]
Optimizing table piwik_archive_numeric_2025_04...Done. [Time elapsed: 0.018s]
Optimizing table piwik_archive_blob_2025_04...Done. [Time elapsed: 0.008s]

But after that no change in the database.

… it’s the old mistake…
log are raw data (like server access_log).
archive are reports(stats data).

It’s seems, there is no console command for delete archive data and also not with a date range.

There is only a console command for delete log data with date range:
./console core:delete-logs-data --dates=2015-01-01,2015-02-01

Delete archive is only possible with MySQL commands:

  • DROP (delete)
  • TRUNCATE (clear)