{"id":1997,"date":"2021-06-03T11:12:26","date_gmt":"2021-06-03T11:12:26","guid":{"rendered":"https:\/\/ccbill.com\/kb\/?p=1997"},"modified":"2023-03-06T12:09:52","modified_gmt":"2023-03-06T12:09:52","slug":"magento-backup-and-restore","status":"publish","type":"post","link":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore","title":{"rendered":"Magento Backup and Restore Tutorial"},"content":{"rendered":"\n<p class=\"h3\">Introduction<\/p>\n\n\n\n<p>Merchants know how much hard work and creativity it takes to build and run a successful <a href=\"https:\/\/ccbill.com\/blog\/ecommerce-store\" target=\"_blank\" rel=\"noreferrer noopener\">ecommerce store<\/a>. A technical failure or <a rel=\"noreferrer noopener\" href=\"https:\/\/phoenixnap.com\/blog\/cyber-security-attack-types\" target=\"_blank\">cyber-attack<\/a> can quickly undermine the long hours spent on backend development and storefront design.<\/p>\n\n\n\n<p>Regular backups enable merchants to maintain reliable long-term records and are an essential <a href=\"https:\/\/ccbill.com\/kb\/ecommerce-security\" target=\"_blank\" rel=\"noreferrer noopener\">ecommerce security practice<\/a>.<\/p>\n\n\n\n<p><strong>Find out how to backup and restore your Magento 2 store<\/strong> and prevent a devastating loss of data and reputation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"800\" height=\"400\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial.png\" alt=\"A merchant that wants to back up a Magento store.\" class=\"wp-image-1999\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial-300x150.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial-768x384.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Magento 2 Backup Methods<\/h2>\n\n\n\n<p>The built-in backup system in Magento 2 has been deprecated as of versions <strong>2.1.16<\/strong>, <strong>2.2.7<\/strong>, and <strong>2.3.0<\/strong>. Even though the backup feature is disabled by default, it is still possible to create backups using the Magento Admin or the command line.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-vivid-cyan-blue-color has-css-opacity has-vivid-cyan-blue-background-color has-background is-style-wide\"\/>\n\n\n\n<p><strong>Note:<\/strong> If you are still using Magento 1, find out how to<strong> <\/strong>plan and complete a<strong> <\/strong><a href=\"https:\/\/ccbill.com\/kb\/magento-migration\" target=\"_blank\" rel=\"noreferrer noopener\">migration from Magento 1 to Magento 2<\/a><strong>.<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-vivid-cyan-blue-color has-css-opacity has-vivid-cyan-blue-background-color has-background is-style-wide\"\/>\n\n\n\n<p>Future Magento 2 versions are likely to discontinue and eliminate the backup feature. Performing manual backups or using a third-party system or extension is going to become the primary method for backing up a Magento store.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Back Up Using Admin Panel<\/h3>\n\n\n\n<p>To backup system settings, store media, and <a href=\"https:\/\/ccbill.com\/kb\/magento-database-type\" target=\"_blank\" rel=\"noreferrer noopener\">databases in Magento 2<\/a>:<\/p>\n\n\n\n<p>1. Access the Magento Admin.<\/p>\n\n\n\n<p>2. Open the <strong>Stores<\/strong> menu. <\/p>\n\n\n\n<p>3. Select <strong>Configuration<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"800\" height=\"438\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/store-configuration-backup-magento.png\" alt=\"Enable Bacups in the Magento Configuration menu.\" class=\"wp-image-2007\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/store-configuration-backup-magento.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/store-configuration-backup-magento-300x164.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/store-configuration-backup-magento-768x420.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>4. Open the <em>Advanced <\/em>drop-down and click <strong>Admin<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/04\/advanced-admin-change-url-magento.png\" alt=\"Open Advanced option in Magento Admin.\" class=\"wp-image-1768\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/04\/advanced-admin-change-url-magento.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/04\/advanced-admin-change-url-magento-300x169.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/04\/advanced-admin-change-url-magento-768x432.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure><\/div>\n\n\n<p>4. Expand the <strong>Advanced<\/strong> dropdown.<\/p>\n\n\n\n<p>5. Click <strong>System<\/strong>. <\/p>\n\n\n\n<p>6. Open <strong>Backup Settings<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"800\" height=\"401\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/backup-settings-magento-admin.png\" alt=\"Access Backup Settings in Magento Admin.\" class=\"wp-image-2011\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/backup-settings-magento-admin.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/backup-settings-magento-admin-300x150.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/backup-settings-magento-admin-768x385.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>7. Set the <em>Enable Backup<\/em> option to <strong>Yes<\/strong>.<\/p>\n\n\n\n<p>8. (Optional) Use the <em>Enable Scheduled Backup<\/em> section to define the parameters for regular and automated backups. <\/p>\n\n\n\n<p>9. Click <strong>Save Config<\/strong> to apply the settings.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"800\" height=\"428\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/enable-backups-magento-admin.png\" alt=\"Enable and schedule backups in the Magento admin.\" class=\"wp-image-2013\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/enable-backups-magento-admin.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/enable-backups-magento-admin-300x161.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/enable-backups-magento-admin-768x411.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure><\/div>\n\n\n<p>10. Navigate to System.<\/p>\n\n\n\n<p>11. Click <strong>Backups<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"800\" height=\"472\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/backup-magento-admin-panel.png\" alt=\"Access the Backups menu in the Magetno Admin.\" class=\"wp-image-2010\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/backup-magento-admin-panel.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/backup-magento-admin-panel-300x177.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/backup-magento-admin-panel-768x453.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure><\/div>\n\n\n<p>12. Select the type of backup to create. The available options include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>System Backup<\/strong> - Create a backup of the file system and database, with the option to include the media directory.<\/li>\n\n\n\n<li><strong>Database and Media Backup<\/strong> - Make a backup of the database and the media directory.<\/li>\n\n\n\n<li><strong>Database Backup<\/strong> -&nbsp; Backup the entire database.<\/li>\n<\/ul>\n\n\n\n<p>The <em>Backups<\/em> menu contains a searchable list of existing backups. The list is invaluable when <a href=\"https:\/\/ccbill.com\/kb\/update-magento-to-latest-version\" target=\"_blank\" rel=\"noreferrer noopener\">updating Magento to a newer version.<\/a><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"799\" height=\"276\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/system-database-media-backup-magento-admin.png\" alt=\"Select the type of backup in the Magetno Admin.\" class=\"wp-image-2008\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/system-database-media-backup-magento-admin.png 799w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/system-database-media-backup-magento-admin-300x104.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/system-database-media-backup-magento-admin-768x265.png 768w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><\/figure><\/div>\n\n\n<p>13. Enter a <strong>Backup Name<\/strong>.<\/p>\n\n\n\n<p>14. Check the box to put the store in <em>Maintenance<\/em> mode during the backup process. The store\u2019s status is going to return to the <em>Production<\/em> mode automatically once the backup is complete. <\/p>\n\n\n\n<p>15. Click <strong>Ok<\/strong> to start the backup.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"800\" height=\"262\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/start-backup-magento-admin.png\" alt=\"Start the backup process in the Magetno Admin.\" class=\"wp-image-2006\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/start-backup-magento-admin.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/start-backup-magento-admin-300x98.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/start-backup-magento-admin-768x252.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure><\/div>\n\n\n<p>After the process is complete, review the list on the <em>Backups<\/em> page to confirm if the backup file is available.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Back Up Via Command Line<\/h3>\n\n\n\n<p>To create a backup from the command line, access the store's root directory and enable the Magento backup feature:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento config:set system\/backup\/functionality_enabled 1<\/code><\/pre>\n\n\n\n<p>The system confirms that the backup feature is active.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"800\" height=\"69\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/enable-backups-magento-command-line.png\" alt=\"Enable Magento backups from the command line.\" class=\"wp-image-2014\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/enable-backups-magento-command-line.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/enable-backups-magento-command-line-300x26.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/enable-backups-magento-command-line-768x66.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>The built-in backup system allows users to create 3 types of backups.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Back Up Database<\/h4>\n\n\n\n<p>Access the Magento root directory and back up the Magento database:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento setup:backup --db<\/code><\/pre>\n\n\n\n<p>The output contains the backup file\u2019s full path and filename.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"800\" height=\"142\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/backup-filename-path-magento-command-line.png\" alt=\"Magetno Database backup command.\" class=\"wp-image-2009\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/backup-filename-path-magento-command-line.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/backup-filename-path-magento-command-line-300x53.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/backup-filename-path-magento-command-line-768x136.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>The <em>Maintenance<\/em> mode is enabled at the start of the process and reverts to the <em>Production<\/em> mode once the backup is complete.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Back Up Media Files<\/h4>\n\n\n\n<p>Back up the <em>pub\/media<\/em> directory using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento setup:backup --media<\/code><\/pre>\n\n\n\n<p>By default, media backup files are stored as compressed archives in the <em>\/var\/backups\/timestamp_filesystem_media.tgz <\/em>directory.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Back Up File System<\/h4>\n\n\n\n<p>Use the following command to back up the Magento file system:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento setup:backup --code<\/code><\/pre>\n\n\n\n<p>The command does not back up the content of the <em>pub\/static<\/em> and <em>var<\/em> directories. File system backups are stored as compressed <em>timestamp_filesystem.tgz<\/em> files in the <em>var\/backups\/<\/em> directory.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Back Up Manually<\/h3>\n\n\n\n<p>To manually back up files from the Magento server:<\/p>\n\n\n\n<p>1. Access the server using <strong>cPanel <\/strong>or a preferred <strong>FTP Client<\/strong>.<\/p>\n\n\n\n<p>2. Locate the <strong>public_html<\/strong> directory and download the website's files locally. <\/p>\n\n\n\n<p>3. Select <strong>phpMyAdmin<\/strong> in the <em>Databases<\/em> menu.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"801\" height=\"388\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/phpmyadmin-cpanel-magento-backup.png\" alt=\"Backup Magento database using cPanel.\" class=\"wp-image-2000\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/phpmyadmin-cpanel-magento-backup.png 801w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/phpmyadmin-cpanel-magento-backup-300x145.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/phpmyadmin-cpanel-magento-backup-768x372.png 768w\" sizes=\"(max-width: 801px) 100vw, 801px\" \/><\/figure>\n\n\n\n<p>4. Access the Magento database and click <strong>Export<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"800\" height=\"289\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/export-magento-database-phpmyadmin.png\" alt=\"Export Magetno database using phpMyAdmin.\" class=\"wp-image-1998\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/export-magento-database-phpmyadmin.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/export-magento-database-phpmyadmin-300x108.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/export-magento-database-phpmyadmin-768x277.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure><\/div>\n\n\n<p>5. Choose the <strong>Quick<\/strong> <em>Export method<\/em>.<\/p>\n\n\n\n<p>6. Select the format of the file, for example, <strong>SQL.<\/strong> <\/p>\n\n\n\n<p>7. Click <strong>Go <\/strong>to export the SQL file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"800\" height=\"276\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/export-magento-database-format.png\" alt=\"Export SQL file to backup Magento database.\" class=\"wp-image-2015\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/export-magento-database-format.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/export-magento-database-format-300x104.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/export-magento-database-format-768x265.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>Create several backup copies and securely store the files in multiple locations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Magento 2 Restore Backup (Rollback)<\/h2>\n\n\n\n<p>A backup enables merchants to return their store to a previously saved state. The rollback process needs to be carried out efficiently, without excessive downtime and minimal data loss.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Restore via Admin Panel<\/h3>\n\n\n\n<p>To roll back the Magento store using the Admin panel:<\/p>\n\n\n\n<p>1. Access the Magento Admin.<\/p>\n\n\n\n<p>2. Open the <strong>System <\/strong>menu.<\/p>\n\n\n\n<p>3. Select <strong>Backups<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"799\" height=\"426\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/roll-back-magento-backup-admin.png\" alt=\"Access Backups menu to roll back Magetno backup.\" class=\"wp-image-2003\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/roll-back-magento-backup-admin.png 799w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/roll-back-magento-backup-admin-300x160.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/roll-back-magento-backup-admin-768x409.png 768w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><\/figure>\n\n\n\n<p>4. Find the backup on the list and click the corresponding <strong>Rollback <\/strong>option.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/rollback-magetno-admin.png\" alt=\"The Rollback option in the Magetno Admin.\" class=\"wp-image-2004\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/rollback-magetno-admin.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/rollback-magetno-admin-300x113.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/rollback-magetno-admin-768x288.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure><\/div>\n\n\n<p>5. A system warning explains that all data created after the backup is going to be erased. Click <strong>Ok<\/strong> to proceed.<\/p>\n\n\n\n<p>6. Enter the Magento <strong>User Password.<\/strong><\/p>\n\n\n\n<p>7. Check the box to enable the <em>Maintenance<\/em> mode during the rollback. <\/p>\n\n\n\n<p>8. Click <strong>Ok<\/strong> to roll back the Magento store.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"800\" height=\"306\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/roll-back-magento.png\" alt=\"Enter User Password to roll back Magento backup.\" class=\"wp-image-2002\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/roll-back-magento.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/roll-back-magento-300x115.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/roll-back-magento-768x294.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure><\/div>\n\n\n<p>The time the system takes to complete the process depends on the backup file's size.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Restore via Command Line<\/h3>\n\n\n\n<p>To restore a backup file using the command line: <\/p>\n\n\n\n<p>1. Access the Magento root directory and retrieve a list of existing backups:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento info:backups:list<\/code><\/pre>\n\n\n\n<p>The list displays the backup file name and type.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"800\" height=\"139\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/show-backup-file-name-magento.png\" alt=\"Diplay list of available Magetno backups in terminal.\" class=\"wp-image-2005\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/show-backup-file-name-magento.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/show-backup-file-name-magento-300x52.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/show-backup-file-name-magento-768x133.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure><\/div>\n\n\n<p>2. The command to roll back to a specific backup file depends on the backup type. <\/p>\n\n\n\n<p>To restore file system backups:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento setup:rollback -c filename<\/code><\/pre>\n\n\n\n<p>To restore media file backups:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento setup:rollback -m filename<\/code><\/pre>\n\n\n\n<p>To restore database backups:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento setup:rollback -d filename<\/code><\/pre>\n\n\n\n<p>For example, the following command rolls back the existing database backup:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento setup:rollback -d 1622558078_db.sql<\/code><\/pre>\n\n\n\n<p>Enter <strong>y <\/strong>to proceed with the rollback and keep the backup file.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"800\" height=\"233\" src=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/restore-database-backup-magento-command-line.png\" alt=\"Backup Magetno database from command line interface.\" class=\"wp-image-2001\" srcset=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/restore-database-backup-magento-command-line.png 800w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/restore-database-backup-magento-command-line-300x87.png 300w, https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/restore-database-backup-magento-command-line-768x224.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure><\/div>\n\n\n<p>The command executes the rollback and automatically enables and disables the <em>Maintenance<\/em> mode during the process.<\/p>\n\n\n\n<p class=\"h3\">Conclusion<\/p>\n\n\n\n<p>You can now backup and restore your Magento 2 store by choosing between three distinct methods.<\/p>\n\n\n\n<p>Stores that do not back up their data regularly are much less likely to recover after an attack or a major technical issue. Try to schedule and automate backup tasks to ensure that your backups are always up to date.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide shows three different methods for backing up a Magento 2 store. It also contains instructions on how to restore data from a backup file.<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[12,17],"tags":[],"class_list":["post-1997","post","type-post","status-publish","format-standard","hentry","category-e-commerce","category-online-security"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Magento Backup and Restore Tutorial {3 Methods} | CCBill KB<\/title>\n<meta name=\"description\" content=\"Learn how to routinely back up your Magento 2 store using 3 different methods. Streamline Magento rollbacks and avoid excessive downtime.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Magento Backup and Restore Tutorial {3 Methods} | CCBill KB\" \/>\n<meta property=\"og:description\" content=\"Learn how to routinely back up your Magento 2 store using 3 different methods. Streamline Magento rollbacks and avoid excessive downtime.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore\" \/>\n<meta property=\"og:site_name\" content=\"CCBill Knowledge Base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ccbillBIZ\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-03T11:12:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-06T12:09:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial.png\" \/>\n<meta name=\"author\" content=\"Vladimir Kaplarevic\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CCBillBIZ\" \/>\n<meta name=\"twitter:site\" content=\"@CCBillBIZ\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vladimir Kaplarevic\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#article\",\"isPartOf\":{\"@id\":\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore\"},\"author\":{\"name\":\"Vladimir Kaplarevic\",\"@id\":\"https:\/\/ccbill.com\/kb\/#\/schema\/person\/1f198b1218f6343a2682022ac4395644\"},\"headline\":\"Magento Backup and Restore Tutorial\",\"datePublished\":\"2021-06-03T11:12:26+00:00\",\"dateModified\":\"2023-03-06T12:09:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore\"},\"wordCount\":923,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/ccbill.com\/kb\/#organization\"},\"image\":{\"@id\":\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial.png\",\"articleSection\":[\"eCommerce Tutorials\",\"Online Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore\",\"url\":\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore\",\"name\":\"Magento Backup and Restore Tutorial {3 Methods} | CCBill KB\",\"isPartOf\":{\"@id\":\"https:\/\/ccbill.com\/kb\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial.png\",\"datePublished\":\"2021-06-03T11:12:26+00:00\",\"dateModified\":\"2023-03-06T12:09:52+00:00\",\"description\":\"Learn how to routinely back up your Magento 2 store using 3 different methods. Streamline Magento rollbacks and avoid excessive downtime.\",\"breadcrumb\":{\"@id\":\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#primaryimage\",\"url\":\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial.png\",\"contentUrl\":\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial.png\",\"width\":800,\"height\":400,\"caption\":\"A merchant that wants to back up a Magento store.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"KB Home\",\"item\":\"https:\/\/ccbill.com\/kb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Online Security\",\"item\":\"https:\/\/ccbill.com\/kb\/category\/online-security\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Magento Backup and Restore Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ccbill.com\/kb\/#website\",\"url\":\"https:\/\/ccbill.com\/kb\/\",\"name\":\"CCBill Knowledge Base\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/ccbill.com\/kb\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ccbill.com\/kb\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ccbill.com\/kb\/#organization\",\"name\":\"CCBill\",\"url\":\"https:\/\/ccbill.com\/kb\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ccbill.com\/kb\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2020\/10\/ccbill-logo.png\",\"contentUrl\":\"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2020\/10\/ccbill-logo.png\",\"width\":160,\"height\":70,\"caption\":\"CCBill\"},\"image\":{\"@id\":\"https:\/\/ccbill.com\/kb\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ccbillBIZ\/\",\"https:\/\/x.com\/CCBillBIZ\",\"https:\/\/www.linkedin.com\/company\/ccbill\",\"https:\/\/www.youtube.com\/c\/CCBillBiz\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ccbill.com\/kb\/#\/schema\/person\/1f198b1218f6343a2682022ac4395644\",\"name\":\"Vladimir Kaplarevic\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ccbill.com\/kb\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cc08885e8fec32585bae8a0f5a1aef92f8c8c4fc33692e74e0ec2e63633d2478?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cc08885e8fec32585bae8a0f5a1aef92f8c8c4fc33692e74e0ec2e63633d2478?s=96&d=mm&r=g\",\"caption\":\"Vladimir Kaplarevic\"},\"description\":\"Vladimir is a resident Tech Writer at CCBill. He has more than 8 years of experience in implementing e-commerce and online payment solutions with various global IT services providers. His engaging writing style provides practical advice and aims to spark curiosity for innovative technologies.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Magento Backup and Restore Tutorial {3 Methods} | CCBill KB","description":"Learn how to routinely back up your Magento 2 store using 3 different methods. Streamline Magento rollbacks and avoid excessive downtime.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore","og_locale":"en_US","og_type":"article","og_title":"Magento Backup and Restore Tutorial {3 Methods} | CCBill KB","og_description":"Learn how to routinely back up your Magento 2 store using 3 different methods. Streamline Magento rollbacks and avoid excessive downtime.","og_url":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore","og_site_name":"CCBill Knowledge Base","article_publisher":"https:\/\/www.facebook.com\/ccbillBIZ\/","article_published_time":"2021-06-03T11:12:26+00:00","article_modified_time":"2023-03-06T12:09:52+00:00","og_image":[{"url":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial.png","type":"","width":"","height":""}],"author":"Vladimir Kaplarevic","twitter_card":"summary_large_image","twitter_creator":"@CCBillBIZ","twitter_site":"@CCBillBIZ","twitter_misc":{"Written by":"Vladimir Kaplarevic","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#article","isPartOf":{"@id":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore"},"author":{"name":"Vladimir Kaplarevic","@id":"https:\/\/ccbill.com\/kb\/#\/schema\/person\/1f198b1218f6343a2682022ac4395644"},"headline":"Magento Backup and Restore Tutorial","datePublished":"2021-06-03T11:12:26+00:00","dateModified":"2023-03-06T12:09:52+00:00","mainEntityOfPage":{"@id":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore"},"wordCount":923,"commentCount":0,"publisher":{"@id":"https:\/\/ccbill.com\/kb\/#organization"},"image":{"@id":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#primaryimage"},"thumbnailUrl":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial.png","articleSection":["eCommerce Tutorials","Online Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ccbill.com\/kb\/magento-backup-and-restore#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore","url":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore","name":"Magento Backup and Restore Tutorial {3 Methods} | CCBill KB","isPartOf":{"@id":"https:\/\/ccbill.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#primaryimage"},"image":{"@id":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#primaryimage"},"thumbnailUrl":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial.png","datePublished":"2021-06-03T11:12:26+00:00","dateModified":"2023-03-06T12:09:52+00:00","description":"Learn how to routinely back up your Magento 2 store using 3 different methods. Streamline Magento rollbacks and avoid excessive downtime.","breadcrumb":{"@id":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ccbill.com\/kb\/magento-backup-and-restore"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#primaryimage","url":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial.png","contentUrl":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2021\/06\/magento-backup-restore-tutorial.png","width":800,"height":400,"caption":"A merchant that wants to back up a Magento store."},{"@type":"BreadcrumbList","@id":"https:\/\/ccbill.com\/kb\/magento-backup-and-restore#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"KB Home","item":"https:\/\/ccbill.com\/kb\/"},{"@type":"ListItem","position":2,"name":"Online Security","item":"https:\/\/ccbill.com\/kb\/category\/online-security"},{"@type":"ListItem","position":3,"name":"Magento Backup and Restore Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/ccbill.com\/kb\/#website","url":"https:\/\/ccbill.com\/kb\/","name":"CCBill Knowledge Base","description":"","publisher":{"@id":"https:\/\/ccbill.com\/kb\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ccbill.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ccbill.com\/kb\/#organization","name":"CCBill","url":"https:\/\/ccbill.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ccbill.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2020\/10\/ccbill-logo.png","contentUrl":"https:\/\/ccbill.com\/kb\/wp-content\/uploads\/2020\/10\/ccbill-logo.png","width":160,"height":70,"caption":"CCBill"},"image":{"@id":"https:\/\/ccbill.com\/kb\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ccbillBIZ\/","https:\/\/x.com\/CCBillBIZ","https:\/\/www.linkedin.com\/company\/ccbill","https:\/\/www.youtube.com\/c\/CCBillBiz"]},{"@type":"Person","@id":"https:\/\/ccbill.com\/kb\/#\/schema\/person\/1f198b1218f6343a2682022ac4395644","name":"Vladimir Kaplarevic","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ccbill.com\/kb\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cc08885e8fec32585bae8a0f5a1aef92f8c8c4fc33692e74e0ec2e63633d2478?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cc08885e8fec32585bae8a0f5a1aef92f8c8c4fc33692e74e0ec2e63633d2478?s=96&d=mm&r=g","caption":"Vladimir Kaplarevic"},"description":"Vladimir is a resident Tech Writer at CCBill. He has more than 8 years of experience in implementing e-commerce and online payment solutions with various global IT services providers. His engaging writing style provides practical advice and aims to spark curiosity for innovative technologies."}]}},"_links":{"self":[{"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/posts\/1997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/comments?post=1997"}],"version-history":[{"count":16,"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/posts\/1997\/revisions"}],"predecessor-version":[{"id":4800,"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/posts\/1997\/revisions\/4800"}],"wp:attachment":[{"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/media?parent=1997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/categories?post=1997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ccbill.com\/kb\/wp-json\/wp\/v2\/tags?post=1997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}