-
Notifications
You must be signed in to change notification settings - Fork 489
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1918 from M0rgan01/add-upgrade-cli-section
[UPGRADE] Add section for CLI, improve upgrade page
- Loading branch information
Showing
3 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: Upgrade Module | ||
weight: 80 | ||
aliases: | ||
- /1.7/development/upgrade-module/ | ||
--- | ||
|
||
# Upgrade module | ||
|
||
Also known as the "Autoupgrade module" or the "1-click upgrade module", PrestaShop upgrade assistant aims to automatize the upgrade process. | ||
|
||
Details on how to use the web interface are documented in [Keep up-to-date: Upgrade Assistant page]({{< ref "/1.7/basics/keeping-up-to-date/use-autoupgrade-module.md" >}}). | ||
|
||
{{% children /%}} | ||
|
||
## How to download it | ||
|
||
You can download it from [the module GitHub repository](https://github.com/PrestaShop/autoupgrade/releases) or from your shop administration panel. |
115 changes: 115 additions & 0 deletions
115
basics/keeping-up-to-date/upgrade-module/upgrade-cli.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
--- | ||
title: Upgrade CLI | ||
weight: 40 | ||
aliases: | ||
- /1.7/development/upgrade-module/upgrade-cli | ||
--- | ||
|
||
# Module CLI | ||
|
||
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 CLI | ||
|
||
Upgrade module can be used as a Command Line Interface. | ||
|
||
### Command line parameters | ||
|
||
Entry point is *cli-upgrade.php* from the module's directory. | ||
The following parameters are mandatory: | ||
|
||
* **--dir**: Specify the admin directory name | ||
|
||
You can also use these parameters: | ||
|
||
* **--channel**: Specify the channel to use | ||
* **--action**: Specify the step you want to start from | ||
|
||
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 | ||
``` | ||
|
||
## Rollback CLI | ||
|
||
{{% notice warning %}} | ||
**Important** | ||
|
||
It is not recommended to use this option. It's always better to manager your backup manually. | ||
{{% /notice %}} | ||
|
||
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. | ||
|
||
### Command line parameters | ||
|
||
Entry point is *cli-rollback.php*. | ||
The following parameters are mandatory: | ||
|
||
* **--dir**: Specify the admin directory name | ||
* **--backup**: Specify the backup name to restore (this can be found in your folder `<admin directory>/autoupgrade/backup/`) | ||
|
||
Example: | ||
|
||
``` | ||
$ php modules/autoupgrade/cli-rollback.php --dir=admin-dev --backup=V1.7.5.1_20190502-191341-22e883bd | ||
``` | ||
|
||
## Full example | ||
|
||
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. | ||
|
||
### Step 1: Uninstall and remove the old autoupgrade module | ||
|
||
1. Uninstall the old AutoUpgrade module: | ||
|
||
`php bin/console prestashop:module uninstall autoupgrade` | ||
|
||
2. Remove the old module's directory: | ||
|
||
`rm -rf modules/autoupgrade` | ||
|
||
### Step 2: Install the new autoupgrade module | ||
|
||
1. Download the latest version of the autoupgrade module and place it in the /modules directory: | ||
|
||
`curl -L https://github.com/PrestaShop/autoupgrade/releases/latest/download/autoupgrade.zip -o modules/autoupgrade.zip && cd modules && unzip autoupgrade.zip && cd -` | ||
|
||
2. Install the new version of the autoupgrade module: | ||
|
||
`php bin/console prestashop:module install autoupgrade` | ||
|
||
### Step 3: Download the latest PrestaShop files | ||
|
||
1. Download the latest version of PrestaShop (.zip and .xml files): | ||
|
||
`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` | ||
|
||
### Step 4: Configure the autoupgrade module | ||
|
||
1. Create a configuration file for the AutoUpgrade module to use the local archive. Adjust the settings as needed: | ||
|
||
`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` | ||
|
||
|
||
2. Apply the configuration to the `autoupgrade` module: | ||
|
||
`php modules/autoupgrade/cli-updateconfig.php --from=modules/autoupgrade/config.json --dir=admin-dev` | ||
|
||
### Step 5: Start the Upgrade Process | ||
|
||
|
||
1. Initiate the upgrade process: | ||
|
||
`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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters