Managing Magento 2 backup via the command line
Every production environment needs a proper backup plan. By default, Magento 2 has a complete set of options to create and roll back backups.
When creating a backup, we can use one of the following options:
Option |
Meaning |
Backup file name |
---|---|---|
|
This creates a backup from the filesystem (excluding |
|
|
This creates a backup from the |
|
|
This creates a backup from the current database |
|
Tip
Besides the Magento backup options, it is always advisable to use an alternative backup solution connected to a backup storage.
Getting ready
When creating a backup, Magento will store it in the var/backups
directory. In this recipe, we will refer to the bin/magento setup:backup
and bin/magento setup:rollback
options.
How to do it...
For the purpose of this recipe, let's assume...