Config and data backup & restore
: The name of the built-in database inside each EMQX node. Data export import: A command line tool to support data export & import using a JSON file as the transient drop.
When using morden provisioning tools for EMQX deployment, configuration changes are mostly managed by the tools, and even source controlled in for example a git repo.
In case manual config changes are made to the config files, it’s a good idea to have them backed up.
- Default to when installed from RPM or DEB packages
- Default to
/opt/emqx/etc
shen running in docker container
There are two approaches to create a backup of the Mnesia database.
The commands introduced in , can be used backup the database to a JSON file using the export command, and restore whth the import command.
When recovering a EMQX cluster from the exported file, the new EMQX cluster should be started with at empty state, and the import command should repopulate the database for all nodes in the cluster.
The database schema (which is also stored in mnesia
directory) is unique per EMQX node, meaning a backup can not be used to restore another node in the cluster.
Depending on installation and configuration, data
dir can be located in below possible paths.
- Where the environment variable points to
- Where the
node.data_dir
config key points to inemqx.conf
/opt/emqx/data
when running in docker (typically a mounted volume)- when installed from zip package extraction
Prior to v5.0, EMQX nodes are rather stateless by themselves, in the sense that persistent session states are delegated to external databases (EMQX Enterprise feature).