Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. History: Migration von File zu MySQL mit Daten-Mitnahme möglich?

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    History: Migration von File zu MySQL mit Daten-Mitnahme möglich?

    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      Dax last edited by

      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) 
      
      
      1 Reply Last reply Reply Quote 0
      • apollon77
        apollon77 last edited by

        Was kommt danach im log? Das ist kein Fehler. Wenn es danach „hängt“ einfach warten.

        1 Reply Last reply Reply Quote 0
        • D
          Dax last edited by

          Hm ich hab jetzt den adapter aktualisert. Wenn ich nun

          nodejs history2db.js sql.0 debug 20180120 /mnt/history 2 --logChangesOnly 60 ---processAllDPs
          

          starte 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 values
          
          

          aber 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.7
          

          Der SQL-Adapter startet also neu…

          1 Reply Last reply Reply Quote 0
          • apollon77
            apollon77 last edited by

            Steht auch die Meldung bzw dir exception im log??

            1 Reply Last reply Reply Quote 0
            • sissiwup
              sissiwup last edited by

              Hallo,

              geht auch über : http://forum.iobroker.net/viewtopic.php … sql#p15757

              1 Reply Last reply Reply Quote 0
              • C
                ChristianF last edited by

                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..
                455_iobro.jpg

                1 Reply Last reply Reply Quote 0
                • apollon77
                  apollon77 last edited by

                  Hättest auch Screen nehmen können. Aber Konsole auf hm geht auch.

                  Ja last passiert dabei. Dafür gibt es die zusatzparameter für Wartezeiten und so um das ein Bissl zu steuern. Muss man im Zweifel Bissl experimentieren.

                  1 Reply Last reply Reply Quote 0
                  • D
                    Dax last edited by

                    @apollon77:

                    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
                    
                    1 Reply Last reply Reply Quote 0
                    • C
                      ChristianF last edited by

                      Klingt nach "mal Host neu starten"

                      1 Reply Last reply Reply Quote 0
                      • apollon77
                        apollon77 last edited by

                        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.

                        1 Reply Last reply Reply Quote 0
                        • D
                          Dax last edited by

                          wenn ich den sql adapter mit deinem befehl starten will bekomme ich die Meldung

                          Cannot find module 'pg-native'
                          
                          
                          1 Reply Last reply Reply Quote 0
                          • apollon77
                            apollon77 last edited by

                            Komplette Fehlermeldung? Und das was hier nach einem langen "-" aussieht sind immer "zwei Minuszeichen"

                            1 Reply Last reply Reply Quote 0
                            • D
                              Dax last edited by

                              root@raspberrypi:~# cd /opt/iobroker
                              root@raspberrypi:/opt/iobroker# node node_modules/iobroker.sql/main.js -—force -—logs                             
                              Cannot find module 'pg-native'
                              root@raspberrypi:/opt/iobroker#
                              
                              
                              1 Reply Last reply Reply Quote 0
                              • apollon77
                                apollon77 last edited by

                                Er findet das Postgres Modul nicht … interessant. SQL Adapter war korrekt und ohne Fehler installiert?

                                1 Reply Last reply Reply Quote 0
                                • D
                                  Dax last edited by

                                  ja soweit ich mich erinnern kann schon. soll ich mal neu installieren?

                                  1 Reply Last reply Reply Quote 0
                                  • apollon77
                                    apollon77 last edited by

                                    Mach mal 🙂

                                    1 Reply Last reply Reply Quote 0
                                    • D
                                      Dax last edited by

                                      So, hab den adapter jetzt neu installiert. Selber fehler cannot find module pg-negative.

                                      Hier der Install-Log:

                                      $ ./iobroker add sql
                                      npm install iobroker.sql --production --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.7 (node-v46 ABI) (falling back to source compile with node-gyp) 
                                      
                                      ../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_BeginOpen(node_sqlite3::Database::Baton*)’:../src/database.cc:144:9: warning: unused variable ‘status’ [-Wunused-variable]
                                           int status = uv_queue_work(uv_default_loop(),
                                               ^
                                      
                                      ../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_BeginClose(node_sqlite3::Database::Baton*)’:../src/database.cc:230:9: warning: unused variable ‘status’ [-Wunused-variable]
                                           int status = uv_queue_work(uv_default_loop(),
                                               ^
                                      
                                      ../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_BeginExec(node_sqlite3::Database::Baton*)’:../src/database.cc:525:9: warning: unused variable ‘status’ [-Wunused-variable]
                                           int status = uv_queue_work(uv_default_loop(),
                                               ^
                                      
                                      ../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_BeginLoadExtension(node_sqlite3::Database::Baton*)’:../src/database.cc:625:9: warning: unused variable ‘status’ [-Wunused-variable]
                                           int status = uv_queue_work(uv_default_loop(),
                                               ^
                                      
                                      ../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginPrepare(node_sqlite3::Database::Baton*)’:../src/statement.cc:118:9: warning: unused variable ‘status’ [-Wunused-variable]
                                           int status = uv_queue_work(uv_default_loop(),
                                               ^
                                      
                                      In file included from ../src/statement.cc:6:0:../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginBind(node_sqlite3::Statement::Baton*)’:
                                      ../src/macros.h:125:9: warning: unused variable ‘status’ [-Wunused-variable]
                                           int status = uv_queue_work(uv_default_loop(),                              \
                                               ^
                                      ../src/statement.cc:322:5: note: in expansion of macro ‘STATEMENT_BEGIN’
                                           STATEMENT_BEGIN(Bind);
                                           ^
                                      
                                      ../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginGet(node_sqlite3::Statement::Baton*)’:../src/macros.h:125:9: warning: unused variable ‘status’ [-Wunused-variable]
                                           int status = uv_queue_work(uv_default_loop(),                              \
                                               ^
                                      ../src/statement.cc:370:5: note: in expansion of macro ‘STATEMENT_BEGIN’
                                           STATEMENT_BEGIN(Get);
                                           ^
                                      
                                      ../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginRun(node_sqlite3::Statement::Baton*)’:../src/macros.h:125:9: warning: unused variable ‘status’ [-Wunused-variable]
                                           int status = uv_queue_work(uv_default_loop(),                              \
                                               ^
                                      ../src/statement.cc:438:5: note: in expansion of macro ‘STATEMENT_BEGIN’
                                           STATEMENT_BEGIN(Run);
                                           ^
                                      
                                      ../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginAll(node_sqlite3::Statement::Baton*)’:../src/macros.h:125:9: warning: unused variable ‘status’ [-Wunused-variable]
                                           int status = uv_queue_work(uv_default_loop(),                              \
                                               ^
                                      ../src/statement.cc:504:5: note: in expansion of macro ‘STATEMENT_BEGIN’
                                           STATEMENT_BEGIN(All);
                                           ^
                                      
                                      ../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginEach(node_sqlite3::Statement::Baton*)’:../src/macros.h:125:9: warning: unused variable ‘status’ [-Wunused-variable]
                                           int status = uv_queue_work(uv_default_loop(),                              \
                                               ^
                                      ../src/statement.cc:601:5: note: in expansion of macro ‘STATEMENT_BEGIN’
                                           STATEMENT_BEGIN(Each);
                                           ^
                                      
                                      ../src/statement.cc: In static member function ‘static void node_sqlite3::Statement::Work_BeginReset(node_sqlite3::Statement::Baton*)’:../src/macros.h:125:9: warning: unused variable ‘status’ [-Wunused-variable]
                                           int status = uv_queue_work(uv_default_loop(),                              \
                                               ^
                                      ../src/statement.cc:724:5: note: in expansion of macro ‘STATEMENT_BEGIN’
                                           STATEMENT_BEGIN(Reset);
                                           ^
                                      
                                      host.raspberrypi install adapter sql
                                      got /opt/iobroker/node_modules/iobroker.sql/admin
                                      upload [5] sql.admin /opt/iobroker/node_modules/iobroker.sql/admin/words.js words.js application/javascript
                                      upload [4] sql.admin /opt/iobroker/node_modules/iobroker.sql/admin/sql.png sql.png image/png
                                      upload [3] sql.admin /opt/iobroker/node_modules/iobroker.sql/admin/index_m.html index_m.html text/html
                                      upload [2] sql.admin /opt/iobroker/node_modules/iobroker.sql/admin/index.html index.html text/html
                                      upload [1] sql.admin /opt/iobroker/node_modules/iobroker.sql/admin/custom_m.html custom_m.html text/html
                                      upload [0] sql.admin /opt/iobroker/node_modules/iobroker.sql/admin/custom.html custom.html text/html
                                      host.raspberrypi object system.adapter.sql created
                                      host.raspberrypi object _design/custom created
                                      host.raspberrypi create instance sql
                                      host.raspberrypi object sql.0.info.connection created
                                      host.raspberrypi object sql.0.info created
                                      host.raspberrypi object system.adapter.sql.0.outputCount created
                                      host.raspberrypi object system.adapter.sql.0.inputCount created
                                      host.raspberrypi object system.adapter.sql.0.uptime created
                                      host.raspberrypi object system.adapter.sql.0.memRss created
                                      host.raspberrypi object system.adapter.sql.0.memHeapTotal created
                                      host.raspberrypi object system.adapter.sql.0.memHeapUsed created
                                      host.raspberrypi object system.adapter.sql.0.connected created
                                      host.raspberrypi object system.adapter.sql.0.alive created
                                      host.raspberrypi object system.adapter.sql.0 created
                                      process exited with code 0
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • apollon77
                                        apollon77 last edited by

                                        node -v

                                        npm -v

                                        ?

                                        1 Reply Last reply Reply Quote 0
                                        • D
                                          Dax last edited by

                                          node v4.8.7

                                          npm v2.15.11

                                          1 Reply Last reply Reply Quote 0
                                          • apollon77
                                            apollon77 last edited by

                                            Bei mir auch. interessant.

                                            Erstmal. Wenn ich deinen befehl von oben kopiere sind bei den "zwei Minuszeichen" eines irgendwie komisch. Tipp es am besten mal ab. Dann tut es auch bei mir. Irgendwie sind da wohl komische Zeichen rein gekommen!! vllt sind auch die leerzeichen komisch

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate
                                            FAQ Cloud / IOT
                                            HowTo: Node.js-Update
                                            HowTo: Backup/Restore
                                            Downloads
                                            BLOG

                                            376
                                            Online

                                            32.0k
                                            Users

                                            80.4k
                                            Topics

                                            1.3m
                                            Posts

                                            5
                                            38
                                            3861
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo