Scenario 2: Restore a snapshot

Read: Restore a snapshot on Adobe Commerce on cloud infrastructure in our developer documentation.

NOTE
Creating a snapshot must be our very first step after accessing the Adobe Commerce on cloud infrastructure account and before applying major changes. It is a best practice and highly recommended.

Read: Create a snapshot in our developer documentation.

Scenario 3: No snapshot, build stable (SSH connection available)

This section shows how to reset an environment when you have not created a snapshot but can access the environment via SSH.

The steps are:

  1. Disable Configuration Management.
  2. Uninstall the Adobe Commerce software.
  3. Reset the git branch.

After performing these steps:

  • Your Adobe Commerce installation returns to its Vanilla state (database restored; deployment configuration removed; directories under var cleared).
  • Your git branch is reset to the desired state in the past.

Read the detailed steps below.

Step 0 (Prerequisite): Remove config.php to disable Configuration Management

We need to disable Configuration Management so that it does not automatically apply the previous configuration settings during deployment.

To disable Configuration Management, make sure that your /app/etc/ directory does not contain the config.php file.

To remove the configuration file, follow these steps:

  1. SSH to your environment.
  2. Remove the configuration file: rm app/etc/config.php

Read more about Configuration Management:

Step 1: Uninstall the Adobe Commerce software with setup:uninstall command

Uninstalling the Adobe Commerce software drops and restores the database, removes the deployment configuration, and clears directories under var.

Read: Uninstall the Adobe Commerce software in our developer documentation.

To uninstall the Adobe Commerce software, follow these steps:

  1. SSH to your environment.
  2. Execute setup:uninstall : bin/magento setup:uninstall
  3. Confirm uninstall.

The following message displays to confirm a successful uninstallation:

[SUCCESS]: Magento uninstallation complete.

This means we have reverted our Adobe Commerce installation (including DB) to its authentic (Vanilla) state.

Step 2: Reset the git branch

With git reset, we revert the code to the desired state in the past.

  1. Clone the environment to your local development environment. You may copy the command in the Cloud Console: copy_git_clone.png
  2. Access the commits history. Use --reverse to display history in reverse order for more convenience: git log --reverse
  3. Select the commit hash on which you’ve been good. To reset code to its authentic state (Vanilla), find the very first commit that created your branch (environment).
    alt text
  4. Apply hard git reset: git reset --h <commit_hash>
  5. Push changes to server: git push --force <origin> <branch>

After performing these steps, our git branch gets reset and the entire git changelog is clear. The last git push triggers the redeploy to apply all changes and re-install Adobe Commerce.