Skip to main content

How to Backup Your Mango System

A comprehensive backup strategy for Mango involves backing up the relational database, the NoSQL time-series database (if installed), and the Mango file structure. This page covers the automated backup features built into Mango and best practices for ensuring you can recover from data loss.

warning

You must stop Mango before manually copying the H2 database file or the NoSQL database files. Copying these files while Mango is running will result in corrupt backups. Use the built-in backup features instead, which create consistent snapshots without requiring a shutdown.

What to Back Up

ComponentLocationContains
SQL DatabaseMA_HOME/databases/Configuration, users, events, data point definitions
NoSQL DatabaseMA_HOME/databases/mangoTSDB/Point value history (if NoSQL module installed)
Configuration filesMA_HOME/mango.properties, MA_HOME/overrides/System settings, custom properties
File storeMA_HOME/filestore/Uploaded files, dashboard resources
Custom contentMA_HOME/web/ overridesBackground images, custom CSS, logos

Backing up only the database(s) preserves your configuration and historical data, but items like custom dashboard background images and file store uploads are stored on the filesystem. For a complete backup, include the entire MA_HOME directory tree.

note

We highly recommend using an automatic offsite backup service to back up at least once daily, preferably during a non-peak usage time.

SQL Database Backup Settings

Navigate to Administration > System Settings > SQL database backup to configure automated SQL database backups.

The SQL database backup configuration panel in System Settings

SettingDescriptionDefault
Enable auto backupTurn on scheduled backupsEnabled
Last runTimestamp of the most recent backup--
Backup directoryWhere backup files are storedMA_HOME/backups
Backup frequencyHow often to create backups (periods)Daily
Backup timePreferred time of day (hour 0-23, minute 0-59)Midnight
Versions to keepNumber of backup files to retain10

When more than one version is kept, backup files are named with the pattern core-database-[db type]-date_time.zip. When set to 1, the file is always named core-database-[db type].zip and is overwritten each time.

Click the Backup now button to queue an immediate backup job.

NoSQL Database Backup Settings

If the MangoNoSQL module is installed, a separate backup configuration is available under Administration > System Settings > Mango NoSQL Configuration. The NoSQL backup creates zip files of the time-series shard files.

The NoSQL backup supports incremental backups, which capture only changes since the last backup. This dramatically reduces backup time and file size for large datasets. To restore incremental backups, apply them in order on top of the base backup.

SettingDescriptionDefault
Enable auto backupTurn on scheduled backupsEnabled
Backup directoryWhere backup files are storedMA_HOME/backups
Backup frequencyHow often to create backupsDaily
Versions to keepNumber of backups retained9
Incremental backupsOnly backup changes since last backupDisabled

Configuration Backup

Mango also supports JSON configuration backups that export all configuration objects (data sources, data points, event detectors, event handlers, users, etc.) to a .json file. This is configured separately and produces smaller files that are useful for transferring configuration between instances.

Best Practices

  1. Back up both databases -- If using the NoSQL module, you need separate backups for the SQL and NoSQL databases. The SQL backup alone will not include point value history.
  2. Copy backups offsite -- Keep copies of backup files on a separate machine, network share, or cloud storage. Local backups will not help if the entire disk fails.
  3. Schedule backups during off-peak hours -- Backup operations consume disk I/O and CPU. Running them during low-activity periods minimizes impact on data collection.
  4. Test restores regularly -- A backup is only useful if it can be restored. Periodically test the restore process on a separate system. See How to Restore an H2 Database Backup.
  5. Monitor backup success -- Check the "Last run" timestamps periodically to ensure backups are completing. Set up event handlers to notify you of backup failures.
  6. Consider filesystem-level backups -- For large production systems, filesystem snapshots (LVM, ZFS, or cloud provider snapshots) may be more practical than application-level backups.