Magento 2 Cloud Backup

Magento 2 Cloud Backup extension facilitates backing up your Magento 2 store to Google Drive or Dropbox so as to not lose important data accidentally and disrupt the store's functioning.

 

Table of Content

  1. Extension Installation Guide
  2. Configuration
  3. Backup Storage Settings
  4. Auto Backup Schedule Settings
  5. Backup Exclusion Settings
  6. Admin Email Notification Settings
  7. Backup Deletion Settings
  8. Backup in Cloud Storage

 

  1. Extension Installation
  • For Magento Marketplace Customers
    • Find the Composer name and version of the extension in the extension’s composer.json file.
    • Login to your SSH and run:
      • composer require meetanshi/magento-2-cloud-backup
      • composer require google/apiclient:^2.0
    • Enter your authentication keys. Your public key is your username; your private key is your password.
    • Wait for Composer to finish updating your project dependencies and make sure there aren’t any errors.
    • To verify that the extension installed properly, run the command:
      • php bin/magento module:status Meetanshi_AutoBackup
          • By default, the extension is probably disabled.
          • Enable the extension and clear static view files:
      • php bin/magento module:enable Meetanshi_AutoBackup --clear-static-content
      • php bin/magento setup:upgrade
      • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
      • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
      • php bin/magento cache:flush
         
  • For Meetanshi Customers
  • Extract the zip folder and upload our extension to the root of your Magento 2 directory via FTP.
  • Login to your SSH and run below commands step by step:
      • composer require google/apiclient:^2.0
  • php bin/magento setup:upgrade
  • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
  • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
  • php bin/magento cache:flush

 

Note: Don’t forget to install Google Drive library even if you are not using Google Drive as backup storage option.

 

  1. Configuration
    To configure the extension, login to Magento 2 backend, move to Stores à Configuration à Meetanshi à Cloud Backup, where you can find various settings to configure the extension.

     
  • Cloud Backup: Enable or disable Cloud Backup for Magento 2 extension from here.
  • Backup Type: Select one of the backup types:
    • Database: Select to create backup of the database.
      • Database Backup Format: Select the database format to backup.
    • Database and Media: Select to create backup of the database and the media folder.
    • System: Select to create a complete backup of the database and the file system.
    • System (excluding Media): Select to create backup of the file system excluding media folder.
  • Backup Manually: Click “Run Now” button to take the backup manually.

 

Note: Don’t forget to “Enable Backup” option to YES from Stores > Configuration > Advanced > System > Backup Settings to make the cloud backup extension work.

 

  1. Backup Storage Settings
    The extension facilitates to upload and save the store backup either in Google Drive or in Dropbox. Select one of the file storage options to upload backup and configure related settings.
    • Select File Storage Option to Upload Backup: Select one of the backup file storage options.
      • Google Drive: Select to upload and save the backup files in Google Drive.
        • Client ID: Enter the client ID you received after the registration with Google Drive.
        • Client Secret: Enter the client secret you received after the registration with Google Drive.
        • Redirect URL: Enter the redirect URL as {{store_url}}/mtautobackup/index/getcode
        • Client Token: Enter the client token you received after the registration with Google Drive.

Follow the steps below to get the client ID, client secret and client token for the Google Drive.

  • Go to Google API Console.
  • Create a project by clicking "Select a project" (at the top).
  • Click on the NEW PROJECT button.

  • On the next screen, enter your project name and click on create button.

 

  • After the project is created, click on APIs and Services from the left panel and select Dashboard from its sub-options.

 

  • From the Dashboard, click on ENABLE APIS AND SERVICES.

 

  • Now search for Google Drive API in the search box and click when displayed.

 

  • Click on the ENABLE button to enable the Google Drive API.

 

  • Now configure the APIs and Services of Google Drive API by clicking CREATE CREDENTIALS option and selecting the OAuth client ID option.

 

  • Now, Select External user type from the OAuth consent screen and click on CREATE.

 

  • Enter the app information like your app name, user support Email, app/website logo under the App Information section.
  • Under the App domain section, enter the homepage URL of your webstore.
  • Enter the public privacy policy link in the Application privacy policy link field.
  • Enter an authorized domain in the next option.
  • Enter an authentic Email address under Developer Contact Information section for Google to notify you about any changes on your project. Click “Save and Continue”.

 

  • In the second step of the OAuth consent screen, click on SAVE AND CONTINUE button to redirect to the next step.

 

 

  • In the next Test Users step, add test user if you want to set limited access for only test users or else directly click on SAVE AND CONTINUE.

 

  • The next screen is Summary page, check whether all entered information is correct or not.

 

  • From the Publishing status section, click on PUBLISH APP.

 

  • It displays a dialog box that asks for your confirmation for publishing, Click on CONFIRM.

 

 

  • Now, click the credentials tab from the side panel, select the Application type as Web application.
  • Enter the name of your OAuth client.
  • In the Authorized Redirect URLs option, enter the same redirect URL as you entered under the Redirect URL option in the extension configuration.
  • Click on CREATE.

 

  • It displays a dialog box of OAuth client created.
  • Copy the Client ID and Client Secret from here and paste in the Client ID and Client Secret options of extension configuration.
  • Click on OK. Save the extension configuration.

 

 

    • Once the permission is allowed, it automatically redirects to the redirect URL and generates client token. Copy that client token and paste it in the extension configuration.

 

The Google Drive storage settings will look like this after configuration.

 

 

  1. Auto Backup Schedule Settings
    Using the extension, you can schedule to take regular backup of your store on the specific time.
    • Frequency: Select the frequency of the regular backup from daily, weekly or monthly.
    • Start Time: Set the start time of the backup based on the set frequency.
    • Enable Maintenance Mode While Backup: Select YES to enable maintenance mode while backup is ongoing.

 

  1. Backup Exclusion Settings
    You can exclude specific directories and database tables from scheduled or manual backup. Enter the directory path and database table name to exclude from the backup.

 

  1. Admin Email Notification Settings
    The extension facilitates to send an Email notification to the admin whenever a backup is completed and file is uploaded to the file storage option. Configure the settings from here.
  • Send Email Notifications to Admin: Select YES to send Email notification to the admin when the backup is completed.
  • Email ID: Enter the Email ID of an admin to get Email notification when the backup is completed.
  • Email Sender: Select the Email sender from the dropdown.
  • Email Template: Select the Email template.

 

  1. Backup Deletion Settings
    The extension facilitates to delete old backup files from the file storage option. You can schedule to delete old backup files regularly after set days.
  • Delete Old Backups: Select YES to delete old backup files uploaded in the cloud storage.
  • Days: Enter the number of days after which you want to delete the backup files from the cloud storage.

 

  1. Backup in Cloud Storage
    Once the backup is completed and uploaded in the cloud storage, you can see the backup files under a separate folder named “Magento Backups”.
  • Backup Files in Google Drive

  • Backup Files in Dropbox

 

  • Backup Completion Email to Admin