Skip to main content

Setting Up Remote Backups

Automated remote backups are essential for protecting your MangoGT configuration, data, and custom modules against hardware failure, accidental deletion, or site disasters. The MangoGT comes with the iDrive backup agent pre-installed, providing an integrated solution for cloud-based backup and recovery.

Why Use Remote Backups?

The MangoGT stores all its data on internal flash storage. While this storage is reliable, it is a single point of failure. Remote backups protect against:

  • Hardware failure -- if the MangoGT's internal storage fails, you can restore to a replacement unit
  • Accidental misconfiguration -- iDrive tracks up to 10 versions of each file, allowing you to roll back configuration changes
  • Site disasters -- fire, flooding, or other events that could destroy the physical device
  • Database corruption -- restore the Mango database from a known good backup

iDrive Overview

iDrive is a cloud backup service that supports Linux-based devices including the MangoGT. Key features for MangoGT backups include:

  • Automatic scheduled backups with configurable frequency
  • File versioning (up to 10 versions of each file)
  • Incremental backups to minimize bandwidth usage
  • Encrypted transfer and storage
  • Web-based file browser for accessing backed-up files

Setup Instructions

Step 1: Create an iDrive Account

Sign up for an iDrive business account at www.idrive.com. You will need the account username, password, and email address for the configuration.

Step 2: Connect to the MangoGT via SSH

Connect to your MangoGT using SSH on port 2222. See SSH Access for detailed instructions.

ssh mango@mangogtXXXX.local -p 2222

Step 3: Configure the iDrive Agent

Navigate to the iDrive installation directory and open the configuration file:

cd /opt/Idrive_ARM
sudo nano CONFIGURATION_FILE

Edit the following lines with your iDrive account details:

USERNAME = your_idrive_username

PASSWORD = your_idrive_password

EMAILADDRESS = your_email@example.com

# Set a top level folder name in the iDrive cloud to back up files into
BACKUPLOCATION = MangoGT_XXXX_Backup

Replace XXXX with your MangoGT serial number or a meaningful identifier so you can distinguish backups from multiple MangoGT units.

Save and exit the file by pressing Ctrl+X, then Y to confirm, then Enter.

Step 4: Log In to iDrive

Run the login script to authenticate with the iDrive service:

sudo ./login.pl

Wait for the success message confirming that the MangoGT has authenticated with your iDrive account.

note

If you log out of the MangoGT SSH session and need to re-authenticate later, you will need to supply the password in the CONFIGURATION_FILE again before running login.pl.

Step 5: Configure the Backup Schedule

Run the scheduler script to set up automatic backups:

sudo ./Scheduler_Script.pl

Follow the interactive prompts to configure:

  • Backup frequency -- how often backups run (daily, weekly, etc.)
  • Backup time -- when the backup starts (choose off-peak hours to minimize impact)
  • Files and directories to include -- by default, the Mango installation directory at /opt/mango/

Step 6: Run an Initial Backup (Optional)

To verify your configuration and perform an immediate backup:

sudo ./Backup_Script.pl

This runs a full backup immediately. Subsequent scheduled backups will be incremental, transferring only changed files.

What Gets Backed Up

The default backup configuration should include the following critical directories:

DirectoryContents
/opt/mango/overrides/Configuration override files and properties
/opt/mango/backup/Mango's built-in backup files
/opt/mango/filestore/User-uploaded files managed by Mango
/opt/mango/databases/Database files (H2 or Derby, depending on configuration)
/etc/network/interfacesNetwork configuration
/etc/openvpn/VPN configuration files
tip

If your MangoGT uses an external database (such as MySQL or PostgreSQL), the database files will not be in the Mango directory. Configure separate database backups using the database system's native backup tools.

Restoring from Backup

To restore files from an iDrive backup:

  1. Log into the iDrive web interface at www.idrive.com
  2. Navigate to the backup folder for your MangoGT
  3. Select the files or directories you want to restore
  4. Download them to your local computer
  5. Upload the files to the MangoGT using SFTP
  6. Restart the Mango service: sudo service mango restart

Alternatively, you can use the iDrive restore script on the MangoGT directly to pull files from the cloud backup.

Alternative Backup Methods

While iDrive is the recommended solution for MangoGT backups, you can also use:

  • Mango's built-in backup -- Mango can create configuration backups from the web interface under Administration > Backup/Restore
  • Manual SFTP transfer -- Use SFTP to manually download critical files on a regular basis
  • Cron + rsync -- Set up a cron job on the MangoGT to rsync files to a remote server
  • Mango's JSON configuration export -- Export data source and point configurations as JSON for version-controlled backup