The previous migration only checked for upsList field, but saveConfig() strips upsList when saving, creating a race condition. If the daemon restarted with a partially-migrated config (upsDevices with flat structure), the migration wouldn't run because it only looked for upsList. Now shouldRun() also detects: - upsDevices with flat structure (host at top level, no snmp object) And migrate() handles both: - config.upsList (pure v3) - config.upsDevices with flat structure (partially migrated) This fixes the "Cannot read properties of undefined (reading 'host')" error that occurred when configs had upsDevices but flat structure.