Ticket #697 (closed maintenance: fixed)

Opened 3 years ago

Last modified 3 years ago

Piwik 2.1 upgrade for stats.transitionnetwork.org

Reported by: chris Owned by: chris
Priority: major Milestone: Maintenance
Component: Piwik Keywords:
Cc: ed Estimated Number of Hours: 0.0
Add Hours to Ticket: 0 Billable?: yes
Total Hours: 1.2

Description

Full details on the piwik blog:

Piwik 2.1 is the first release after our 2.0 release and it reflects the new direction Piwik is moving in: better performance, more reliability and a better overall open platform!

Change History

comment:1 Changed 3 years ago by chris

  • Status changed from new to accepted
  • Summary changed from Piwik 2.1 upgtate for stats.ttansitionnetwork.org to Piwik 2.1 upgrade for stats.tansitionnetwork.org

comment:2 Changed 3 years ago by chris

  • Summary changed from Piwik 2.1 upgrade for stats.tansitionnetwork.org to Piwik 2.1 upgrade for stats.transitionnetwork.org

comment:3 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.85
  • Total Hours changed from 0.0 to 0.85

According to the blog post about Piwik 2.1:

The cron script http://piwik.org/docs/setup-auto-archiving/ you can setup to automatically process your reports will now create new processes to perform asynchronous archiving instead issuing CURL http requests.

Full details are in the Piwik 2.1.0 Changelog.

Following the last upgrade, ticket:672 and the wiki:PiwikServer#Updates notes and updating these as we go:

  1. Switch off the recording of stats by setting record_statistics to 0 in /web/stats.transitionnetwork.org/piwik/config/config.ini.php:
[Tracker]
record_statistics = 0
  1. Backup the config file:
cd /web/stats.transitionnetwork.org/
cp piwik/config/config.ini.php .
  1. Download, extract, and update the database and restart php-fpm:
export PIWIK=0.1.2
wget "http://builds.piwik.org/piwik-$PIWIK.tar.gz"
tar -zxvf piwik-$PIWIK.tar.gz
cp config.ini.php piwik/config/
chown -R www-data:www-data piwik/
php /web/stats.transitionnetwork.org/piwik/index.php -- "module=CoreUpdater" 
  PHP Warning:  require_once(./modules/testMinimumPhpVersion.php): failed to open stream: No such file or directory in /web/stats.transitionnetwork.org/piwik/index.php on line 20
  
  Warning: require_once(./modules/testMinimumPhpVersion.php): failed to open stream: No such file or directory in /web/stats.transitionnetwork.org/piwik/index.php on line 20
  PHP Fatal error:  require_once(): Failed opening required './modules/testMinimumPhpVersion.php' (include_path='.:/usr/share/php:/usr/share/pear') in /web/stats.transitionnetwork.org/piwik/index.php on line 20
  
  Fatal error: require_once(): Failed opening required './modules/testMinimumPhpVersion.php' (include_path='.:/usr/share/php:/usr/share/pear') in /web/stats.transitionnetwork.org/piwik/index.php on line 20

Oh dear...

The site displays:

> Warning: The magic method __isset() must have public visibility and cannot be static in /web/stats.transitionnetwork.org/piwik/libs/Zend/Config.php on line 184
> 
> Strict Standards: Declaration of Piwik_Log::log() should be compatible with Zend_Log::log($message, $priority) in /web/stats.transitionnetwork.org/piwik/modules/Log.php on line 25
> 
> The magic method __toString() must have public visibility and cannot be static 
> in '/web/stats.transitionnetwork.org/piwik/modules/TablePartitioning.php' at the line 84
> 
> #0  Piwik_ErrorHandler(2, The magic method __toString() must have public visibility and cannot be static, /web/stats.transitionnetwork.org/piwik/modules/TablePartitioning.php, 84, Array ([_GET] => Array (),[_POST] => Array (),[_COOKIE] => Array ([PIWIK_SESSID] => ikvddiuhp9doherkh0gpjseru4,[PHPSESSID] => 600v38avmoptplog7iv4v4h213),[_FILES] => Array (),[piwik_minimumPhpVersion] => 5.1.3,[piwik_currentVersion] => 5.4.4-14+deb7u8,[piwik_zend_compatibility_mode] => ,[_REQUEST] => Array (),[GLOBALS] => Array ( *RECURSION*,[_SERVER] => Array ([USER] => www-data,[HOME] => /web,[FCGI_ROLE] => RESPONDER,[QUERY_STRING] => ,[REQUEST_METHOD] => GET,[CONTENT_TYPE] => ,[CONTENT_LENGTH] => ,[SCRIPT_FILENAME] => /web/stats.transitionnetwork.org/piwik/index.php,[SCRIPT_NAME] => /index.php,[REQUEST_URI] => /,[DOCUMENT_URI] => /index.php,[DOCUMENT_ROOT] => /web/stats.transitionnetwork.org/piwik,[SERVER_PROTOCOL] => HTTP/1.1,[GATEWAY_INTERFACE] => CGI/1.1,[SERVER_SOFTWARE] => nginx/1.4.4,[REMOTE_ADDR] => XX.XX.XX.XX/
[REMOTE_PORT] => 59676,[SERVER_ADDR] => 81.95.52.111,[SERVER_PORT] => 443,[SERVER_NAME] => stats.transitionnetwork.org,[GEOIP_ADDR] => XX.XX.XX.XX,[GEOIP_COUNTRY_CODE] => GB,[GEOIP_COUNTRY_NAME] => United Kingdom,[GEOIP_REGION] => ,[GEOIP_REGION_NAME] => ,[GEOIP_CITY] => ,[GEOIP_AREA_CODE] => 0,[GEOIP_LATITUDE] => 54.0000,[GEOIP_LONGITUDE] => -2.0000,[GEOIP_POSTAL_CODE] => ,[HTTPS] => on,[REDIRECT_STATUS] => 200,[HTTP_HOST] => stats.transitionnetwork.org,[HTTP_USER_AGENT] => Mozilla/5.0 (X11; Linux i686; rv:27.0) Gecko/20100101 Firefox/27.0,[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,[HTTP_ACCEPT_LANGUAGE] => en-gb,en;q=0.5,[HTTP_ACCEPT_ENCODING] => gzip, deflate,[HTTP_DNT] => 1,[HTTP_COOKIE] => PIWIK_SESSID=ikvddiuhp9doherkh0gpjseru4; PHPSESSID=600v38avmoptplog7iv4v4h213,[HTTP_CONNECTION] => keep-alive,[HTTP_CACHE_CONTROL] => max-age=0,[PHP_SELF] => /index.php,[REQUEST_TIME_FLOAT] => 1393939037.6344,[REQUEST_TIME] => 1393939037),[_Event_Dispatcher] => Array ([NotificationClass] => Event_Notification),[_SESSION] => Array ())) called at [/web/stats.transitionnetwork.org/piwik/modules/ArchiveProcessing.php:12]
> #1  require_once() called at [/web/stats.transitionnetwork.org/piwik/modules/ArchiveProcessing.php:12]
> #2  require_once(/web/stats.transitionnetwork.org/piwik/modules/ArchiveProcessing.php) called at [/web/stats.transitionnetwork.org/piwik/modules/Archive.php:15]
> #3  require_once(/web/stats.transitionnetwork.org/piwik/modules/Archive.php) called at [/web/stats.transitionnetwork.org/piwik/modules/API/APIable.php:13]
> #4  require_once(/web/stats.transitionnetwork.org/piwik/modules/API/APIable.php) called at [/web/stats.transitionnetwork.org/piwik/modules/FrontController.php:26]
> #5  require_once(/web/stats.transitionnetwork.org/piwik/modules/FrontController.php) called at [/web/stats.transitionnetwork.org/piwik/index.php:50]

