Hello Magento Folks,
In this tutorial blog, I will illustrate to you all How To Backup Magento 2 Store. Check our previously published blog Magento 2: How to Configure Shipping Table Rates using CSV File. Let’s start learning:
Contents
Short Summary:
Basically, the intention of illustrating this blog is I have got many queries such as Magento 2 DB backup, Magento 2 system backup, Magento 2 backup extension, how to restore a Magento 2 backup, how to backup Magento 2 and many more. Instead of replying individually, I thought I will illustrate in a perfect solution article.
There are mainly 3 types to backup your Magento 2 Store:
Let’s learn types to backup Magento 2 one by one.
Magento 2 backup via the Command line
Mainly, all the Magento 2 Backup are saved in the var/backups directory and the Magento admin can easily recover it at any time by utilizing the following command.
1 |
magento setup:rollback |
How to execute Magento 2 database backup using the command line:
Firstly, you have to change to the Magento file system owner. Now fire the below command.
1 |
setup:backup [--code] [--media] [--db] |
The above command will switch a store into maintenance mode following the database, media, system file backups and ending it with switching off the maintenance mode.
You have successfully executed Magento 2 database backup using the command line.
Magento 2 backup via the Admin Panel
Step 1: Navigate to Admin Panel>System>Backups
Step 2: Select the type of backup you require from System Backup, Database and Media Backup, Database Backup
Step 3: If you select the System Backup then it will create a copy of the file system and database.
The Media and Database will generate a copy of the media folder and current database
Note: Make sure you utilize only spaces, 0-9 numbers and a-z/A-Z letters when creating a backup name and check the Maintenance mode checkbox during the Magento 2 backup.
Step 4: Verify the Backup:
There are no issues if you can view the message saying the backup is completed. In case of any error, you get a solution at Magento 2 Backup Issues.
You have successfully executed Magento 2 database backup using the Admin Panel.
Magento 2 Manual backup
This type is also considered as the safest, secured, and reliable Magento 2 backup. This allows you to export all the required files manually to your local system.
Step 1: Firstly, Backup your files
Access the file structure of your hosting file structure and search for the /public_html directory;
In case you have stored your Magento 2 site into a subfolder then search a folder within the /public_html directory and then download the directory to your system and save it to another hosting folder.
Step 2: Now, Export Database
Navigate to cPanel and select the phpMyAdmin service:
Choose the database name utilized for your Magento 2 website:
Tap to ‘Export’ for downloading it to the local computer as an SQL. file:
You have successfully executed the Magento 2 Manual store backup.
Concluding Words:
Hopefully, all are able to execute the Magento 2 store backup perfectly. If you come across any queries then write it in the comment section I will be happy to help.
Stress out yourself utilizing the MageComp Prime Membership for the best Magento Services and Unlock many Prime Privileges.
Share it with your friends via Social media platforms.
Happy Reading!
i want to ask about create manually backup to local from public_html
when i check the file size of my website is 28GB, but when i moved it to local, file size decreased to 9GB, so its that normal? or something wrong when file transferring?
Yes, that shouldn’t be normal.
Did you check importing the database if it shows all the database tables?