Backup and restore
There are two kinds of backup, and they are not the same. The configuration export is a JSON file you make in the Console. The full backup is a database dump plus configuration and secrets. Use the full backup to protect a plant. Use the configuration export to copy settings to another Console.

Passwords, tokens and private keys are sealed with the master key (MI_MASTER_KEY, in Lite the file secrets/master.key). A backup without the matching key restores, but every stored credential is unreadable and you must enter them again. Keep the key with your backups, in a safe place. Protect the backup file itself too, because a Lite backup contains the key.
Which one do I need?
| I want to | Use |
|---|---|
| Protect a Lite plant against disk loss or a bad upgrade | mii backup (full) |
| Go back after an upgrade | mii rollback |
| Move devices, rules and uplinks to another Console | Configuration export and import |
| Move from Lite to an Enterprise Console | Configuration export and import |
| Protect a plant stack | Volume backups (see below) |
Full backup of mii Lite
What is included
| Part | In the backup |
|---|---|
manifest.json | Yes (version and checksums) |
db.dump | Yes: the whole PostgreSQL database made with pg_dump -Fc. It includes the Console data and the history, because the Lite historian is in the same database |
config/ | Yes (mii.env) |
secrets/ | Yes, including master.key |
data/ot/ | Yes (OT runtime data) |
data/stream/ | Yes (rules engine data) |
data/buffer/ | No. It is transient |
logs/ | No |
Make a backup
A backup works while the service is running. It writes mii-backup-<version>-<timestamp>.zip to the backups folder of the data directory.
- Windows
- Linux
- Docker
& "C:\Program Files\MakeIntelligent\mii.exe" backup
# or to a chosen file
& "C:\Program Files\MakeIntelligent\mii.exe" backup --out D:\safe\plant-before-change.zip
Default folder: C:\ProgramData\MakeIntelligent\backups\.
sudo /opt/makeintelligent/mii backup
sudo /opt/makeintelligent/mii backup --out /srv/backups/plant-before-change.zip
Default folder: /var/lib/makeintelligent/backups/.
Run the command inside the container and copy the file out. The data volume /data holds the backups folder.
docker exec mii /opt/makeintelligent/mii backup
docker cp mii:/data/backups/. ./backups/
The output ends with Backup written: <path>.
Restore
The service must be stopped. A restore replaces the database and the files.
- Stop the service:
mii stop. - Run
mii restore <file>. It asks you to typeRESTORE. Use--yesto skip the question in a script. - The current data is kept next to it as
*.pre-restore-<timestamp>(for example the database folder gets apg.pre-restore-<time>copy). Delete it when you are sure. - Start the service:
mii start.
Rules:
- A backup from a newer version than the installed one is refused.
- A backup whose version cannot be compared is refused unless you add
--allow-unknown-version. - If a restore is interrupted, the service refuses to start ("refusing to start") until you repeat the restore.
- With an external PostgreSQL (
MI_LITE_PG_URL, for development only), the restore runspg_restore --cleanover that database.
Automatic backup before an upgrade
Every time the version changes, mii makes a backup named auto-preupgrade-<old>-to-<new>-<timestamp>.zip before it migrates the database. If the backup fails, the start is aborted and nothing is changed. The three most recent upgrade pairs keep their automatic backup. Manual backups are never deleted by mii.
Rollback
mii rollback (service stopped) restores the pre-upgrade backup and runs the previous version again. See Upgrade.
Schedule it
mii has no built-in schedule. Use the operating system:
schtasks /Create /SC DAILY /ST 02:00 /TN "mii backup" /RU SYSTEM /TR "\"C:\Program Files\MakeIntelligent\mii.exe\" backup --out D:\safe\mii-daily.zip"
# /etc/cron.d/mii-backup (Linux)
0 2 * * * root /opt/makeintelligent/mii backup --out /srv/backups/mii-$(date +\%F).zip
A fixed --out name overwrites the file of the day before; use a date in the name and prune old files yourself. Copy the files off the computer.
Configuration export and import (all editions)
Open Settings → Backup. The section is called Configuration backup. It needs the permission to export or import configuration, and is hidden for users with limited access.
What it covers
Devices, uplinks (Destinations), routes, rules, streams, sinks, alert webhooks and certificates. The bundle also includes the knowledge graph, the process model and the OEE settings. The ISA-95 model itself (enterprise, site, areas, equipment) is not in the bundle.
This is not a database backup. It does not hold history, alarms, users or the audit log. Use mii backup for that.
Export
- Optionally tick Include secrets (needed to restore MQTT/Kafka passwords and private keys).
- Click Export JSON. A file downloads. The line Last export shows a count of what left the Console.
Without the tick, passwords, tokens and private keys are left out. With the tick, they are in the file: protect it like a password.
Import
- Choose Import mode:
- Merge (upsert by id): adds new items and updates items with the same id.
- Replace (delete existing config first): deletes devices, Destinations, routes, rules, streams, sinks, alert webhooks and certificates first. You must confirm "Continue?".
- Click Import JSON and choose the file. Last import shows the result.
Details:
- An import runs the licence checks. Limits of your licence still apply.
- An import never turns on webhook delivery. Switch it on in Uplinks.
- An import without secrets keeps the secrets already stored for the same device or uplink. On another Console they must be entered again.
- Safe-write limits already on this Console are kept, and the result lists them.
API: GET /api/v2/config/export?secrets=1 and POST /api/v2/config/import with {"mode":"merge"|"replace","bundle":{…}}.
Plant stack (Docker Compose, k3s)
The plant stack has no mii backup. Back up these four volumes:
| Volume | Content |
|---|---|
postgres-data | The Console database (mi-db) |
clickhouse-data | The history (mi-tsdb) |
mii-secrets | Passwords, JWT secret and master key |
siterun-buffer-data | The buffer of the Site Runtime (only needed if you cannot lose the last hours) |
For a consistent database backup, use pg_dump and check it:
docker compose -f compose.plant.yml exec mi-db pg_dump -U mii -Fc makeitintelligent > mii-$(date +%F).dump
pg_restore -l mii-$(date +%F).dump | head
Always back up mii-secrets together with the database. A database restored with a different master key cannot open the stored secrets.
Limits and good practice
- Test a restore on another computer at least once. A backup you never restored is a guess.
- Make a manual backup before every change you cannot undo: a retention change, a Replace import, a licence swap.
- Keep three copies, on two kinds of storage, one off site.
- Store the master key separately from the backup if your policy requires it, but never lose it.
- A full backup contains history. A year of data from many tags can be large, so check the free space of the
backupsfolder.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
restore says the service is running | The service must be stopped | mii stop, then restore |
restore refuses the file | The backup is from a newer version, or its version cannot be compared | Install the same or a newer version, or use --allow-unknown-version if you are sure |
| Service will not start after an interrupted restore | The restore did not finish | Run the restore again |
| Credentials are blank after a restore | Master key differs | Restore the key from the backup (secrets/master.key), or enter credentials again |
| Import refused by licence | The bundle exceeds your licence limits | See Licensing |
| Webhooks do not fire after import | Delivery is never turned on by an import | Switch it on in Uplinks |