Magento Expert Forum - Improve your Magento experience

Results 1 to 10 of 10

How To Backup And Rollback In Magento 2

  1. #1
    [ Contributor ] Wajid Hussain's Avatar
    Join Date
    Nov 2014
    Posts
    204
    Thanks
    3
    Thanked 14 Times in 12 Posts

    Default How To Backup And Rollback In Magento 2

    One of the most important aspects of running any online store is keeping a proper backup of everything so that in case anything goes wrong you can restore it with ease anytime. You can also adjust settings and edit your site without worrying that your web page will go offline. So as you can see, maintaining a backup of the site is pretty important.

    The functionality is built-in Magento 2 to ensure that the backup is created of the data and then it can restore all the codes, media and also your site’s database whenever you require it. At times it is a critical task to restore backups.

    There are many options available if you desire to make a back up of your site’s data. Through this article, we will guide you in steps how you can do the process of backing your data and then how you can restore it by the use of CLI commands.

    So let’s get started!

    Before We Begin

    Before going further, you must check that you have installed a working Magento 2 beforehand on your system. Now access the installation of your Magento 2 via the shell and you have to use SSH. First login via SSH, after this go to the app which is present at the root folder, bin, var folders are placed of Magento 2.

    Backup/Snapshot – How To Do It

    Once you are done with the step of changing Magento 2 directory to the root of it, install and run the command below:

    PHP Code:
    php bin/magento setup:backup -v –code –media –db 
    It will create three types of backups which include:

    1. Code
    2. Media, for example, the pictures or videos, etc.
    3. The data’s Database which is of high necessity for your store.


    Note that during the backup of your store, as it will change the mode of your site to maintenance mode. During the back up the live site of your store will not be available during backup and all of the backups will be stored in the var/backups


    Read Complete Article Here: http://arpatech.com/blog/how-to-back...-in-magento-2/

    View more threads in the same category:


  2. #2
    Junior Member
    Join Date
    Feb 2017
    Posts
    19
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    I feel it interesting, your post gave me a new perspective! I have read many other articles about the same topic, but your article convinced me! I hope you continue to have high quality articles like this to share with veryone! Good luck!
    slither io

  3. #3
    New member LanHuong6118's Avatar
    Join Date
    Oct 2017
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I feel interesting too, very useful thread

  4. #4
    Senior Member
    Join Date
    Aug 2018
    Posts
    107
    Thanks
    1
    Thanked 4 Times in 4 Posts

    Default

    Hi.........................................!
    Step 1: Choose the backup type. In the upper-right corner select one of the available backup types: System Backup, Database and Media Backup, Database Backup: ...
    Step 2: Check the showings before the backup. ...
    Step 3: See if the backup went off well.
    Thanks............................................

  5. #5
    Junior Member aishwaryaV's Avatar
    Join Date
    Sep 2018
    Location
    Noida, India
    Posts
    31
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Backup can be done in 2 ways:

    Backup via the Command line
    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.

    Backup via the Admin Panel
    Firstly, login to your Admin Panel and go to System> Tools> Backups:

    Step 1: Choose the backup type
    In the upper-right corner select one of the available backup types: System Backup, Database and Media Backup, Database Backup
    The System Backup creates and saves a complete copy of the database and the file system. Besides, putting a tick in a special checkbox you can choose whether to include the media folder
    The Database and Media Backup creates a full copy of the current database and the media folder
    The Database Backup forms and stores a copy of the database only.

    Step 2: Check the showings before the backup
    Use only a-z/A-Z letters, 0-9 numbers, and spaces when creating a backup name;
    It is recommended to tick the Maintenance mode box during the backup:
    maintenance-mode-magento
    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.
    Choose to exclude/include the media folder form the System Backup;
    Click the Ok button when the settings are completed.

    Step 3: See if the backup went off well
    If you see a message saying the backup is completed and you can move to the next step, this means you don’t have any issues with it;
    After a backup is completed successfully you can process with any of the following steps: install new purchases/updates; components updating/disabling/enabling/uninstalling;
    If errors are displayed, look here to eliminate the glitches.

    Rolling back via the Command line
    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.

    Step 1: Find the backup filename
    Switch to the Magento file system owner;
    Enter magento info:backups:list into the command line to learn the name of the latest backup you need;
    Roll back to a previous backup by typing the next command: magento setup:rollback [-c|--code-file=""] [-m|--media-file=""] [-d|--db-file=""].

    Step 2: Revise the result
    Then you’ll see one of the two messages:
    message-positive-backup
    or
    message-negative-backup
    If you see the second one, try this link to solve the issue.

  6. #6
    Senior Member
    Join Date
    Aug 2018
    Posts
    107
    Thanks
    1
    Thanked 4 Times in 4 Posts

    Default

    Firstly, login to your Admin Panel and go to System> Tools> Backups:
    Step 1: Choose the backup type. In the upper-right corner select one of the available backup types: System Backup, Database and Media Backup, Database Backup: ...
    Step 2: Check the showings before the backup. ...
    Step 3: See if the backup went off well.

  7. #7
    Junior Member
    Join Date
    Sep 2018
    Location
    Canada
    Posts
    873
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Step 1: Find the backup filename
    Enter magento info:backups:list into the command line to learn the name of the latest backup you need; Roll back to a previous backup by typing the next command: magento setup:rollback [-c|--code-file=""] [-m|--media-file=""] [-d|--db-file=""].

  8. #8
    Junior Member
    Join Date
    Nov 2020
    Location
    united kingdom
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Step 1: Find the backup filename. Switch to the Magento file system owner; Enter magento info:backups:list into the command line to learn the name of the latest backup you need; ...
    Step 2: Revise the result. Then you'll see one of the two messages

    UK Segways Segways for sale UK
    Buy Hoverboard UK Segways
    Swegways uk

  9. #9
    Junior Member
    Join Date
    Sep 2018
    Location
    Oman, Muscat
    Posts
    2,084
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default

    Moving back to a Magento 2 reinforcement by means of the Command line

    Stage 1: Find the reinforcement filename. Change to the Magento record framework proprietor; Enter magneto data: reinforcements: list into the order line to gain proficiency with the name of the most recent reinforcement you need;

    Stage 2: Revise the outcome. At that point you'll see one of the two messages:

  10. #10

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •