Move alarm definitions to Pro or Enterprise
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.
Before you start
Section titled “Before you start”- Keep the data folder of the Free or Starter installation (
data/alarms/withalarm_definitions.json, andalarm_journal.jsonlif 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
Section titled “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, actionIMPORT, 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
Section titled “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
Section titled “3. Check the result”- Alarms in the Studio: the definitions are listed as before.
- System Health, as an Administrator:
GET /api/system/healthhasalarm_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
Section titled “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
Section titled “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
Section titled “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.