NEWS
History: Migration von File zu MySQL mit Daten-Mitnahme möglich?
-
Hallo,
ich häng mich da mal dran weil ich auch nicht weiterkomme…
Bis jetzt habe ich meine Daten mit dem history-adapter geloggt (Verzeichnis /mnt/history). Jetzt möchte ich das ganze auf mysql umstellen und die vorhandenen Daten dorthin kopieren.
Datenbank ist auf meinem Nas eingerichtet und funktioniert, sql.0 Instanz läuft ebenfalls und loggt brav die neuen Daten.
Wenn ich jetzt folgendes eintippe:
root@raspberrypi:/opt/iobroker/node_modules/iobroker.history/converter# nodejs history2db.js sql.0 info 0 /mnt/history --processAllDPsbekomme ich als Antwort
Send Data to sql.0 Use historyDir /mnt/history EarliesDBValues initialized from cache 0 No stored existingDBTypes found started processFiles with 0 known db values We start earliest at 19700101 DONEWas mache ich falsch?
Nachtrag: bin jetzt ein bisschen weiter, mit
root@raspberrypi:/opt/iobroker/node_modules/iobroker.history/converter# nodejs history2db.js sql.0 debug 20160810 /mnt/history --ignoreExistingDBValues --processAllDPsbekomme ich
Send Data to sql.0 Start at 20160810 Use historyDir /mnt/history No stored earliesDBValues found No stored existingDBTypes found started processFiles with 0 known db values We start earliest at 20160810 Day 20160810 - history.hm-rpc.0.MEQ0690418.1.FILLING_LEVEL.json datapoints reduced from 1 --> 1Ab da hängts aber. Im Log steht:
sql.0 2018-01-20 11:31:56.135 error TypeError: Cannot read property 'index' of undefined at pushValueIntoDB (/opt/iobroker/node_modules/iobroker.sql/main.js:925:19) at storeState (/opt/iobroker/node_modules/iobroker.sql/main.js: sql.0 2018-01-20 11:31:56.134 error message messagebox.system.adapter.sql.0 [object Object] Cannot read property 'index' of undefined -
Danke, ich bin inzwischen ein bisschen weiter aber doch nicht erfolgreich.
Hab inzwischen herausgefunden das ich die instanz history.0 beenden muss damit es funktioniert.
Aber: Sobald ich das ganze starte mit
nodejs history2db.js sql.0 debug 20180120 /mnt/history 2 --logChangesOnly 60 ---processAllDPsbekomme ich folgende Fehlermeldung und der SQL Adapter startet sich neu:
host.raspberrypi 2018-01-21 10:53:58.512 info Restart adapter system.adapter.sql.0 because enabled host.raspberrypi 2018-01-21 10:53:58.505 error instance system.adapter.sql.0 terminated with code 6 (uncaught exception) sql.0 2018-01-21 10:53:42.969 error Error: connect EMFILE 10.0.0.130:3307 - Local (undefined:undefined) -
Also an sich kann history.0 nebenher laufen. Sollte nicht stören.
Den Fehler von sql kenne ich nicht, sieht mir aber nach was andere aus: https://stackoverflow.com/questions/103 … in-node-js Schau mal eher warum sql.0 solche Probleme macht ...
Wegen dem anderen Fehler schaue ich noch
-
Hallo,
entschuldige das ich mich erst so spät wieder melde, aber ich war gerade beruflich ziemlich beschäftigt.
Leider kann ich die sql-Version von github nicht installieren, bekomme immer folgende Fehler:
$ ./iobroker url "https://github.com/ioBroker/ioBroker.sql" install https://github.com/ioBroker/ioBroker.sql/tarball/master npm install https://github.com/ioBroker/ioBroker.sql/tarball/master --production --save --prefix "/opt/iobroker" (System call) npm WARN deprecated node-uuid@1.4.8: Use uuid module instead npm WARN deprecated sprintf@0.1.5: The sprintf package is deprecated in favor of sprintf-js. node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v46-linux-arm.tar.gz node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@4.8.4 (node-v46 ABI) (falling back to source compile with node-gyp) -
Hm ich hab jetzt den adapter aktualisert. Wenn ich nun
nodejs history2db.js sql.0 debug 20180120 /mnt/history 2 --logChangesOnly 60 ---processAllDPsstarte fängt er auch an
root@raspberrypi:/opt/iobroker/node_modules/iobroker.history/converter# nodejs history2db.js sql.0 debug 20180120 /mnt/history 2 --logChangesOnly 60 ---processAllDPs Send Data to sql.0 Start at 20180120 Use historyDir /mnt/history Use Delay multiplicator 2 Log changes only once per 60 minutes EarliesDBValues initialized from cache 21 ExistingDBTypes initialized from cache 21 started processFiles with 21 known db values We start earliest at 20180120 Day 20180120 - history.hm-rega.0.11818.json cut filedata to 0 Day 20180120 - history.hm-rega.0.11819.json cut filedata to 0 Day 20180120 - history.hm-rega.0.11820.json cut filedata to 0 Day 20180120 - history.hm-rega.0.11821.json cut filedata to 0 Day 20180120 - history.hm-rega.0.11822.json cut filedata to 0 Day 20180120 - history.hm-rega.0.11823.json cut filedata to 0 Day 20180120 - history.hm-rega.0.11824.json cut filedata to 0 Day 20180120 - history.hm-rega.0.16971.json cut filedata to 0 Day 20180120 - history.hm-rega.0.16972.json cut filedata to 0 Day 20180120 - history.hm-rega.0.2477.json cut filedata to 0 Day 20180120 - history.hm-rega.0.2478.json cut filedata to 0 Day 20180120 - history.hm-rega.0.2829.json cut filedata to 0 Day 20180120 - history.hm-rega.0.2830.json cut filedata to 0 Day 20180120 - history.hm-rega.0.3650.json cut filedata to 9520 datapoints reduced from 9520 --> 9520 sorted out 0 valuesaber im ioBroker Log sehe ich folgendes:
host.raspberrypi 2018-02-10 11:53:38.228 info Restart adapter system.adapter.sql.0 because enabled host.raspberrypi 2018-02-10 11:53:38.227 error instance system.adapter.sql.0 terminated with code 6 (uncaught exception) history.0 2018-02-10 11:53:07.332 info starting. Version 1.7.2 in /opt/iobroker/node_modules/iobroker.history, node: v4.8.7Der SQL-Adapter startet also neu…
-
Hallo,
geht auch über : http://forum.iobroker.net/viewtopic.php … sql#p15757
-
Ich wollte mich auch nochmal bedanken, es funktioniert perfekt. Einziger Nachteil: ich habe eine Datensammlung von über einem Jahr und z.T. sind es über 1000 Werte pro Tag bei insgesamt ca. 25 protokollierten Objekten :lol: Zweimal ist mir jetzt die SSH Session abgeschmiert so dass ich mich jetzt entschieden habe das auf der Konsole der VM zu machen, da bricht der Task wenigstens nicht ab :)
Verursacht aber schon ganz schön Load auf der CPU so ne Konvertierung..

