I wish to run an offline analytics on my old piwik data using php-mysql.
Is there a way to programmatically access the archived blobs of piwik? Where can I find more information about the structure of the tables using in piwik?
I wish to run an offline analytics on my old piwik data using php-mysql.
Is there a way to programmatically access the archived blobs of piwik? Where can I find more information about the structure of the tables using in piwik?
If you wish to run offline analytics, you'd have to use both archived blobs and numeric tables because
And both of the tables are again encoded into a different form, example binary for ...archive_numeric...
So, i'd suggest, if you can't manage decoding the tables, you can take data snapshots of all the tables you require and then perform analysis as you wish.
You can see the data in the blob using this example:
Load the file into PHP, uncompress and unserialze it using the following:
<?php
$sBlobFile = file_get_contents( 'piwik_archive_blob_2017_03-value.bin' );
$sBlobFile = unserialize( gzuncompress ( $sBlobFile ) );
var_dump( $sBlobFile );
Of course you can also just retrieve the blob using MySQL and access it directly in PHP opposed to downloading it as a file first.
Regarding the data structure, I could not find anything in the Mamtomo docs on what the values in the array structure within the blob represent.