<div dir="ltr"><div>Hallo,</div><div><br></div><div>ich habe das Volkszaehler.img noch mal neu aufgespielt, jetzt funktioniert das anlegen der SQLite Datenbank.</div><div>Aber beim kopieren der Daten in die sqlite.db3 auf dem Rpi bekomme ich jetzt bei der Data Tabelle einen fehler</div><div><br></div><div> <span style="color:rgb(180,95,6)"> /var/www/<a href="http://volkszaehler.org/vendor/bin/dbcopy">volkszaehler.org/vendor/bin/dbcopy</a> copy -c /etc/dbcopy1.yaml<br>entities: copying 1 rows (overwrite)<br> [============================] 100%  < 1 sec/< 1 sec  1 rows<br><br>properties: copying 7 rows (overwrite)<br> [============================] 100%  < 1 sec/< 1 sec  7 rows<br><br>entities_in_aggregator: copying 0 rows (overwrite)<br>    0 [->--------------------------] < 1 sec 6.0 MiB<br><br><br>In CopyCommand.php line 40:<br><br>  <span style="color:rgb(204,0,0)">Table data doesn't have a simple primary key</span><br><br></span></div><div>mfg Sven<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am So., 7. Aug. 2022 um 18:19 Uhr schrieb dies und das <<a href="mailto:6ecoopen@googlemail.com">6ecoopen@googlemail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hallo,</div><div><br></div><div>ich möchte dbcopy verwenden, zum Testen habe ich das aktuelle Volkszäher.img auf einem Rpi2 installiert</div><div>um Werte in die Datenbank zubekommen ist aktuell ein 1-Wire Temperatursensor angeschlossen.</div><div><br></div><div>Als Backup Ziel soll mein Win-Homserver dienen auf diesem läuft eine Virtuelle Maschine mit einer Aktuellen Debian-11.4.0 Installation, MariaDB-Server ist installiert, vz-admin mit rechten und Test-Datenbank (pi-test) sind angelegt.</div><div><br></div><div>Vom Testsystem (rpi2) kann ich mich mit dem Server verbinden</div><div><span style="color:rgb(180,95,6)">mysql -h 192.168.178.23 -uvz-admin -p1234 pi-test</span>
</div><div><br></div><div>Hier <a href="https://wiki.volkszaehler.org/software/tools/dbcopy" target="_blank">https://wiki.volkszaehler.org/software/tools/dbcopy</a></div><div>ist beschrieben dass 
In der Standardinstallation dbcopy direkt nutzbar ist.</div><div>War mir nicht sicher also habe ich folgenden Befehl noch ausgeführt.<br><pre><span style="color:rgb(180,95,6)">sudo chmod +x /var/www/<a href="http://volkszaehler.org/vendor/bin/dbcopy" target="_blank">volkszaehler.org/vendor/bin/dbcopy</a><br>
sudo cp /var/www/<a href="http://volkszaehler.org/etc/dbcopy.dist.yaml" target="_blank">volkszaehler.org/etc/dbcopy.dist.yaml</a> /etc/dbcopy.yaml

sudo nano /etc/dbcopy.yaml

<span># DATABASE DEFINITION</span><span>
source</span>:<span>
  driver</span><span>: </span>pdo_mysql<span>
  host</span><span>: </span>localhost<span>
  user</span><span>: </span>vz<span>
  password</span><span>: </span>demo<span>
  dbname</span><span>: </span>volkszaehler
<span>
target</span>:<span>
  driver</span><span>: pdo_mysql</span><span>
  host</span><span>: </span>192.168.178.23<span>
  user</span><span>: vz-admin</span><span>
  password</span><span>:1234 </span><span>
  dbname</span><span>: </span>pi-test<span>
#  path</span><span>: </span>sqlite.db3               <span># path is only used if driver = pdo_sqlite</span>
 
<span># influxdb target database connection</span><span>
influx</span>:<span>
  dsn</span><span>: </span>influxdb://localhost:8086<span>
  dbname</span><span>: </span>volkszaehler<span>
  measurement</span><span>: </span>data
 
