Skip to content

Commit cb85bba

Browse files
authored
docs: replace thelia:install with the update script in the 3.0 update page (#48)
1 parent 650f84b commit cb85bba

2 files changed

Lines changed: 64 additions & 20 deletions

File tree

docs/upgrading/update.md

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,37 @@ sidebar_position: 2
77

88
## Update components
99

10-
Update Thelia and its dependencies:
10+
A project depends on `thelia/thelia-skeleton`, which brings in `thelia/core` and the templates. Set
11+
the version you want in your `composer.json`:
1112

12-
```bash
13-
composer update thelia/thelia
13+
```json
14+
"thelia/thelia-skeleton": "^3.0"
1415
```
1516

16-
For a specific version:
17+
Then run:
1718

1819
```bash
19-
composer require thelia/thelia:^3.1
20+
composer update
2021
```
2122

2223
## Update the database
2324

24-
After updating, apply database migrations:
25+
New files on an old database will break: a release can ship an SQL script that alters the schema.
26+
Run the update script from the root of your installation:
2527

2628
```bash
27-
php Thelia thelia:install
29+
php local/setup/update.php
2830
```
2931

30-
This command applies database schema updates, new migrations, and any required data updates.
32+
It reads the `thelia_version` configuration variable from your database and replays every update
33+
script between that version and the one your files are at, in order. Several versions at once are
34+
applied in a single run. The script offers to back up your database first and restores that backup
35+
if a script fails, but on a large database prefer a manual `mysqldump` taken before you start.
36+
37+
:::danger Never run `thelia:install` on an existing shop
38+
That command is the initial installer, not a migration tool. It replays `thelia.sql`, which starts
39+
by dropping every table.
40+
:::
3141

3242
## Update assets
3343

@@ -45,12 +55,23 @@ command the console does not carry: each comes from a package the corresponding
4555

4656
## Clear the cache
4757

48-
Always clear the cache after an update:
58+
In development:
4959

5060
```bash
5161
php Thelia cache:clear
5262
```
5363

64+
In production, delete the directory and warm it up again instead of calling `cache:clear`, which
65+
boots the very container it is about to remove:
66+
67+
```bash
68+
rm -rf var/cache/prod
69+
php bin/console cache:warmup --env=prod
70+
```
71+
72+
Do not skip the warmup. The production kernel does not build the LiveComponent template map on
73+
demand, and every back-office page that renders a live component returns a 500 without it.
74+
5475
## Updating modules
5576

5677
Update modules separately:
@@ -59,7 +80,8 @@ Update modules separately:
5980
composer update thelia/module-name
6081
```
6182

62-
After module updates:
83+
Then let Thelia compare the version in `module.xml` with the one stored in the database and run the
84+
module's own `update()` method:
6385

6486
```bash
6587
php Thelia module:refresh

versioned_docs/version-3.0/upgrading/update.md

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,37 @@ sidebar_position: 2
77

88
## Update components
99

10-
Update Thelia and its dependencies:
10+
A project depends on `thelia/thelia-skeleton`, which brings in `thelia/core` and the templates. Set
11+
the version you want in your `composer.json`:
1112

12-
```bash
13-
composer update thelia/thelia
13+
```json
14+
"thelia/thelia-skeleton": "^3.0"
1415
```
1516

16-
For a specific version:
17+
Then run:
1718

1819
```bash
19-
composer require thelia/thelia:^3.1
20+
composer update
2021
```
2122

2223
## Update the database
2324

24-
After updating, apply database migrations:
25+
New files on an old database will break: a release can ship an SQL script that alters the schema.
26+
Run the update script from the root of your installation:
2527

2628
```bash
27-
php Thelia thelia:install
29+
php local/setup/update.php
2830
```
2931

30-
This command applies database schema updates, new migrations, and any required data updates.
32+
It reads the `thelia_version` configuration variable from your database and replays every update
33+
script between that version and the one your files are at, in order. Several versions at once are
34+
applied in a single run. The script offers to back up your database first and restores that backup
35+
if a script fails, but on a large database prefer a manual `mysqldump` taken before you start.
36+
37+
:::danger Never run `thelia:install` on an existing shop
38+
That command is the initial installer, not a migration tool. It replays `thelia.sql`, which starts
39+
by dropping every table.
40+
:::
3141

3242
## Update assets
3343

@@ -45,12 +55,23 @@ command the console does not carry: each comes from a package the corresponding
4555

4656
## Clear the cache
4757

48-
Always clear the cache after an update:
58+
In development:
4959

5060
```bash
5161
php Thelia cache:clear
5262
```
5363

64+
In production, delete the directory and warm it up again instead of calling `cache:clear`, which
65+
boots the very container it is about to remove:
66+
67+
```bash
68+
rm -rf var/cache/prod
69+
php bin/console cache:warmup --env=prod
70+
```
71+
72+
Do not skip the warmup. The production kernel does not build the LiveComponent template map on
73+
demand, and every back-office page that renders a live component returns a 500 without it.
74+
5475
## Updating modules
5576

5677
Update modules separately:
@@ -59,7 +80,8 @@ Update modules separately:
5980
composer update thelia/module-name
6081
```
6182

62-
After module updates:
83+
Then let Thelia compare the version in `module.xml` with the one stored in the database and run the
84+
module's own `update()` method:
6385

6486
```bash
6587
php Thelia module:refresh

0 commit comments

Comments
 (0)