Do'h, my fault, that was with the wrong version, should have looked closer at the list at http://builds.piwik.org/ trying again:

export PIWIK=2.1.0
wget "http://builds.piwik.org/piwik-$PIWIK.tar.gz"
tar -zxvf piwik-$PIWIK.tar.gz
cp config.ini.php piwik/config/
chown -R www-data:www-data piwik/
php /web/stats.transitionnetwork.org/piwik/index.php -- "module=CoreUpdater"
  *** Update ***
  
      Database Upgrade Required
  
      Your Piwik database is out-of-date, and must be upgraded before you can continue.
  
      Piwik database will be upgraded from version 2.0.3 to the new version 2.1.0.
  
  *** Note: this is a Dry Run ***
  
      ALTER TABLE user ADD COLUMN `superuser_access` tinyint(2) unsigned NOT NULL DEFAULT '0' AFTER token_auth;
      UPDATE `option` SET option_value = '2.0.4-b8' WHERE option_name = 'version_core';
      
  *** End of Dry Run ***

So doing this manually:

mysql stats
  
  mysql> ALTER TABLE user ADD COLUMN `superuser_access` tinyint(2) unsigned NOT NULL DEFAULT '0' AFTER token_auth;
  Query OK, 10 rows affected (1.20 sec)
  Records: 10  Duplicates: 0  Warnings: 0
  
  mysql> UPDATE `option` SET option_value = '2.0.4-b8' WHERE option_name = 'version_core';
  Query OK, 1 row affected (0.00 sec)
  Rows matched: 1  Changed: 1  Warnings: 0


And the site is up and running again, phew!

Sort out the logo:

cp /web/penguin.transitionnetwork.org/www/favicon.ico /web/stats.transitionnetwork.org/piwik/plugins/CoreHome/images/favicon.ico
cp /web/penguin.transitionnetwork.org/www/favicon.ico /web/stats.transitionnetwork.org/piwik/favicon.ico
cp /web/penguin.transitionnetwork.org/www/logo.png /web/stats.transitionnetwork.org/piwik/plugins/Morpheus/images/logo.png
cp /web/penguin.transitionnetwork.org/www/logo-header.png /web/stats.transitionnetwork.org/piwik/plugins/Morpheus/images/logo-header.png 

But Piwik now uses a SVG logo so that doesn't work:

According to http://dev.piwik.org/trac/ticket/4563 there is now a config option for this.

However the password for the admin account appears to have changed, I'll follow this up with Ed.

Switch recording of stats back on by setting record_statistics to 1 in /web/stats.transitionnetwork.org/piwik/config/config.ini.php:

[Tracker]
record_statistics = 1

comment:4 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.35
  • Status changed from accepted to closed
  • Resolution set to fixed
  • Total Hours changed from 0.85 to 1.2

Looking at:

This seems to be out of date and also the admin user doesn't exist!

So I have made myself a superuser:

mysql stats

mysql> update user set superuser_access="1" where login="chris";

I have got a big logo from https://www.transitionnetwork.org/support/branding

And uploaded that, and recreated the admin account and gave it superuser status via the database as above and updated the wiki page, wiki:PiwikServer

I think this is done, so closing.

Note: See TracTickets for help on using tickets.