Magento Tutorials

How To Backup Magento 2 Store (In Under 15 Minutes)

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:

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.

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.

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!

Click to rate this post!
[Total: 4 Average: 5]
Gaurav Jain

Gaurav Jain is Co-Founder and Adobe Certified Expert-Magento Commerce Business Practitioner. Being Computer Engineer👨‍💻 and possessing Extensive Marketing skills he handles all kinds of customer Queries and his Happy😀 & Helping🙏 Nature makes customer's day Delightful. When he isn’t working, you’ll find Gaurav Reading on Books📖 or Traveling🚗. Also, he is Speaker at Magento Meetups.

View Comments

  • 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?

Recent Posts

Mastering Tailwind CSS in Laravel: A Comprehensive Guide

Tailwind CSS has emerged as a powerful utility-first CSS framework, offering developers a unique approach…

2 days ago

React Native or Flutter in 2024

The mobile app development field has witnessed a rapid revolution over the past few years.…

4 days ago

Magento 2: How To Call JS on the Checkout Page?

Hello Magento mates, Today we will learn to add a call JS on the checkout…

7 days ago

Boost Your SEM Game: Unveiling the Top 10 Tools for Marketers in 2024

Business survival in today’s digital world has become extremely difficult. Using traditional marketing techniques is…

1 week ago

Five Essential Payroll Compliance Tips for eCommerce Startups

Are you setting up a payroll system for your eCommerce startup? Ensuring compliance with myriad…

1 week ago

Optimizing Laravel Blade: Unlocking Advanced Fetcher Techniques

In the expansive universe of Laravel development, Blade serves as the stellar templating engine, propelling…

1 week ago