Magento 2 : How to Backup Db, Media, Code command line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#If the Magento backup functionality does not start or displays the following message, you need to enable the feature prior to backing up. | |
# - Backup functionality is disabled. | |
# - Backup functionality is currently disabled. Please use other means for backups. | |
$ php bin/magento config:set system/backup/functionality_enabled 1 | |
$ php bin/magento setup:backup --code | |
#Enabling maintenance mode | |
#Code backup is starting... | |
#Code backup filename: 1617533283_filesystem_code.tgz (The archive can be uncompressed with 7-Zip on Windows systems) | |
#Code backup path: /Users/sudhanshubajaj/Projects/development/m23-ee-latest/var/backups/1617533283_filesystem_code.tgz | |
#[SUCCESS]: Code backup completed successfully. | |
#Disabling maintenance mode | |
$ php bin/magento info:backups:list | |
#Showing backup files in /Users/sudhanshubajaj/Projects/development/m23-ee-latest/var/backups. | |
#+--------------------------------+-------------+ | |
#| Backup Filename | Backup Type | | |
#+--------------------------------+-------------+ | |
#| 1617533283_filesystem_code.tgz | code | | |
#+--------------------------------+-------------+ | |
$ php bin/magento setup:backup --db | |
#Enabling maintenance mode | |
#DB backup is starting... | |
#DB backup filename: 1617533813_db.sql | |
#DB backup path: /Users/sudhanshubajaj/Projects/development/m23-ee-latest/var/backups/1617533813_db.sql | |
#[SUCCESS]: DB backup completed successfully. | |
#Disabling maintenance mode | |
$ php bin/magento info:backups:list | |
#Showing backup files in /Users/sudhanshubajaj/Projects/development/m23-ee-latest/var/backups. | |
#+--------------------------------+-------------+ | |
#| Backup Filename | Backup Type | | |
#+--------------------------------+-------------+ | |
#| 1617533283_filesystem_code.tgz | code | | |
#| 1617533813_db.sql | db | | |
#+--------------------------------+-------------+ | |
$ php bin/magento setup:backup --media | |
#Enabling maintenance mode | |
#Media backup is starting... | |
#Media backup filename: 1617534478_filesystem_media.tgz (The archive can be uncompressed with 7-Zip on Windows systems) | |
#Media backup path: /Users/sudhanshubajaj/Documents/Projects/development/m23-ee-latest/var/backups/1617534478_filesystem_media.tgz | |
#[SUCCESS]: Media backup completed successfully. | |
#Disabling maintenance mode | |
$ php bin/magento info:backups:list | |
#Showing backup files in /Users/sudhanshubajaj/Documents/Projects/development/m23-ee-latest/var/backups. | |
#+---------------------------------+-------------+ | |
#| Backup Filename | Backup Type | | |
#+---------------------------------+-------------+ | |
#| 1617533283_filesystem_code.tgz | code | | |
#| 1617533813_db.sql | db | | |
#| 1617534478_filesystem_media.tgz | media | | |
#+---------------------------------+-------------+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment