You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/5.x/update.md
+72-18Lines changed: 72 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1,68 +1,116 @@
1
1
# Running Updates
2
2
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).
4
4
5
5
<!-- more -->
6
6
7
7
## Using the Control Panel
8
8
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 <Journeypath="Utilities" /> in the global navigation:
10
10
11
11

12
12
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 <Journeypath="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).
14
14
15
15
This section displays updates for Craft CMS and installed plugins, where each version has its own collapsible panel detailing relevant changes.
16
16
17
17

18
18
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.
20
20
21
21
::: 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.
23
25
:::
24
26
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.
26
28
27
29
## Updating from the Terminal
28
30
29
31
### Craft CLI
30
32
31
33
The [`update` console command](reference/cli.md#update) can be used to update Craft and plugins.
32
34
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:
34
36
35
-
```bash
37
+
::: code
38
+
```bash DDEV
39
+
ddev craft update
40
+
```
41
+
```bash Generic
36
42
php craft update
37
43
```
44
+
:::
45
+
46
+
You should see output like this:
47
+
48
+
```
49
+
Fetching available updates ... done
50
+
You’ve got two available updates:
38
51
39
-

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
+
```
40
57
41
58
To update everything all at once, run this command:
42
59
43
-
```bash
60
+
::: code
61
+
```bash DDEV
62
+
ddev craft update all
63
+
```
64
+
```bash Generic
44
65
php craft update all
45
66
```
67
+
:::
46
68
47
69
To apply a specific update, replace `all` with `craft` (to update Craft itself) or a plugin’s handle:
48
70
49
-
```bash
71
+
::: code
72
+
```bash DDEV
73
+
ddev craft update commerce
74
+
```
75
+
```bash Generic
50
76
php craft update commerce
51
77
```
78
+
:::
52
79
53
-

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
+
```
54
92
55
93
You can pass multiple handles in at once:
56
94
57
-
```bash
95
+
::: code
96
+
```bash DDEV
97
+
ddev craft update commerce element-api
98
+
```
99
+
```bash Generic
58
100
php craft update commerce element-api
59
101
```
102
+
:::
60
103
61
104
Craft will install the latest available version(s), unless you append `:<version>` to the handle:
62
105
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
65
109
```
110
+
```bash Generic
111
+
php craft update element-api:4.1.0
112
+
```
113
+
:::
66
114
67
115
After an update is performed from the CLI, Craft will apply any relevant migrations.
68
116
@@ -84,7 +132,7 @@ Keep in mind that manually altering constraints _can_ lead to an irreconcilable
84
132
85
133
## Workflow
86
134
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.
88
136
89
137
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`:
90
138
@@ -110,8 +158,14 @@ When you buy a Craft Pro or plugin license, you are entitled to use that version
110
158
111
159
## Upgrade Guides
112
160
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.
114
162
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.
116
164
117
165
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 → 4.x upgrade, then perform the 4.x → 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).
Copy file name to clipboardExpand all lines: docs/5.x/upgrade.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,15 @@ description: Take a peek at what’s new in Craft 5.
5
5
6
6
# Upgrading from Craft 4
7
7
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.
9
9
10
10
<!-- more -->
11
11
12
12
## Preparing for the Upgrade
13
13
14
14
Let’s take a moment to audit and prepare your project.
15
15
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);
17
17
- The most recent Craft 4-compatible versions of all plugins are installed, and Craft 5-compatible versions are available;
18
18
- Your project is free of deprecation warnings after thorough testing on the latest version of Craft 4;
19
19
- 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