Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mattab opened this issue Feb 19, 2014 · 4 comments
Closed

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

mattab opened this issue Feb 19, 2014 · 4 comments
Assignees
Labels
Milestone

Comments

@mattab
Copy link
Member

@mattab mattab commented Feb 19, 2014

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
Copy link

@gaumondp gaumondp commented Feb 19, 2014

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
Copy link
Member Author

@mattab mattab commented Feb 20, 2014

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
Copy link
Member Author

@mattab mattab commented Feb 20, 2014

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
Copy link
Member Author

@mattab mattab commented Mar 4, 2014

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

@mattab mattab added this to the 2.1 - Piwik 2.1 milestone Jul 8, 2014
@mattab mattab self-assigned this Jul 8, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
…e and Plugins upgrades, if any.

Run it via: ./console core:update --dry-run
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants