Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 7a32dc7

Browse files
NadiyaSmeker12
andauthored
MCLOUD-6215: Add examples in devdocs how to downgrade service versions (#7657)
* MCLOUD-6215: Add examples in devdocs how to downgrade service versions * MCLOUD-6215: Add examples in devdocs how to downgrade service versions * Update src/cloud/project/project-conf-files_services.md Co-authored-by: Margaret Eker <[email protected]> * Revisions to new change version topic (#7660) * Revisions to new change version topic - Added note about support ticket requirement on Pro Staging and Prod - Added note about checking ES composer package compatiblity on ES version change - Updates for DevDocs styles and conventions - Editorial updates * Update src/cloud/project/project-conf-files_services.md * Update src/cloud/project/project-conf-files_services.md Co-authored-by: Margaret Eker <[email protected]> * Apply suggestions from code review * Update src/cloud/project/project-conf-files_services.md Co-authored-by: Margaret Eker <[email protected]> * Update src/cloud/project/project-conf-files_services.md Co-authored-by: Margaret Eker <[email protected]> * Update src/cloud/project/project-conf-files_services.md Co-authored-by: Margaret Eker <[email protected]> * Update src/cloud/project/project-conf-files_services.md Co-authored-by: Margaret Eker <[email protected]> * Update src/cloud/project/project-conf-files_services.md Co-authored-by: Margaret Eker <[email protected]> * Update src/cloud/project/project-conf-files_services.md Co-authored-by: Margaret Eker <[email protected]> * Update src/cloud/project/project-conf-files_services.md * Update src/cloud/project/project-conf-files_services.md Co-authored-by: Margaret Eker <[email protected]> Co-authored-by: Margaret Eker <[email protected]>
1 parent 2121bd7 commit 7a32dc7

File tree

1 file changed

+151
-8
lines changed

1 file changed

+151
-8
lines changed

src/cloud/project/project-conf-files_services.md

Lines changed: 151 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ functional_areas:
88

99
The `services.yaml` file defines the services supported and used by {{site.data.var.ece}}, such as MySQL, Redis, and ElasticSearch. You do not need to subscribe to external service providers. This file is in the `.magento` directory of your project.
1010

11-
The deploy script uses the configuration files in the `.magento` directory to provision the environment with the configured services. A service becomes available to your application if it is included in the `relationships` property of the `.magento.app.yaml` file. The `services.yaml` file contains the _type_ and _disk_ values. Service type defines the service _name_ and _version_. Changing a service configuration causes a deployment to provision the environment with the updated services.
11+
The deploy script uses the configuration files in the `.magento` directory to provision the environment with the configured services. A service becomes available to your application if it is included in the [`relationships`]({{ site.baseurl }}/cloud/project/project-conf-files_magento-app.html#relationships) property of the `.magento.app.yaml` file. The `services.yaml` file contains the _type_ and _disk_ values. Service type defines the service _name_ and _version_. Changing a service configuration causes a deployment to provision the environment with the updated services.
1212

1313
This affects the following environments:
1414

@@ -43,19 +43,22 @@ elasticsearch:
4343
4444
## Service values
4545
46-
You must provide the _type_ values: service _name_ and _version_. If the service uses persistent storage, then you must provide a _disk_ value. Use the following format:
46+
You must provide the <service-id> and service type configuration `type: <name>:<version>`.
47+
If the service uses persistent storage, then you must provide a _disk_ value.
48+
49+
Use the following format:
4750

4851
```yaml
49-
<name>:
52+
<service-id>:
5053
type: <name>:<version>
5154
disk: <value-MB>
5255
```
5356

54-
### `name`
57+
### `service-id`
5558

56-
The `name` value identifies the service in the project. You can only use lower case alphanumeric characters: `a` to `z` and `0` to `9`, such as `redis`.
59+
The `service-id` value identifies the service in the project. You can only use lower case alphanumeric characters: `a` to `z` and `0` to `9`, such as `redis`.
5760

58-
This _name_ value is used in the `relationships` property of the `.magento.app.yaml` configuration file:
61+
This _service-id_ value is used in the [`relationships`]({{ site.baseurl }}/cloud/project/project-conf-files_magento-app.html#relationships) property of the `.magento.app.yaml` configuration file:
5962

6063
```yaml
6164
relationships:
@@ -86,6 +89,8 @@ mysql:
8689
type: mysql:10.2
8790
```
8891

92+
Use [`Service versions`](#service-versions) table to see supported services and their versions
93+
8994
### `disk`
9095

9196
The `disk` value specifies the size of the persistent disk storage (in MB) to allocate to the service. Services that use persistent storage, such as MySQL, must provide a disk value. Services that use memory instead of persistent storage, such as Redis, do not require a disk value.
@@ -146,10 +151,10 @@ To verify relationships in remote environments:
146151
echo $MAGENTO_CLOUD_RELATIONSHIPS | base64 -d | json_pp
147152
```
148153

149-
or
154+
or, use the following {{ site.data.var.ct }} CLI command to view relationships:
150155

151156
```bash
152-
php -r 'print_r(json_decode(base64_decode($_ENV["MAGENTO_CLOUD_RELATIONSHIPS"])));'
157+
php ./vendor/bin/ece-tools env:config:show services
153158
```
154159

155160
1. Confirm the `service` and `type` from the response. The response provides connection information, such as the IP address and port number and any required username and password credentials.
@@ -182,6 +187,144 @@ During the deployment process, {{site.data.var.ct}} checks installed service ver
182187

183188
To maintain Magento store security, update installed software versions before they reach EOL.
184189

190+
## Change service version
191+
192+
You can upgrade the installed service version for compatibility with the Magento version deployed in your Cloud environment.
193+
194+
You cannot downgrade the service version for an installed service directly. However, you can create a new service with the required version. See [Downgrade service version](#downgrade-version).
195+
196+
Use the [Service versions](#service-versions) table to check service version compatibility by Magento version. Note that some service versions supported by {{ site.data.var.ee }} are not supported on {{ site.data.var.ece }}.
197+
198+
{:.bs-callout-warning}
199+
You must submit a support ticket to change the service configuration on Pro Production and Staging environments.
200+
201+
{:.bs-callout-info}
202+
If you change the Elasticsearch service version, check the Elasticsearch composer package for compatibility with the new version. See [Elasticsearch software compatibility]({{ site.baseurl}}/cloud/project/project-conf-files_services-elastic.html#elasticsearch-software-compatibility).
203+
204+
### Upgrade installed service version
205+
206+
You can upgrade the installed service version by updating the service configuration in the `services.yaml` file.
207+
208+
1. Change the [`type`](#type) value for the service in the `.magento/services.yaml` file:
209+
210+
> Original service definition
211+
212+
```yaml
213+
mysql:
214+
type: mysql:10.2
215+
disk: 2048
216+
```
217+
218+
> Updated service definition
219+
220+
```yaml
221+
mysql:
222+
type: mysql:10.3
223+
disk: 2048
224+
```
225+
226+
1. Add, commit, and push your code changes.
227+
228+
```bash
229+
git add -A
230+
```
231+
232+
```bash
233+
git commit -m "Upgrade MySQL from MariaDB 10.2 to 10.3."
234+
```
235+
236+
```bash
237+
git push origin <branch-name>
238+
```
239+
240+
### Downgrade version
241+
242+
You cannot downgrade an installed service directly. You have two options:
243+
244+
- Rename an existing service with the new version, which removes the existing service and data, and adds a new one.
245+
246+
- Create a new service and save the data from the existing service.
247+
248+
When you change the service version, you must update the service configuration in the `services.yaml` file, and update the relationships in the `.magento.app.yaml` file.
249+
250+
{:.procedure}
251+
To downgrade a service version by renaming an existing service:
252+
253+
1. Rename the existing service in the `.magento/services.yaml` file and change the version.
254+
255+
{:.bs-callout-warning}
256+
Renaming an existing service replaces it and deletes all data. If you need to retain the data, create a new service instead of renaming the existing one.
257+
258+
For example, to downgrade the MariaDB version for the _mysql_ service from version 10.3 to 10.2, change the existing _service-id_ and _type_ configuration.
259+
260+
> Original `services.yaml` definition
261+
262+
```yaml
263+
mysql:
264+
type: mysql:10.3
265+
disk: 2048
266+
```
267+
268+
> New `services.yaml` definition
269+
270+
```yaml
271+
mysql2:
272+
type: mysql:10.2
273+
disk: 2048
274+
```
275+
276+
1. Update the relationships in the `.magento.app.yaml` file.
277+
278+
> Original `.magento.app.yaml` configuration
279+
280+
```yaml
281+
relationships:
282+
database: "mysql:mysql"
283+
```
284+
285+
> Updated `.magento.app.yaml` configuration
286+
287+
```yaml
288+
relationships:
289+
database: "mysql2:mysql"
290+
```
291+
292+
1. Add, commit, and push your code changes.
293+
294+
{:.procedure}
295+
To downgrade a service by creating an additional service:
296+
297+
1. Add an additional service definition to the `services.yaml` file for your project with the downgraded version specification. See _mysql2_ in the following example:
298+
299+
> services.yaml
300+
301+
```yaml
302+
mysql:
303+
type: mysql:10.3
304+
disk: 2048
305+
mysql2:
306+
type: mysql:10.2
307+
disk: 2048
308+
```
309+
310+
1. Change the relationships configuration in the `.magento.app.yaml` file to use the new service.
311+
312+
> Original `.magento.app.yaml` configuration
313+
314+
```yaml
315+
relationships:
316+
database: "mysql:mysql"
317+
```
318+
319+
> New `.magento.app.yaml` configuration
320+
321+
```yaml
322+
relationships:
323+
database: "mysql2:mysql"
324+
```
325+
326+
1. Add, commit, and push your code changes.
327+
185328
<!--Custom column widths for service version table-->
186329
<style>
187330
table.error-table td:nth-child(1) {

0 commit comments

Comments
 (0)