Skip to content

Commit 650f84b

Browse files
authored
docs: fix the 2.x update procedure and its composer command (#47)
1 parent 0b106d2 commit 650f84b

1 file changed

Lines changed: 34 additions & 4 deletions

File tree

versioned_docs/version-2.x/update.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,49 @@ sidebar_position: 14
44
---
55

66
## Update components
7-
To update Thelia components just execute this command
87

8+
Set the version you want in your `composer.json`:
9+
10+
```json
11+
"thelia/thelia-skeleton": "~2.6.2"
912
```
10-
composer update thelia/thelia-skeleton 2.5.0
13+
14+
Then run:
15+
16+
```bash
17+
composer update
1118
```
1219

13-
## Update database
14-
Then update you can update your database with this script
20+
`composer update thelia/thelia-skeleton 2.6.2` does not work: Composer reads `2.6.2` as a second
21+
package name. Use `composer require thelia/thelia-skeleton:~2.6.2` if you prefer a single command.
22+
23+
## Update the database
24+
25+
Updating the files is never enough. Most releases ship an SQL script that alters the schema, and a
26+
site running new files on an old database will break. Run the update script from the root of your
27+
installation:
1528

1629
```bash
1730
php local/setup/update.php
1831
```
1932

33+
The script reads the `thelia_version` configuration variable from your database and replays every
34+
update script between that version and the one your files are at, in order. Going from 2.5.4 to
35+
2.6.2 applies 2.5.5, 2.6.0, 2.6.1 and 2.6.2 in a single run, so there is no need to upgrade one
36+
version at a time.
37+
38+
It offers to back up your database first, and restores that backup if a script fails. On a large
39+
database, prefer a manual `mysqldump` taken before you start.
40+
41+
## Clear the cache
42+
43+
```bash
44+
php Thelia cache:clear
45+
php Thelia cache:clear --env=prod
46+
```
47+
48+
If the command fails, empty the `var/cache` and `web/cache` directories by hand.
49+
2050
## Migrate from Thelia `< 2.4` to 2.5
2151
Module made for Thelia `<= 2.4` are not compatible with the new version of Thelia, but there is no lot of change to make it compatible.
2252

0 commit comments

Comments
 (0)