Hello everyone,
We would like to delete old visitor logs every 3 months (as recommended in the Privacy settings page). However, we do want to keep the user data for at least a year so that we can have some longitudinal data to use for our Annual Report.
We thought maybe we could do something like this every 3 months:
[ol]
[li] Do a mysqldump of the Piwik database.
[/li][li] Clear the Piwik visitor logs.
[/li][li] Import the mysqldump into a local (offline) version of Piwik. Ideally this should just add on any new data, rather than replacing one dump with another dump. ie, if Dump1.sql covers January-March, and Dump2.sql covers April-June, then I would want the local Piwik to import both dumps and have January-June.
[/li][/ol]
So…
[ul]
[li] Is there anything wrong with doing this?
[/li][li] Is there a better way to do it?
[/li][li] If it’s okay to do it, how would I do step 3? So far, I have been doing dumps like this:
[/li]
mysqldump -u username -p databasename | gzip > filename.sql.gz
I can see that this has DROP TABLEs in it, I guess this will cause one dump to replace another rather than adding to it?
[/ul]
Thanks for any help!