Unfortunately, not every Adobe Commerce customer will be running the most current version of Adobe Commerce – so as an extension developer you may need to maintain your extension so that it supports several recent versions. This guide will help you manage your sandbox with multiple instances of Adobe Commerce cloud with varying versions, allowing you to troubleshoot potential issues as you maintain your Commerce extension.
The first version of Adobe Commerce cloud you get when obtaining a sandbox will be set-up on the latest Adobe Commerce build. If you want to install a lower version, you must branch from the main, and then downgrade the branch. There is currently no other way to get a downgraded Commerce Cloud project.
Branching from the master:
After Branching from the master project, you can then pull down (clone) the project to your local instance to make changes. Remember that cloud instances can only be modified by pulling down, making changes on a local copy, and then push back to the git branch, which forces a redeploy of the environment.
Where to find the clone command:
After pulling down your environment, there are 3 key files you have to change in order to downgrade Adobe Commerce. They are as follows:
Composer.json
.magento/services.yaml
.Magento.app.yaml
Note services.yaml is in the .magento directory, and that .magento/services.yaml and .magento.app.yaml are hidden directories (If you're looking at this using windows explorer you'll need to enable hidden items)
Start by opening and modifying your Composer.json file. Composer, being the dependency manager of Adobe Commerce, is where you will set the version of Adobe Commerce you are targeting.
Make sure that you change the “Require” portion, as the section where it says “version” is cosmetic (but do change that as well!). If you only change the version block, it will not update correctly. This is the only change you will need to do for this file.
Now that you have the right version, you will need to update the services. Please double check what dependencies and what version you’ll need here after changing your version:
https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html
For our example I used 2.3.3, so I will go to the 2.3.3 column and change the services accordingly. The three main services you’ll need to change on cloud is Elasticsearch (or open search depending on version), Mariadb/mysql, and your PHP version.
IMPORTANT NOTICE:
Renaming the service is required for downgrading a version. See how redis changed to redis2. For upgrading environments you only have to change the version of the service and not the name.
The last thing you’ll need to do is update the relationships in your magento.app.yaml file to your newly renamed services. (For this case, redis2/elasticsearch2)
Your magento.app.yaml will look like so:
After all of these changes are made in those files, make a git commit to your git branch and this will force a redeploy of your instance. If any errors occur, please see the following guide on what to change:
https://devdocs.magento.com/cloud/reference/ece-tools-error-reference.html