1.8.4 upgrade failure (was: migrating Piwik data from one server to another?)

I have set up Piwik 1.9b2 on a new server, and what I’d like to try is exporting some of the data from my semi-functional 1.8.3 server, but I want to export a single site at a time and import them one by one into the new server.

Is this type of targeted export/import possible? Also, is there a clean way to delete a single site from a Piwik server (without having access to the web interface to do so)?

I tried upgrading the broken 1.8.3 installation to 1.8.4 in the hopes that it would alleviate the memory allocation errors I’ve been getting the past month or so, but instead it’s made that entire Piwik installation unusuable… every single page I try to open fails with:

Fatal error: Out of memory (allocated 257949696) (tried to allocate 71 bytes) in piwik/core/DataTable.php on line 1071

I can’t even get to the settings pages anymore.

Is there a way, from phpMyAdmin or the shell, that I can export my sites one at a time, and move them to another Piwik server?

If I need to scrap all of the data I’ve collected over the past 2 months and start all over, so be it, just let me know.

Of course you can migrate easily your Piwik from one server to a better server, by simply migrating the Database exported with phpmyadmin or your web host panel, and copy the config/config.ini.php updating the Mysql infos in the file.

See: Installation - Analytics Platform - Matomo

The docs I had read said not to import an older db into a newer Piwik installation, and the new installation (running 1.9 beta 2) already has some of the same sites from the old Piwik site set up and those few are collecting fresh data starting from scratch.

I don’t need to copy over all of the sites from the old installation, and I also wouldn’t want to overwrite what’s already been collected by the new server with the old server’s data, so if I could migrate some of the sites from the old install over one at a time, that would be ideal :slight_smile:

Is there an SQL script amongst the Piwik tools somewhere that I could run in phpMyAdmin to export just the data for a particular siteID?

actually a good friend of mine is an Oracle consultant, and just starting to play with mySQL, so I emailed her the db schema and I think she’s going to take a crack at it just for the fun of it :slight_smile:

I’ve also called it a wash on the old installation. I’ve saved the old database so my friend can play with it, but I’ve created a new db and set up a new 1.9b2 installation, so now I’ve got 2 Piwik installs running the beta… should be fun again!

Ok, if your friend would like to contribute her code it would be very cool. especially, if was running as a Piwik plugin? :wink:

For example I would suggest a new function in CoreAdminHome_API, that would export a ZIP file containing information about 1 site . then, another function to import a given zipfile (in a given directory) into the piwik DB.
The export would be run on oldServer and the import on newServer, both using same Piwik version, and these 2 functions and it should work nice :wink:

If she gets the SQL code working, I can see what I can do. I’m not really a PHP coder, but we’ll cross that bridge when we get there!

Also, on one of the 1.9b2 installs, I’m going to attempt to import that 25Gb access log… this should be VERY interesting!

Indeed we look forward to hearing about this. If you could write a blog post about your experience, it would be fantastic ? Or write a “Post mortem” for the project ? many would benefit from this info I think, and it might good ideas to people to do the same.