# Move alarm definitions to Pro or Enterprise

> What happens to your alarm definitions when a Free or Starter installation moves to a Pro or Enterprise build - the one-time, validated import of alarm_definitions.json into the alarm database, what is and is not carried over, when the server refuses to start, and how to check the result.

Product: eaxScada · Type: How-to guide · Editions: Pro, Enterprise
Source: https://eaxware.com/docs/eaxscada/how-to/move-alarms-to-pro/
Verified against commit dcb41d3.

## Goal

Keep your alarms when an installation moves to a Pro or Enterprise build. Free and Starter keep alarm definitions in a file, `data/alarms/alarm_definitions.json`; Pro and Enterprise keep them in the alarm database. At its first start, a Pro or Enterprise server imports the file once, so no alarm is lost on the way.

:::danger[Check your alarms after the upgrade]
Before this version, a Pro or Enterprise build never read the file: an upgraded installation started with **no alarms at all**, silently. After upgrading, check that every alarm you expect is listed, and read the import report (step 3).
:::

## Before you start

- Keep the data folder of the Free or Starter installation (`data/alarms/` with `alarm_definitions.json`, and `alarm_journal.jsonl` if it exists).
- Make a copy of the data folder first, as for every upgrade.

## 1. Start the Pro or Enterprise server on the same data folder

At start, when the alarm database holds no definition and has never imported, the server imports the file:

- **Validated.** Each definition is checked as the API checks a new one. An invalid definition, or an id the file holds more than once, is not imported: it is logged with its id and the reason, and listed in the report.
- **All or nothing.** The valid definitions, the file's alarm journal (`alarm_journal.jsonl`; events already in the database are kept) and a marker are written in one transaction.
- **Once.** The marker keeps every later start from importing again, so definitions you edit or delete afterwards stay as you left them.
- **Audited.** The import is recorded in the audit trail (category `ALARM`, action `IMPORT`, the system as actor) with the counts and the file's SHA-256.
- **The files are left unchanged.**

## 2. Know what is not carried over

| | |
|---|---|
| **Shelves** (`alarm_shelved.json`) | Not imported. A shelved alarm comes back unshelved: never hidden by a shelve carried over. Shelve again what needs it. |
| **Alarm classes** (`classes.json`) | Nothing to import: both builds read the same file. |
| **A database that already holds alarms** | Never merged with the file. The file is ignored (with a warning), and the database is marked **authoritative**: even if every alarm is deleted later on purpose, a leftover file never brings them back. |

## 3. Check the result

- **Alarms** in the Studio: the definitions are listed as before.
- **System Health**, as an Administrator: `GET /api/system/health` has `alarm_store_import`. A Lead_Engineer gets the health page without it (it names the file and the refused definitions).

| `status` | Meaning |
|---|---|
| `imported` | the file's valid definitions were imported at this start: see `found`, `imported` and `refused` (each with its `id` and `reason`) |
| `imported_earlier` | imported at an earlier start; the file is not read again (`file_changed: true` if it differs from the one imported) |
| `ignored` | the database already held definitions: the file was ignored, and the database marked authoritative |
| `store_authoritative` | the database held definitions at a start without a marker: its definitions apply and the file is never imported |
| `nothing_valid` | the file holds definitions but none is valid: the database stays empty, and the next start tries again |
| `none` | no file, or a file without definitions |

The server log has the same report (`alarm definitions imported from the file store`, with the counts and the SHA-256).

## 4. If the server refuses to start

With an **empty** alarm database and an `alarm_definitions.json` that cannot be read or parsed, the server refuses to start rather than run without its alarms:

```
alarm store is empty and <path> cannot be imported: ... (fix or remove the file; refusing to start without alarm definitions)
```

Fix the file (restore it from the copy) or, if the installation is meant to start without alarms, remove it. Then start again.

The server also refuses to start if the alarm database itself cannot be read.

## Result

The alarm database holds the file's valid definitions, once; the report says what was imported and what was refused; later starts never import again.

## High availability

Each node runs the import on its own data folder at its own start. Upgrade the primary first and check its report. Do not leave an `alarm_definitions.json` in the data folder of a secondary whose alarm database is empty: it would import its own copy of the file.

## Related

- [Alarms](/docs/eaxscada/explanation/alarms/)
- [Put alarms on a screen](/docs/eaxscada/how-to/configure-alarm-objects/)
- [Metrics and System Health](/docs/eaxscada/reference/metrics/#system-health)
- [Upgrade an HA pair](/docs/eaxscada/how-to/upgrade-ha-pair/)
