Skip to content

Loading…

New console command to update core and/or plugins #4711

Closed
mattab opened this Issue · 4 comments

2 participants

@mattab
Piwik Open Source Analytics member

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 ```

this would:

  • run the Core upgrade and Plugins upgrades,
  • for each execute the changes in the */Updates/ directories, and execute the SQL code and/or scripts.
  • --dry-run -> when this is specified, print the SQL queries that would otherwise be executed. Useful for debugging or preparations before big upgrades.

So after updating Piwik files for core and/or plugins one can run this command to upgrade the schema and run any upgrade script.

@gaumondp

May I suggest adding a local directory option?

--localdir /sftp/mirror-of-marketplace/

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. :)

Dali

@mattab
Piwik Open Source Analytics member

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.
@mattab
Piwik Open Source Analytics member

In 8082e28: Fixes #4711 Adding new console command to trigger Piwik core and Plugins upgrades, if any.
Run it via: ./console core:update --dry-run

@mattab
Piwik Open Source Analytics member

In ef05c6c: Refs #4711 Documents the new console command to use

@mattab mattab added this to the 2.1 - Piwik 2.1 milestone
@mattab mattab self-assigned this
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue
@mattab mattab Fixes #4711 Adding new console command to trigger Piwik core and Plug…
…ins upgrades, if any.

Run it via: ./console core:update --dry-run
8082e28
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue
@mattab mattab Refs #4711 Documents the new console command to use ef05c6c
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.