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.
    • 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
          • D
            Dax last edited by

            Aja super, jetzt hat er gestartet. zwar auch mit der fehlermeldung aber danach lief sql an. Und jetzt läuft der Converter grad durch 🙂

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

              Na dann warten wir mal was der nächste Crash sagt (falls einer kommt)

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

                Hmm zu früh gefreut. Erst kamen jede Menge fehler

                { [Error: connect ETIMEDOUT]
                  errorno: 'ETIMEDOUT',
                  code: 'ETIMEDOUT',
                  syscall: 'connect',
                  fatal: true }
                

                und jetzt

                { [Error: Connection lost: The server closed the connection.] fatal: true, code: 'PROTOCOL_CONNECTION_LOST' }
                Reconnection to DB.
                Reconnection to DB.
                root@raspberrypi:/opt/iobroker#
                
                1 Reply Last reply Reply Quote 0
                • apollon77
                  apollon77 last edited by

                  Bitte schick mal komplett. Nicht nur auszüge

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

                    Hallo, bin sch 3x umgezogen!

                    Zuerst von XS1 (FS20 protokoll auf SD-Karte) auf den History-Adapter -> auf MySQL -> PostgreSQL wo ich nun seit 1 Jahr bin, nur vom Raspi auf opi2e und dann noch auf einen CSL-NUK umgezogen.

                    Postgres braucht weniger ressourcen und ist meiner Meinung scheller. AUf dem Raspi war das ein Problem da dort der Speicher sehr langsam ist (egal ob SD oder USB), und außerdem .

                    Es gibt ein nettes admin-tool für PostgreSQL, pgAdmin (https://www.pgadmin.org/download/) mit dem ich auf die verschiedenen DB's an den Test-Rechnern oder am Echtzeitsystem zugreifen kann.

                    Momentan hab ich ca 2,2 Millionen Datenpunkte im ts_numbers (und noch mal 200k in ts_bool und ts_string), Daten die teilweise bis 5 Jahre zurückreichen.

                    Wichtig, hab mir ein kleines script geschrieben (hatte das auch auf MySQL) welches ein Backup von ioBroker und ein Backup (dump) der SQL erzeugt und speichere das wöchentlich auf das NAS.

                    Bei MySQL war das

                    sudo mysqldump -uroot -ppi --all-databases ...
                    

                    Jetzt bei PostgreSQL

                    sudo -u postgres pg_dump iobroker | gzip > /mnt/nas/.../postgres.backup.$(date '+%Y%m%d').sql.gz
                    

                    iobroker wird mit

                    BFILE=`sudo iobroker backup | cut -d " " -f 3`
                    cp -v $BFILE /mnt/nas/.../
                    
                    

                    ins gleiche Verzeichnis gespeichert.

                    Das SQL Backup ist bei mir mit gzip momentan 18MB, iobroker ~1MB.

                    Diese Methode hat mir schon mal das Leben (die Daten) gerettet da mir am Raspi eine SD und später auch ein USB-Stick abgeschmiert ist. Das war der Grund warum ich dann auf opi2e und später auf den NUK (alles unter Linux) umgestiegen bin da diese MMC's als Speicher haben.

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

                      { [Error: connect ETIMEDOUT]
                        errorno: 'ETIMEDOUT',
                        code: 'ETIMEDOUT',
                        syscall: 'connect',
                        fatal: true }
                      { [Error: connect ETIMEDOUT]
                        errorno: 'ETIMEDOUT',
                        code: 'ETIMEDOUT',
                        syscall: 'connect',
                        fatal: true }
                      { [Error: connect ETIMEDOUT]
                        errorno: 'ETIMEDOUT',
                        code: 'ETIMEDOUT',
                        syscall: 'connect',
                        fatal: true }
                      { [Error: connect ETIMEDOUT]
                        errorno: 'ETIMEDOUT',
                        code: 'ETIMEDOUT',
                        syscall: 'connect',
                        fatal: true }
                      Datatype hm-rega.0.3650: Currently: number, StorageType: Number
                      INSERT INTO `iobroker`.ts_number (id, ts, val, ack, _from, q) VALUES(1, 1518537565661, 0, 1, 1, 0);
                      new value received for hm-rega.0.3650, new-value=0.3, ts=1518537581242, relog=false
                      Min-Delta reached hm-rega.0.3650, last-value=0, new-value=0.3, ts=1518537581242
                      new value received for hm-rega.0.3650, new-value=0.4, ts=1518537585291, relog=false
                      Min-Delta reached hm-rega.0.3650, last-value=0.3, new-value=0.4, ts=1518537585291
                      new value received for hm-rega.0.2477, new-value=0.2, ts=1518537587246, relog=false
                      Min-Delta reached hm-rega.0.2477, last-value=0, new-value=0.2, ts=1518537587246
                      new value received for hm-rega.0.3650, new-value=0.5, ts=1518537587261, relog=false
                      Min-Delta reached hm-rega.0.3650, last-value=0.4, new-value=0.5, ts=1518537587261
                      new value received for hm-rega.0.16972, new-value=27.3, ts=1518537587261, relog=false
                      Min-Delta reached hm-rega.0.16972, last-value=27.2, new-value=27.3, ts=1518537587261
                      new value received for hm-rega.0.3650, new-value=0.7, ts=1518537591260, relog=false
                      Min-Delta reached hm-rega.0.3650, last-value=0.5, new-value=0.7, ts=1518537591260
                      new value received for hm-rega.0.3650, new-value=0.6, ts=1518537593263, relog=false
                      Min-Delta reached hm-rega.0.3650, last-value=0.7, new-value=0.6, ts=1518537593263
                      new value received for hm-rega.0.3650, new-value=0.5, ts=1518537595256, relog=false
                      Min-Delta reached hm-rega.0.3650, last-value=0.6, new-value=0.5, ts=1518537595256
                      new value received for hm-rega.0.3650, new-value=0.6, ts=1518537599251, relog=false
                      Min-Delta reached hm-rega.0.3650, last-value=0.5, new-value=0.6, ts=1518537599251
                      new value received for hm-rega.0.3650, new-value=0.7, ts=1518537601267, relog=false
                      Min-Delta reached hm-rega.0.3650, last-value=0.6, new-value=0.7, ts=1518537601267
                      new value received for hm-rega.0.3650, new-value=0.6, ts=1518537607279, relog=false
                      Min-Delta reached hm-rega.0.3650, last-value=0.7, new-value=0.6, ts=1518537607279
                      new value received for hm-rpc.0.MEQ0690418.1.FILLING_LEVEL, new-value=100, ts=1518537607722, relog=false
                      value not changed hm-rpc.0.MEQ0690418.1.FILLING_LEVEL, last-value=100, new-value=100, ts=1518537607722
                      new value received for hm-rega.0.3650, new-value=0.5, ts=1518537609267, relog=false
                      Min-Delta reached hm-rega.0.3650, last-value=0.6, new-value=0.5, ts=1518537609267
                      new value received for hm-rega.0.3650, new-value=0.6, ts=1518537611280, relog=false
                      Min-Delta reached hm-rega.0.3650, last-value=0.5, new-value=0.6, ts=1518537611280
                      Datatype hm-rega.0.2477: Currently: number, StorageType: Number
                      INSERT INTO `iobroker`.ts_number (id, ts, val, ack, _from, q) VALUES(2, 1518537587246, 0.2, 1, 1, 0);
                      Datatype hm-rega.0.16972: Currently: number, StorageType: Number
                      INSERT INTO `iobroker`.ts_number (id, ts, val, ack, _from, q) VALUES(4, 1518537587261, 27.3, 1, 1, 0);
                      Datatype hm-rega.0.3650: Currently: number, StorageType: Number
                      INSERT INTO `iobroker`.ts_number (id, ts, val, ack, _from, q) VALUES(1, 1518537611280, 0.6, 1, 1, 0);
                      { [Error: Connection lost: The server closed the connection.] fatal: true, code: 'PROTOCOL_CONNECTION_LOST' }
                      Reconnection to DB.
                      Reconnection to DB.
                      root@raspberrypi:/opt/iobroker#
                      
                      1 Reply Last reply Reply Quote 0
                      • apollon77
                        apollon77 last edited by

                        Also mein Tipp ist das die Mysql die Verbindung geschlossen hat. Schau mal ob das MySQL Log irgendwas hergibt. Ansonsten nutze mal die Parameter um die Geschwindigkeit etwas zu verlangsamen von dem Skript

                        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

                        849
                        Online

                        32.0k
                        Users

                        80.5k
                        Topics

                        1.3m
                        Posts

                        5
                        38
                        3887
                        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