The Autoupgrade module is accessible via cli
. Its advantages is to be used in conjunction with a CI/CD pipeline to automate your upgrade process.
It can be aswell used manually via regular cli
to avoid regular configuration limits on Apache or Nginx (php-cgi
, php-fpm
limitations such as memory_limit
, max_execution_time
, …).
Upgrade module can be used as a Command Line Interface.
Entry point is cli-upgrade.php from the module’s directory. The following parameters are mandatory:
You can also use these parameters:
UpgradeNow
)If you use default action
parameter, it will run the full upgrade process.
Example:
$ php modules/autoupgrade/cli-upgrade.php --dir=admin-dev --channel=major
Important
It is not recommended to use this option. It’s always better to manager your backup manually.
If an error occurs during the upgrade process, the rollback will be suggested. In case you lost the page from your backoffice, note it can be triggered via CLI.
Entry point is cli-rollback.php. The following parameters are mandatory:
<admin directory>/autoupgrade/backup/
)Example:
$ php modules/autoupgrade/cli-rollback.php --dir=admin-dev --backup=V1.7.5.1_20190502-191341-22e883bd
To upgrade your PrestaShop store to the latest version using the command line interface, follow the steps outlined below. Make sure to execute all commands from the root directory of your PrestaShop installation and replace admin-dev
with the name of your back office directory.
php bin/console prestashop:module uninstall autoupgrade
rm -rf modules/autoupgrade
curl -L https://github.com/PrestaShop/autoupgrade/releases/latest/download/autoupgrade.zip -o modules/autoupgrade.zip && cd modules && unzip autoupgrade.zip && cd -
php bin/console prestashop:module install autoupgrade
curl -L https://github.com/PrestaShop/PrestaShop/releases/download/8.0.2/prestashop_8.0.2.zip -o admin-dev/autoupgrade/download/prestashop.zip
curl -L https://github.com/PrestaShop/PrestaShop/releases/download/8.0.2/prestashop_8.0.2.xml -o admin-dev/autoupgrade/download/prestashop.xml
echo "{\"channel\":\"archive\",\"archive_prestashop\":\"prestashop.zip\",\"archive_num\":\"8.0.2\", \"archive_xml\":\"prestashop.xml\", \"PS_AUTOUP_CHANGE_DEFAULT_THEME\":0, \"skip_backup\": 1}" > modules/autoupgrade/config.json
autoupgrade
module:php modules/autoupgrade/cli-updateconfig.php --from=modules/autoupgrade/config.json --dir=admin-dev
php modules/autoupgrade/cli-upgrade.php --dir=admin-dev
The upgrade process is divided into multiple parts by default. To automate the entire process, use the testCliProcess.php
script, which runs all the steps automatically:
php modules/autoupgrade/tests/testCliProcess.php modules/autoupgrade/cli-upgrade.php --dir=admin-dev
By following these steps, your PrestaShop store should be successfully upgraded to the latest version.