<span># TABLE DEFINITION</span>
<span># ----------------</span>
<span># tables will be processed in the order they are mentioned:</span>
<span>#           - foreign keys on target will be dropped</span>
<span>#           - if a table is not listed here, it will not be touched</span>
<span># transfer mode</span>
<span>#           skip:           table will not be copied</span>
<span>#           copy:           entire table will be truncated on target and copied from source</span>
<span>#           pk:                     selective copy by primary key. only data not present on target</span>
<span>#                                   will be copied from source.</span><span>
tables</span>:<span>
  entities</span><span>: </span>copy<span>
  properties</span><span>: </span>copy<span>
  entities_in_aggregator</span><span>: </span>copy<span>
  data</span><span>: </span>pk<span>
  aggregate</span><span>: </span>skip</span>

<span style="font-family:arial,sans-serif"><font size="2">Nächster Schritt Zieldatenbank erstellen mit</font><br></span>
<span style="color:rgb(180,95,6)"><span style="background-color:rgb(243,243,243)">/var/www/<a href="http://volkszaehler.org/vendor/bin/dbcopy" target="_blank">volkszaehler.org/vendor/bin/dbcopy</a> create -c /etc/dbcopy.yaml
</span></span><br></pre><pre><font face="arial,sans-serif">Hier bekomme ich folgende Fehlermeldung <br><br><span style="color:rgb(120,63,4)">Creating target schema<br>Creating tables<br>PHP Fatal error:  Uncaught Error: Class 'Doctrine\DBAL\Schema\Synchronizer\SingleDatabaseSynchronizer' not found in /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/src/Command/CreateCommand.php:151" target="_blank">volkszaehler.org/vendor/andig/dbcopy/src/Command/CreateCommand.php:151</a><br>Stack trace:<br>#0 /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Command/Command.php(298)" target="_blank">volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Command/Command.php(298)</a>: DatabaseCopy\Command\CreateCommand->execute()<br>#1 /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Application.php(1024)" target="_blank">volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Application.php(1024)</a>: Symfony\Component\Console\Command\Command->run()<br>#2 /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Application.php(299)" target="_blank">volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Application.php(299)</a>: Symfony\Component\Console\Application->doRunCommand()<br>#3 /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Application.php(171)" target="_blank">volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Application.php(171)</a>: Symfony\Component\Console\Application->doRun()<br>#4 /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/dbcopy(35)" target="_blank">volkszaehler.org/vendor/andig/dbcopy/dbcopy(35)</a>: Symfony\Component\Console\Application->run()<br>#5 /home/pi/<a href="http://volkszaehler.org/vendor/bin/dbcopy(112)" target="_blank">volkszaehler.org/vendor/bin/dbcopy(112)</a>: include('/home/pi/volksz...')<br>#6 {main}<br>  thrown in /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/src/Command/CreateCommand.php" target="_blank">volkszaehler.org/vendor/andig/dbcopy/src/Command/CreateCommand.php</a> on line 151<br>pi@pi-Test:~ $<br></span></font></pre><pre><font face="arial,sans-serif">Ich habe dann mit HeidiSQL das Datenbankschema vom Pi exportiert (ohne Daten) und auf dem Server importiert<br></font></pre><img src="cid:ii_l6jio4g20" alt="pi-test.JPG" width="471" height="408"><br><pre><font face="arial,sans-serif"><span style="color:rgb(180,95,6)"><span style="font-family:monospace">pi@pi-Test:~ $ /var/www/<a href="http://volkszaehler.org/vendor/bin/dbcopy" target="_blank">volkszaehler.org/vendor/bin/dbcopy</a> copy -c /etc/dbcopy.yaml<br>Dropping FK FK_87C331C781257D5D on properties<br>Dropping FK FK_2BD88468DD62C21B on entities_in_aggregator<br>Dropping FK FK_2BD88468727ACA70 on entities_in_aggregator<br>Dropping FK FK_ADF3F36372F5A1AA on data<br>Dropping FK FK_B77949FF72F5A1AA on aggregate<br>entities: copying PHP Fatal error:  Uncaught Error: Call to undefined method Doctrine\DBAL\Connection::fetchColumn() in /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/src/Command/CopyCommand.php:116" target="_blank">volkszaehler.org/vendor/andig/dbcopy/src/Command/CopyCommand.php:116</a><br>Stack trace:<br>#0 /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/src/Command/CopyCommand.php(223)" target="_blank">volkszaehler.org/vendor/andig/dbcopy/src/Command/CopyCommand.php(223)</a>: DatabaseCopy\Command\CopyCommand->copyTable()<br>#1 /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Command/Command.php(298)" target="_blank">volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Command/Command.php(298)</a>: DatabaseCopy\Command\CopyCommand->execute()<br>#2 /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Application.php(1024)" target="_blank">volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Application.php(1024)</a>: Symfony\Component\Console\Command\Command->run()<br>#3 /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Application.php(299)" target="_blank">volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Application.php(299)</a>: Symfony\Component\Console\Application->doRunCommand()<br>#4 /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Application.php(171)" target="_blank">volkszaehler.org/vendor/andig/dbcopy/vendor/symfony/console/Application.php(171)</a>: Symfony\Component\Console\Application->doRun()<br>#5 /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/dbcopy(35)" target="_blank">volkszaehler.org/vendor/andig/dbcopy/dbcopy(35)</a>: Symfony\Component\Console\Application->run()<br>#6 /home/pi/<a href="http://volkszaehler.org/vendor/bin" target="_blank">volkszaehler.org/vendor/bin</a> in /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/src/Command/CopyCommand.php" target="_blank">volkszaehler.org/vendor/andig/dbcopy/src/Command/CopyCommand.php</a> on line 116<br>pi@pi-Test:~ $</span></span><br><br><br></font></pre><pre><font face="arial,sans-serif">Ok dachte ich mir hier kommst nicht weiter also habe ich es so wie in der o.g. Anleitung versucht.<br></font></pre><pre><font face="arial,sans-serif">Auf dem Rpi also Sqlite installiert die <span style="color:rgb(180,95,6)">/etc/dbcopy.yaml <font color="#000000">angepasst.</font></span>
<span style="color:rgb(180,95,6)"><span style="font-family:monospace">target:</span></span><br><span style="color:rgb(180,95,6)"><span style="font-family:monospace">  driver: pdo_sqlite<br>  host: localhost<br>  user: vz-admin<br>  password: secure<br>  dbname: volkszaehler_backup<br>  path: /home/pi/pi-test.db3</span></span>       <br><br></font></pre><pre><font face="arial,sans-serif">Nach Eingabe von 
<span style="color:rgb(180,95,6)">/var/www/<a href="http://volkszaehler.org/vendor/bin/dbcopy" target="_blank">volkszaehler.org/vendor/bin/dbcopy</a> create -c /etc/dbcopy.yaml</span>
kommt der Fehler
<span style="color:rgb(180,95,6)"><span style="font-family:monospace">pi@pi-Test:~ $ /var/www/<a href="http://volkszaehler.org/vendor/bin/dbcopy" target="_blank">volkszaehler.org/vendor/bin/dbcopy</a> create -c /etc/dbcopy.yaml<br>Creating target schema<br><br>In Exception.php line 22:<br><br>  Operation 'Doctrine\DBAL\Platforms\AbstractPlatform::getListDatabasesSQL' is not supported by platform.<br><br>create [-c|--config CONFIG]<br><br>pi@pi-Test:~ $<br></span></span><br></font></pre><pre><font face="arial,sans-serif">ich habe Tante G befragt aber nichts gefunden was mir hilft.<br></font></pre><pre><font face="arial,sans-serif">Würde mich freuen wenn mir jemand helfen könnte das Problem zu lösen erst mal egal welchen Ansatz, Server mit Mariadb oder lokal mit Sqlite<br><br></font></pre><pre><font face="arial,sans-serif">mfg <br></font></pre><pre><font face="arial,sans-serif">Sven
</font></pre></div></div>
</blockquote></div>