Skip to content

Commit d9b591e

Browse files
committed
“Minor” updates and “major” upgrades clarifications
1 parent 94ea93f commit d9b591e

File tree

6 files changed

+74
-20
lines changed

6 files changed

+74
-20
lines changed

docs/5.x/images/cli-update-info.png

-21.8 KB
Binary file not shown.

docs/5.x/images/cli-update-plugin.png

-29.5 KB
Binary file not shown.

docs/5.x/images/update-badge.png

71.1 KB
Loading

docs/5.x/images/updates.png

350 KB
Loading

docs/5.x/update.md

Lines changed: 72 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,116 @@
11
# Running Updates
22

3-
Craft has a smart system based on [Composer](https://getcomposer.org) that helps you keep your site and plugins up-to-date.
3+
Craft has a smart system based on [Composer](https://getcomposer.org) that helps you keep your site and plugins up-to-date. This page covers routine _updates_ to dependencies, which we consider a distinct process from [major-version _upgrades_](#major-versions).
44

55
<!-- more -->
66

77
## Using the Control Panel
88

9-
When an update is available, users with the permission to update Craft will see a badge in the [control panel](./control-panel.md) next to **Utilities** in the global navigation:
9+
When an update is available, users with the permission to update Craft will see a badge in the [control panel](system/control-panel.md) next to <Journey path="Utilities" /> in the global navigation:
1010

1111
![Screenshot of control panel cropped to “Utilities” global navigation item, which contains a circular badge with the number “1” in it](./images/update-badge.png)
1212

13-
Click **Utilities****Updates**. (You can also get to this view directly from the **Updates** widget that’s installed by default in the control panel dashboard.)
13+
Click <Journey path="Utilities, Updates" />. You can also get to this view directly from the **Updates** widget that’s installed by default in the control panel [dashboard](system/control-panel.md#dashboard).
1414

1515
This section displays updates for Craft CMS and installed plugins, where each version has its own collapsible panel detailing relevant changes.
1616

1717
![Stylized screenshot of “Updates” page, which displays two plugins with newer versions with collapsible panes detailing their changes](./images/updates.png)
1818

19-
There may be an **Update** button next to each item and an **Update All** at the top of the screen, depending on your the <config5:allowUpdates> and <config5:allowAdminChanges> settings for your current environment. You can use those to initiate updates directly from the control panel.
19+
You can update one dependency at a time using its **Update** button, or update everything with the **Update All** at the top of the screen. If you don’t see these options, ensure the <config5:allowUpdates> and <config5:allowAdminChanges> settings are enabled in your current environment. We generally _do not_ recommend applying updates in a non-development environment—see our [workflow](deploy.md) page for details.
2020

2121
::: tip
22-
Craft’s [changelog](repo:craftcms/cms/blob/5.x/CHANGELOG.md) will warn you of any critical changes at the top of the release notes. While there aren’t usually any warnings, it’s always a good idea to check the changelog and [any upgrade guides](#upgrade-guides) before updating.
22+
Craft’s [changelog](repo:craftcms/cms/blob/5.x/CHANGELOG.md) will warn you of any critical changes at the top of the release notes. While there aren’t _usually_ any warnings, it’s always a good idea to check the changelog and [any upgrade guides](#upgrade-guides) before updating.
23+
24+
Urgent messages from changelogs (like security patches) are exposed as a banner in the control panel to all administrators.
2325
:::
2426

25-
After Craft successfully installs updates, it will run any new migrations.
27+
After Craft successfully installs the updates, it will run any new migrations.
2628

2729
## Updating from the Terminal
2830

2931
### Craft CLI
3032

3133
The [`update` console command](reference/cli.md#update) can be used to update Craft and plugins.
3234

33-
To see available updates, go to your Craft project in your terminal and run this command:
35+
To see available updates, navigate to a Craft project directory in your terminal and run this command:
3436

35-
```bash
37+
::: code
38+
```bash DDEV
39+
ddev craft update
40+
```
41+
```bash Generic
3642
php craft update
3743
```
44+
:::
45+
46+
You should see output like this:
47+
48+
```
49+
Fetching available updates ... done
50+
You’ve got two available updates:
3851
39-
![An example interaction with the `update` command.](./images/cli-update-info.png)
52+
- craft 5.4.8 => 5.4.9
53+
- commerce 5.2.1 => 5.2.2
54+
55+
Run craft update all or craft update <handle> to perform an update.
56+
```
4057

4158
To update everything all at once, run this command:
4259

43-
```bash
60+
::: code
61+
```bash DDEV
62+
ddev craft update all
63+
```
64+
```bash Generic
4465
php craft update all
4566
```
67+
:::
4668

4769
To apply a specific update, replace `all` with `craft` (to update Craft itself) or a plugin’s handle:
4870

49-
```bash
71+
::: code
72+
```bash DDEV
73+
ddev craft update commerce
74+
```
75+
```bash Generic
5076
php craft update commerce
5177
```
78+
:::
5279

53-
![An example interaction with the `update <handle>` command.](./images/cli-update-plugin.png)
80+
```
81+
Fetching available updates ... done
82+
Performing one update:
83+
84+
- commerce 5.2.1 => 5.2.2
85+
86+
Create database backup? (yes|no) [yes]:
87+
Backing up the database ... done
88+
Performing update with Composer ... done
89+
Applying new migrations ... done
90+
Update complete!
91+
```
5492

5593
You can pass multiple handles in at once:
5694

57-
```bash
95+
::: code
96+
```bash DDEV
97+
ddev craft update commerce element-api
98+
```
99+
```bash Generic
58100
php craft update commerce element-api
59101
```
102+
:::
60103

61104
Craft will install the latest available version(s), unless you append `:<version>` to the handle:
62105

63-
```bash
64-
php craft update element-api:2.7.0
106+
::: code
107+
```bash DDEV
108+
ddev craft update element-api:4.1.0
65109
```
110+
```bash Generic
111+
php craft update element-api:4.1.0
112+
```
113+
:::
66114

67115
After an update is performed from the CLI, Craft will apply any relevant migrations.
68116

@@ -84,7 +132,7 @@ Keep in mind that manually altering constraints _can_ lead to an irreconcilable
84132

85133
## Workflow
86134

87-
Every time you [deploy](./deploy.md) your project, you should run `composer install` and `craft up` to bring that environment’s database into agreement with your packages and their expected schema version.
135+
Every time you [deploy](./deploy.md) your project, you should run `composer install` and `craft up` to bring that environment’s dependencies and database into agreement with your packages and their expected schema version.
88136

89137
The same applies when working with teammates! Any time you pull new code into a project, running `composer install` will guarantee you are working with the same set of packages as your collaborators. If you’re one for automation, you can even have Craft apply migrations and [project config](system/project-config.md) at the same time by adding a special hook to the `scripts` key in `composer.json`:
90138

@@ -110,8 +158,14 @@ When you buy a Craft Pro or plugin license, you are entitled to use that version
110158

111159
## Upgrade Guides
112160

113-
Sometimes, there are significant changes to be aware of—even in minor versions. In these (rare) cases, we publish a guide in the [Knowledge Base](kb:development), and list it here.
161+
Each version of the Craft documentation contains an equivalent of the [Upgrading from Craft 4](upgrade.md) page, which covers the process of upgrading from one [major version](#major-versions) to the next.
114162

115-
The most common changes that fit this criteria are deprecations. Deprecation notices will be accompanied by instructions for updating your code to work with the new APIs. Any features that are subsequently removed in a major release will also be noted in the new version’s upgrade guide.
163+
Sometimes, there are significant changes to be aware of—even in minor or “point” releases. The most common changes that fit this criteria are deprecations. Deprecation notices will be accompanied by instructions for updating your code to work with the new APIs. Any features that are subsequently removed in a major release will also be noted in the new version’s upgrade guide.
116164

117165
Deprecation warnings will affect plugin developers more frequently than regular users—but it’s still a good idea to keep your eye on the **Deprecation Warnings** utility.
166+
167+
### Major Versions
168+
169+
For the smoothest upgrade experience, projects must be updated to the latest available _minor_ version preceding a _major_ version upgrade. We do not support “skipping” versions, so if your site is running Craft 3, you must first update to the latest 3.x version, then perform the 3.x &rarr; 4.x upgrade, then perform the 4.x &rarr; 5.x upgrade.
170+
171+
You should always upgrade to the latest release in a given major Craft version—for example, you can upgrade directly from 4.12.8 (or whatever the latest 4.x release is) to 5.4.9 (or whatever the latest 5.x release is).

docs/5.x/upgrade.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ description: Take a peek at what’s new in Craft 5.
55

66
# Upgrading from Craft 4
77

8-
The smoothest way to upgrade to Craft 5 is to start with a [fully-updated Craft 4 project](/4.x/updating.md). We recommend approaching the upgrade in three phases: [preparation](#preparing-for-the-upgrade), a [local upgrade](#performing-the-upgrade), and [rollout](#going-live) to live environments.
8+
The smoothest way to upgrade to Craft 5 is to make sure your live site is already running the [latest version of Craft 4](/4.x/updating.md). We recommend approaching the upgrade in three phases: [preparation](#preparing-for-the-upgrade), a [local upgrade](#performing-the-upgrade), and [rollout](#going-live) to live environments.
99

1010
<!-- more -->
1111

1212
## Preparing for the Upgrade
1313

1414
Let’s take a moment to audit and prepare your project.
1515

16-
- Your **live site** must be running the [latest version](repo:craftcms/cms/releases) of Craft 4;
16+
- Your **live site** must be running the [latest version](repo:craftcms/cms/releases) of Craft 4 (you cannot upgrade directly from Craft 3 to Craft 5);
1717
- The most recent Craft 4-compatible versions of all plugins are installed, and Craft 5-compatible versions are available;
1818
- Your project is free of deprecation warnings after thorough testing on the latest version of Craft 4;
1919
- All your environments meet Craft 5’s [minimum requirements](requirements.md) (the latest version of Craft 4 will run in any environment that meets Craft 5’s requirements, so it’s safe to update PHP and your database ahead of the 5.x upgrade):

0 commit comments

Comments
 (0)