2.1.0 upgrade problems

I just upgraded an installation from 1.2 to 2.1 using the automatic process and I had a few problems.

The installation’s DB is quite large so I decided I’d upgrade the database outside the browser. I tried to do it as advised with

php /PATH_TO_PIWIK/index.php – “module=CoreUpdater”

but when I did that, it just told me it was a dry run, and showed me a number of SQL queries which would be run. So, I put those in a text file and fed them to mysql.

That failed on the query

UPDATE option SET option_name = ‘version_ScheduledReports’ WHERE option_name = ‘version_PDFReports’ ;

because there was already an option named version_ScheduledReports. That was happily a fairly minor failure, and I carried on feeding the remaining commands, which eventually completed (it did take quite a while with a 4GB database). I’m now left with this

mysql> select * from option where option_name like “version_PDFReports”;
±-------------------±-------------±---------+
| option_name | option_value | autoload |
±-------------------±-------------±---------+
| version_PDFReports | 1.12 | 1 |
±-------------------±-------------±---------+

which presumably is redundant as the update was anyway trying to rename it. Should I simply delete it?

And now we come to the final, and most severe, failure - after the update I couldn’t login as admin. Presumably the update process should have created an admin entry in the user table from the details in the config file, but it didn’t (I only discovered this change in the handling of the admin user after restoring an old DB from backup and finding that there was no admin user there either, which was a puzzle initially) .

I manually created an admin user in the user table so I can now log in again, but you might want to look at that aspect of the upgrade process.

Sorry I’m answering with a question: How long is “quite a while updating a 4 GB database” ?

I’m asking because I got a 6 GB db and wanted to estimate the crunching time required…

Thanks in advance

Dali

It wasn’t actually that long IIRC - certainly longer than would have been good to try to do in a browser with timeout issues, but I don’t think it was any more than 1/2 hour, and I think somewhat less.

I manually created an admin user in the user table so I can now log in again, but you might want to look at that aspect of the upgrade process.

Thanks for the report. The problem is that the user is created, but not if you copied the SQL. (the SQL creating the user unfortunately does not show up in the list of SQL queries). Cheers

Ah - thanks Matt. In retrospect, that should have been an easy one to guess.

Maybe you can consider adding that to the list of queries shown for copying when you next push a minor update, as I think anybody with any size of piwik installation will be doing the manual update.

Indeed, you might even add the queries as a comment here where people might find them. I’d add mine, but I don’t use a table prefix (the concept annoys the hell out of me) so I’d be giving an untested query, which I never like doing - and besides, I might well miss something else.