Overview

This facility can be used to export and import various aspects of your Mango configuration. This ability provides several benefits:

Backup and restore
Export your entire configuration, and save the resulting text in a safe place. If your Mango instance suffers a catastrophic failure you can create a new instance and import your configuration file to quickly recreate the instance.
Create and maintain identical instances
Export the elements of your configuration that are common across all of your instances. To create a new similar instance, import the common configuration and then tweak as necessary. To make changes across all of your instances simply change the configuration file and import into all of you instances. Or, change one instance, export, and then import that result into all of the other instances.
Maintain large, complex configurations
Although widely praised for its asthetics and ease of use, the Mango user interface was not designed to handle extremely large and complex configurations. In such a case the export files can be used as an alternate means to manage your configuration. Make your changes directly in the configuration file, and then import into your instances.

Exporting

You can choose to export your entire configuration by checking each of the options within Select what you would like to export. Or, you can choose to only export portions as required. The result of the export operation will be displayed in the Data text area, from which you can copy and paste elsewhere, or make direct changes.

Importing

Similar to how users can select what to export, you may also choose to import only a small portion of your entire configuration. For the most part any information that is excluded from your import file will remain unchanged. For example, if your import data does not include the "eventDetectors" attribute within a data point, that point's event detectors list will remain unchanged. However, if the attribute is included the list will be replaced with the contents of the attribute.

In general, any Mango object that has a unique identifier is capable of being created and updated—but not deleted. Such objects that are supported by this facility will have and Export Id, or XID. This attribute is specifically designated to provide unique indentification of objects between Mango instances. This is similar to a database-generated primary key, but primary keys cannot be made to match over multiple Mango instances. When an object—such as a data source—is created using the Mango interface it is automatically given an instance-unique XID. Although it cannot be guaranteed to be unique across all of your Mango instances, there is a high probability that it will be. You may change the XID to any 50 character value you like as long as the value is still unique for that object type within the instance.

Imports may fail for multiple reasons:

Format

The import/export facility uses the JSON format (see http://www.json.org/ for more information) as the data format for configuration files. JSON is a very simlar data format that is easy to understand and use. (For users familiar with Javascript JSON will be immediately familiar.) JSON was chosen over the more common XML format because it provides better mapping to the actual Mango object structure, and is also more compact.

Mango will automatically create "pretty" JSON export files, i.e. it will format the output with appropriate line breaks and indenting. The amount of indenting can be controlled with the Indent level attribute.