[vz-users] Volkszähler auf virtueller Maschine

dies und das 6ecoopen at googlemail.com
Di Dez 31 17:54:27 CET 2019


Hallo Andreas,

vielen Dank für die schnelle Antwort, ich dachte das create steht im sinne
für create backup
habe jetzt nochmal den Artikel gelesen und den befehl korrigiert sieht
schon besser aus bekomme aber jetzt einen anderen Fehler

pi at raspberrypi:~ $ sudo /var/www/volkszaehler.org/vendor/bin/dbcopy.php
backup -c /etc/dbcopy.json
Dropping FK FK_87C331C781257D5D on properties
Dropping FK FK_2BD88468727ACA70 on entities_in_aggregator
Dropping FK FK_2BD88468DD62C21B on entities_in_aggregator
Dropping FK FK_ADF3F36372F5A1AA on data
entities: copying 0 rows (partial copy)
    0 [>---------------------------] < 1 sec 4.0 MiB

properties: copying 0 rows (partial copy)
    0 [>---------------------------] < 1 sec 4.0 MiB


In BackupCommand.php line 38:

  Table entities_in_aggregator doesn't have a simple primary key


backup [-c|--config CONFIG] [-b|--batch BATCH] [-k|--keep-constraints] [--]
[<tables>]...

Gruß, Sven

Am Di., 31. Dez. 2019 um 17:37 Uhr schrieb Andreas Goetz <cpuidle at gmail.com
>:

> Hi Sven,
>
> “create” legt das Datenbankschema im Ziel an. Die Fehlermeldung dazu ist
> eindeutig:
>
> SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'aggregate'
> already exists
>
>
> Die Tabellen gibt es also schon- Du brauchst kein “create” mehr.
>
> Viele Grüße, Andreas
>
> On 31. Dec 2019, at 17:33, dies und das <6ecoopen at googlemail.com> wrote:
>
> Hallo,
>
> Problem ist gelöst es funktioniert mit 2 Kanälen und gleicher uuid.
> Nach Stunden des rumprobierens dachte ich machste mal einen reboot des
> Raspberry und siehe da es läuft.
>
> Da mit jetzt ein paar daten fehlen wollte ich mal dbcopy ausprobieren um
> die Datenbanken zwischen Raspberry und dem Virtuellen System abzugleichen
> und bin dieser https://wiki.volkszaehler.org/software/tools/dbcopy
> Anleitung gefolgt.
> Im Vorfeld habe ich die Rechte von vz-admin und Mariadb config für
> externen zugriff angepasst (mysqldump funktioniert).
> Wenn ich den Abgleich der Datenbanken mit
> /var/www/volkszaehler.org/vendor/bin/dbcopy.php create -c /etc/dbcopy.json
> starte bekomme ich Fehlermeldungen ich bin da nicht so versiert und kann
> damit nichts anfangen
> würde mich freuen wenn mir da jemand weiterhelfen könnte.
>
> Hier noch der Auszug aus dem Terminal und im Anhang die dbcopy.json :
>
> pi at raspberrypi:~ $ sudo /var/www/volkszaehler.org/vendor/bin/dbcopy.php
> create -c /etc/dbcopy.json
> Creating target schema
> Creating tables
> CREATE TABLE aggregate (id INT AUTO_INCREMENT NOT NULL, channel_id INT NOT
> NULL, type TINYINT(1) NOT NULL, timestamp BIGINT NOT NULL, value DOUBLE
> PRECISION NOT NULL, count INT NOT NULL, UNIQUE INDEX ts_uniq (channel_id,
> type, timestamp), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE
> utf8_unicode_ci ENGINE = InnoDB
> CREATE TABLE data (id INT AUTO_INCREMENT NOT NULL, channel_id INT DEFAULT
> NULL, timestamp BIGINT NOT NULL, value DOUBLE PRECISION NOT NULL, UNIQUE
> INDEX data_unique (channel_id, timestamp), INDEX IDX_ADF3F36372F5A1AA
> (channel_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE
> utf8_unicode_ci ENGINE = InnoDB
> CREATE TABLE entities (id INT AUTO_INCREMENT NOT NULL, uuid VARCHAR(36)
> NOT NULL COLLATE utf8_unicode_ci, type VARCHAR(255) NOT NULL COLLATE
> utf8_unicode_ci, class VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci,
> UNIQUE INDEX UNIQ_50EC64E5D17F50A6 (uuid), PRIMARY KEY(id)) DEFAULT
> CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
> CREATE TABLE entities_in_aggregator (parent_id INT NOT NULL, child_id INT
> NOT NULL, INDEX IDX_2BD88468727ACA70 (parent_id), INDEX
> IDX_2BD88468DD62C21B (child_id), PRIMARY KEY(parent_id, child_id)) DEFAULT
> CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
> CREATE TABLE properties (id INT AUTO_INCREMENT NOT NULL, entity_id INT
> DEFAULT NULL, pkey VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, value
> LONGTEXT NOT NULL COLLATE utf8_unicode_ci, UNIQUE INDEX property_unique
> (entity_id, pkey), INDEX IDX_87C331C781257D5D (entity_id), PRIMARY KEY(id))
> DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
> ALTER TABLE data ADD CONSTRAINT FK_ADF3F36372F5A1AA FOREIGN KEY
> (channel_id) REFERENCES entities (id)
> ALTER TABLE entities_in_aggregator ADD CONSTRAINT FK_2BD88468727ACA70
> FOREIGN KEY (parent_id) REFERENCES entities (id)
> ALTER TABLE entities_in_aggregator ADD CONSTRAINT FK_2BD88468DD62C21B
> FOREIGN KEY (child_id) REFERENCES entities (id)
> ALTER TABLE properties ADD CONSTRAINT FK_87C331C781257D5D FOREIGN KEY
> (entity_id) REFERENCES entities (id)
> In AbstractMySQLDriver.php line 49:
>
>   An exception occurred while executing 'CREATE TABLE aggregate (id INT
> AUTO_INCREMENT NOT NULL, channel_id INT NOT NULL, type TINYINT(1) NOT NULL,
> timestamp BIGINT NOT NULL, value DOUBLE PRECISION NOT NULL, count INT NOT
> NULL, UNIQUE
>    INDEX ts_uniq (channel_id, type, timestamp), PRIMARY KEY(id)) DEFAULT
> CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB':
>
>   SQLSTATE[42S01]: Base table or view already exists: 1050 Table
> 'aggregate' already exists
>
>
> In PDOConnection.php line 59:
>
>   SQLSTATE[42S01]: Base table or view already exists: 1050 Table
> 'aggregate' already exists
>
>
> In PDOConnection.php line 57:
>
>   SQLSTATE[42S01]: Base table or view already exists: 1050 Table
> 'aggregate' already exists
>
>
> create [-c|--config CONFIG]
>
> Mit freundlichen Grüßen und einen guten Rutsch ins neue Jahr
>
> Sven
>
> Am Mo., 30. Dez. 2019 um 21:12 Uhr schrieb Daniel Lauckner <vz at jahp.de>:
>
>> Hallo,
>>
>>
>> am Montag, 30. Dezember 2019 um 20:18 hat dies und das geschrieben:
>> > nur habe ich
>> > keine Ahnung welchen Port ich da freigeben müsste.
>>
>> Webserver: Port 80.
>>
>> mfg Daniel
>>
>> <dbcopy.json>
>
>
>
-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: <http://demo.volkszaehler.org/pipermail/volkszaehler-users/attachments/20191231/99ea8da9/attachment.html>


More information about the volkszaehler-users mailing list