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
- Extension Installation Guide
- Configuration
- Backup Storage Settings
- Auto Backup Schedule Settings
- Backup Exclusion Settings
- Admin Email Notification Settings
- Backup Deletion Settings
- Backup in Cloud Storage
- 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
- php bin/magento module:status Meetanshi_AutoBackup
- 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.
- 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.
- Database: Select to create backup of the database.
- 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.
- 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.
- Google Drive: Select to upload and save the backup files in Google Drive.
- Select File Storage Option to Upload Backup: Select one of the backup file storage options.
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.
-
- After finishing the step, click {yourstore.com}/mtautobackup/action/googlecallback/key/7fc0839706592506419bb44f7aee0511425fca6a408ae7370c9549d173f69528/ to get the Client token. Grant permission and click “Continue”.
-
- 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.
-
-
- Dropbox: Select to upload and save the backup files in Dropbox.
- Access Token: Enter the access token received after registration with Dropbox. Follow the steps https://www.dropbox.com/developers/reference/getting-started?_tk=guides_lp&_ad=guides2&_camp=get_started#app%20console to get the access token.
- Dropbox: Select to upload and save the backup files in Dropbox.
-
- 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.
- 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.
- 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.
- 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.
- 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