Backups and restore in Magento Commerce Cloud can be confusing, especially with so many rules for each environment. This guide helps you understand when, where, and how to create and restore snapshots, so you can avoid data loss and keep your store secure.

We also learn about the types of backups in Cloud Commerce in detail.

These snapshots include:

  • Code
  • Database
  • Media files

Please note that the backup feature is not available in the Pro environments, as this environment comes with regular backups for disaster recovery purposes by default.

The Cloud Console always shows “No backup” in Staging and Production environments. You can only take backups from the Integration environment. Select Backup from the ellipsis dropdown menu.

Integration (Development) environment

  • Your Integration environment is not backed up automatically, but you may manually create snapshots.
  • These manual snapshots can be created for Integration environments on non-live stores only.
  • You may have multiple snapshots that have been triggered manually.

Here are the three types of backups in Magneto Cloud Commerce 

  1. Automatic snapshots: Magento Commerce Cloud automatically creates backups for each environment every 6 hours for staging and production. These snapshots are stored in external storage on WAS.
  2. Manual Snapshots: Sometimes, we may need to create a manual backup for any environment. Multiple CLI commands are useful to create a manual backup specific to code, database, or media files, or we can get all of this in one command to back up.

Here is the command provided by CLI:

To create a backup of any Starter environment using the Cloud Console:

  1. Log in to the Cloud Console.
  2. Select an environment from the project navigation bar. The environment must be active and not as a staging or production environment.
  3. In the Backups view, click Backup. This option is not available for a Pro environment
  4. So, if you select the development environment, you will see the option for backups 

To create a backup of an integration environment using the Cloud Console:

  1. Log in to the Cloud Console.
  2. Select an integration/development environment from the project navigation bar. The environment must be active.
  3. Select the Backup option in the top-right menu. This option is available for both Starter and Pro environments.
  4. Click the Yes button.

To create a snapshot using the magento-cloud CLI:

  1. On your local workstation, change to your project directory.
  2. Check out the environment branch to snapshot.
  3. Create the snapshot using the following command

magento-cloud snapshot:create --live

You can use the magento-cloud backup shortcut command. The –live option keeps the environment running to avoid downtime. For a full list of options, enter magento-cloud snapshot:create –help.

Below are a few available commands, along with details on what each one is used for.

CommandDescription / Usage
magento-cloud snapshot:create –helpThis command brings you the full list of options / Help command.
magento-cloud snapshot:createThis command creates a snapshot of the current environment.
magento-cloud snapshotsThis command lists & returns information about the snapshot status.
magento-cloud snapshot:listThis command lists all available snapshots.
magento-cloud snapshot:restore <id>This command restores the snapshot by giving the Snapshot ID.
magento-cloud snapshot:delete <id>This command is used to delete an environment snapshot
magento-cloud snapshot:get <id>You can use this command to view an environment snapshot (get information), if <id> is not provided, it fetches the recent one

3. Downloadable Backups

We can download the snapshots, for example, for use in a local development environment or to store the snapshot externally.

Restore a manual backup

You must have Admin access to the environment to restore a manual backup. Manual backups are stored for up to seven days. Restoring a backup does not change the code of the current Git branch. This method of restoring a backup does not apply to Pro staging or production environments; it is only applicable to development environments.

To restore a backup using the Cloud Console:

  1. Log in to the Cloud Console.
  2. Select an environment from the project navigation bar.
  3. In the Backups view, choose a backup from the Stored list. The backup feature does not apply to the Pro environments.
  4. In the (more) menu, click Restore.
  5. Review the Restore from backup information and click Yes, restore.

To restore a snapshot using the Cloud CLI:

  1. On your local workstation, change to your project directory.
  2. Check out the environment branch to restore.
  3. List all available snapshots.

magento-cloud snapshot:list

The list returns information about the available snapshots:


Snapshots on the project (project-id), environment develop-branch (type: development):
+---------------------------+----------------------+------------+
| Created                   | Snapshot ID          | Restorable |
+---------------------------+----------------------+------------+
| 2023-03-08T17:07:01+00:00 | my-snapshot          | true       |
+---------------------------+----------------------+------------+

Restore a snapshot using the snapshot ID from the list.

magento-cloud snapshot:restore <snapshot-id>

Points to remember 

  • You can perform a manual backup using the Web Interface or Magento CLI.
  • You have up to 7 days to restore a backed-up snapshot from the date of the backup.
  • Snapshot options are available for all Starter environments and Pro Integration environments.
  • You cannot create snapshots of Pro Staging or Production environments (these environments have automatic backups).
  • You cannot snapshot Pro Staging or Production environments (It provides automatic backup)
  • Automatic snapshots are created regardless of the live state of your site, even for sites that haven’t been launched yet.
  • Automatic backups are not publicly accessible, as they are stored in a separate system.
  • You can submit a Magento Commerce Support ticket to request a special backup or to restore from a specific backup. Be sure to include the date, time, and timezone in the ticket.
    Note: Support does not perform the rollback or database restoration for you. They will retrieve the snapshot, but you must restore the database yourself.

Conclusion

Magento Commerce Cloud provides a flexible and secure backup system with both automatic and manual snapshot options. While automatic backups are available for staging and production environments, manual snapshots are essential for development environments, offering control over your code, database, and media files. By understanding when and how to create and restore backups, you can effectively manage your data and ensure the security and integrity of your Magento store. 

Are you looking for expert help for Magento commerce development? Our team is ready to take it up and help you. Book your free consultation right away!

Picture of Muhammed Salim

Muhammed Salim

Muhammed Salim, a seasoned Senior Software Engineer at Klizer (DCKAP) and a certified Adobe Commerce Developer, brings an extensive background spanning over 6 years in the field, along with a wealth of experience. His commitment to continuous learning allows him to stay at the forefront of industry advancements, ensuring that he remains well-versed in the latest technologies and best practices within the Adobe Commerce ecosystem. Dedicated to creating exceptional solutions, Muhammed's passion for innovation drives him to exceed expectations and push the boundaries in Adobe Commerce development.

Get in Touch

Scroll to Top