If you encounter issues in the Integration environment and do not have a valid snapshot, try restoring your environment using one of the following methods:
For help with stuck deployments, use the Adobe Commerce deployment troubleshooter in the Commerce Help Center.
Uninstalling the Commerce application returns your environment to an original state by restoring the database, removing the deployment configuration, and clearing the var/
subdirectories. This guidance also resets your git branch to an earlier stable state. If you do not have a recent snapshot, but you can access the remote environment using SSH, follow these steps to restore your environment:
Uninstalling the Adobe Commerce software drops and restores the database, removes the deployment configuration, and clears the var/
subdirectories. It is important to disable Configuration management so that it does not automatically apply the previous configuration settings during the next deployment. Make sure that your app/etc/
directory does not contain the config.php
file.
To uninstall the Adobe Commerce software:
On your local workstation, change to your project directory.
Use SSH to log in to the remote environment.
magento-cloud ssh
Remove the configuration file.
For Adobe Commerce 2.2 and later:
rm app/etc/config.php
For Adobe Commerce 2.1:
rm app/etc/config.local.php
Uninstall the Adobe Commerce application.
php bin/magento setup:uninstall -n
Confirm that Adobe Commerce was successfully uninstalled.
The following message displays to confirm a successful uninstallation:
[SUCCESS]: Magento uninstallation complete.
Clear the var/
subdirectories.
rm -rf var/*
Log out.
Optionally, it is a good practice to clean build caches.
magento-cloud project:clear-build-cache
Resetting your Git branch reverts the code to a stable state in the past.
To reset your branch:
On your local workstation, change to your project directory.
Review the Git commit history. Use --reverse
to display history in reverse chronological order:
git log --reverse
Choose a commit hash that represents the last known stable state of your code.
To reset your branch to its original initialized state, find the first commit that created your branch.
commit 398c8fd3a46534fc88d6de250c5d081d5be3c852
Author: Alice Username <alice@example.com>
Date: Wed Apr 13 16:16:13 2021 -0500
Init 2.4.4
Use the hard reset option to reset your branch.
git reset --h <commit-hash>
Push your changes to trigger a redeployment, which reinstalls Adobe Commerce.
git push --force <origin> <branch>
If you have attempted to uninstall Adobe Commerce and your deployment continues to fail, you can try to manually force a redeployment.
git commit --allow-empty -m "<message>" && git push <origin> <branch>
If you have attempted to uninstall Adobe Commerce and the command failed or could not complete, you might need to manually reset the database.
To reset the database:
On your local workstation, change to your project directory.
Use SSH to log in to the remote environment.
magento-cloud ssh
Connect to the database.
mysql -h database.internal
Drop the main
database.
drop database main;
Create an empty main
database.
create database main;
Delete the following configuration files.
config.php
config.php.bak
env.php
env.php.bak
Log out and trigger a redeployment.
magento-cloud environment:redeploy
The deployment process begins when you perform a merge, push, or synchronization of your environment, or when you trigger a manual redeployment, during which the Commerce application is in maintenance mode. For a Production environment, Adobe recommends completing this work during off-peak hours to avoid service disruptions.