-
Steht auch die Meldung bzw dir exception im log?? `
Gerade nochmal probiert:
sql.0 2018-02-11 13:01:12.707 info Connected to mysql sql.0 2018-02-11 13:01:12.623 info enabled logging of hm-rpc.0.OEQ0086710.1.TEMPERATURE sql.0 2018-02-11 13:01:12.623 info enabled logging of hm-rpc.0.OEQ0086710.1.HUMIDITY sql.0 2018-02-11 13:01:12.623 info enabled logging of hm-rega.0.16972 sql.0 2018-02-11 13:01:12.623 info enabled logging of hm-rega.0.16971 sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rpc.2.CUX4000001.7.CONTROL sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rpc.0.OEQ0023416.2.POWER sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rpc.0.OEQ0023416.2.ENERGY_COUNTER sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rega.0.11824 sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rega.0.11823 sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rega.0.11822 sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rega.0.11821 sql.0 2018-02-11 13:01:12.622 info enabled logging of hm-rega.0.11820 sql.0 2018-02-11 13:01:12.621 info enabled logging of hm-rega.0.11819 sql.0 2018-02-11 13:01:12.621 info enabled logging of hm-rega.0.11818 sql.0 2018-02-11 13:01:12.620 info enabled logging of hm-rega.0.6951 sql.0 2018-02-11 13:01:12.620 info enabled logging of hm-rega.0.3650 sql.0 2018-02-11 13:01:12.620 info enabled logging of hm-rega.0.2830 sql.0 2018-02-11 13:01:12.620 info enabled logging of hm-rega.0.2829 sql.0 2018-02-11 13:01:12.620 info enabled logging of hm-rega.0.2478 sql.0 2018-02-11 13:01:12.619 info enabled logging of hm-rega.0.2477 sql.0 2018-02-11 13:01:12.618 info enabled logging of hm-rpc.0.MEQ0690418.1.FILLING_LEVEL sql.0 2018-02-11 13:01:12.549 info starting. Version 1.6.9 in /opt/iobroker/node_modules/iobroker.sql, node: v4.8.7 host.raspberrypi 2018-02-11 13:01:09.270 info instance system.adapter.sql.0 started with pid 6276 host.raspberrypi 2018-02-11 13:00:39.238 info Restart adapter system.adapter.sql.0 because enabled host.raspberrypi 2018-02-11 13:00:39.237 error instance system.adapter.sql.0 terminated with code 6 (uncaught exception) history.0 2018-02-11 13:00:06.863 info starting. Version 1.7.2 in /opt/iobroker/node_modules/iobroker.history, node: v4.8.7 -
Klingt nach "mal Host neu starten"
-
Alternative ist: sql Adapter beenden über Admin. In /opt/iobroker folgendes an der Konsole ausführen:
node node_modules/iobroker.sql/main.js —force —logs
Damit startest du den sql Adapter manuell. Dann in zweiter Shell den Converter starten. Falls es wieder abstürzt dann solltest du ggf einen besseren Fehler bekommen.
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren Anmelden