Core:archive directly in database

I’m running a matomo 3.13.6 over a 10 years database with around 1 TB of data.

This system was abandoned by last IT team and I’m try to resurrect this instance.

When I try to run, through cron, ./console core:archive command returns some errors in some sites with error msg “SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”.

So, my question is: have some way to run this process directly into mysql?

Hi,

No, the archiving needs to run the PHP code.

First I would make sure you follow the tipps from https://matomo.org/faq/troubleshooting/faq_183/

But there have been some more tipps for this issue reported here including switching from MySQLi to PDO (you can do that in the config.ini.php) and using another PHP mysql client:

Thank you by your reply, @Lukas.

For first part, about faq_183, yes. I did.

mysql> show variables like 'innodb_log_file_size';
+----------------------+-----------+
| Variable_name        | Value     |
+----------------------+-----------+
| innodb_log_file_size | 268435456 |
+----------------------+-----------+
1 row in set (0.00 sec)

 

mysql> show variables like 'max_allowed_packet';
+--------------------+-----------+
| Variable_name      | Value     |
+--------------------+-----------+
| max_allowed_packet | 268435456 |
+--------------------+-----------+
1 row in set (0.00 sec)

 

mysql> show variables like 'wait_timeout';
+---------------+--------+
| Variable_name | Value  |
+---------------+--------+
| wait_timeout  | 115200 |
+---------------+--------+
1 row in set (0.00 sec)

 

mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+

About the adapter, I will try it now. But, I also found problems with PHP 7.2, that is my current env. After to try adapter, i will try to upgrade to 7.3 or 7.4.

Hi,

Lukas, my env was working with PDO. Now, I changed to MYSQLi. Finally, works successfully after a long time (140 days without success).

Now, I have other problem.
|piwik_log_action|52.4 G|1.7 G|67,549,367|


|piwik_log_conversion        |   16 K|   32 K|            -|
|piwik_log_conversion_item   |   16 K|   16 K|            -|
|piwik_log_link_visit_action |162.2 G|125.8 G|1,792,641,420|
|piwik_log_visit             | 81.9 G| 45.4 G|  341,559,691|
|Total                       |296.4 G|172.9 G|2,201,750,478|

Have a way to delete old tracks? I already tried to use core:purge-old-archive-data all and nothing.

Some tip?

Hi,

All people reported it the other way around, but if it works for you I won’t complain.

You can select in the Admin settings if old raw log data should be automatically deleted.