the current recommend command to upgrade Piwik is:
php index.php -- "module=CoreUpdater" ``` instead let's add a new console command such as:
./console coreadmin:update ```
So after updating Piwik files for core and/or plugins one can run this command to upgrade the schema and run any upgrade script.
May I suggest adding a local directory option?
Right now it makes no sense to also offer Piwik source itself because this new option would need the new source first, but if it's there in 2.1 or 2.2 then afterward we would be able to use --localdir to put the Piwik source and almost be as comfortable as clicking the update button in the Web interface. :)
example outputs DRY RUN
$ ./console core:update --dry-run *** 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-rc6. *** Note: this is a Dry Run *** ALTER TABLE piwik_user ADD COLUMN `superuser_access` tinyint(2) unsigned NOT NULL DEFAULT '0' AFTER token_auth; ALTER TABLE `piwik_site` ADD `type` VARCHAR(255) NOT NULL DEFAULT 'website' AFTER `group` ; UPDATE `piwik_option` SET option_value = '2.1-rc6' WHERE option_name = 'version_core'; *** End of Dry Run ***
EXAMPLE Running the upgrade:
$ ./console core:update *** 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-rc6. The database upgrade process may take a while, so please be patient. *** Piwik has been successfully updated! ***
Example After the upgrade was executed:
$ ./console core:update --dry-run Everything is already up to date.
In 8082e284e5930dee4930b61a44d7febfbde0b44a: Fixes #4711 Adding new console command to trigger Piwik core and Plugins upgrades, if any.
Run it via: ./console core:update --dry-run
In ef05c6c5e3a37a661348c78b830f23cadbb5b9b8: Refs #4711 Documents the new console command to use