Magento 2 backup via the Command line
Magento 2 backup via the Admin Panel
Rolling back to a Magento 2 backup via the Command line
A Magento 2 system backup is the right way to save your online business harmless. Do you know the backup rule of three?
Here it is:
The rule is popular among all the scrupulous admin users. In case your online business is based on Magento 2, get around to backup the file system, media and Magento 2 backup of the database at least to be able to fulfill it once everything went wrong. You can complete a backup in Magento 2 in three ways: via the command line, the admin panel, and manually. Here you will find them all considered separately.
The way allows for backing up:
All the backups are saved in the var/backups directory and can be recovered at any time by using the magento setup:rollback command.
First off, you need to switch to the Magento file system owner. Then use the backup command. The magento setup:backup [--code] [--media] [--db] command includes the next tasks: switches a store into maintenance mode; database, media, system file backups; switches off the maintenance mode. E.g.: the file system and database backup: magento setup:backup --code --db.
The option includes backing up:
In this case, the Magento 2 backups can be restored from the same directory but via the Admin Panel.
Firstly, login to your Admin Panel and go to System> Tools> Backups:
It is used to disable bootstrapping, e.g.: maintaining, upgrading, reconfiguring a website.
!If you run a small e-commerce website, you can avoid using the mode for not to lose potential customers!
The thing is that when the mode is switched on a user sees a default Magento 2 window saying the website is currently inaccessible. When switching off or disabling the mode a customer can use the website, but the page load speed can be significantly reduced.
The type is considered to be one of the most reliable and safe. In the case, you can export all the needed files manually to your local computer.
For Magento 2 Installation backing up you will need to create the files backup and export the database. Your website can be placed in a heap of different directories. One of the multiple examples is presented below.
To create a MySQL database backup used on your Magento 2 website:
To roll back to the store backup you’ve made previously you need to remember the filename of the backup, which is to be restored.
Then you’ll see one of the two messages:
or
Seeking for plan B - install our Admin Actions Log. Log all backend activities to automatically and timely identify and stop suspicious activities.
Login and Registration Form