<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">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 class="gmail-code"><span style="color:rgb(180,95,6)">sudo chmod +x /var/www/<a href="http://volkszaehler.org/vendor/bin/dbcopy">volkszaehler.org/vendor/bin/dbcopy</a><br>
sudo cp /var/www/<a href="http://volkszaehler.org/etc/dbcopy.dist.yaml">volkszaehler.org/etc/dbcopy.dist.yaml</a> /etc/dbcopy.yaml

sudo nano /etc/dbcopy.yaml

<span class="gmail-co1"># DATABASE DEFINITION</span><span class="gmail-co4">
source</span>:<span class="gmail-co3">
  driver</span><span class="gmail-sy2">: </span>pdo_mysql<span class="gmail-co3">
  host</span><span class="gmail-sy2">: </span>localhost<span class="gmail-co3">
  user</span><span class="gmail-sy2">: </span>vz<span class="gmail-co3">
  password</span><span class="gmail-sy2">: </span>demo<span class="gmail-co3">
  dbname</span><span class="gmail-sy2">: </span>volkszaehler
<span class="gmail-co4">
target</span>:<span class="gmail-co3">
  driver</span><span class="gmail-sy2">: pdo_mysql</span><span class="gmail-co3">
  host</span><span class="gmail-sy2">: </span>192.168.178.23<span class="gmail-co3">
  user</span><span class="gmail-sy2">: vz-admin</span><span class="gmail-co3">
  password</span><span class="gmail-sy2">:1234 </span><span class="gmail-co3">
  dbname</span><span class="gmail-sy2">: </span>pi-test<span class="gmail-co3">
#  path</span><span class="gmail-sy2">: </span>sqlite.db3           <span class="gmail-co1"># path is only used if driver = pdo_sqlite</span>
 
<span class="gmail-co1"># influxdb target database connection</span><span class="gmail-co4">
influx</span>:<span class="gmail-co3">
  dsn</span><span class="gmail-sy2">: </span>influxdb://localhost:8086<span class="gmail-co3">
  dbname</span><span class="gmail-sy2">: </span>volkszaehler<span class="gmail-co3">
  measurement</span><span class="gmail-sy2">: </span>data
 
<span class="gmail-co1"># TABLE DEFINITION</span>
<span class="gmail-co1"># ----------------</span>
<span class="gmail-co1"># tables will be processed in the order they are mentioned:</span>
<span class="gmail-co1">#               - foreign keys on target will be dropped</span>
<span class="gmail-co1">#               - if a table is not listed here, it will not be touched</span>
<span class="gmail-co1"># transfer mode</span>
<span class="gmail-co1">#               skip:           table will not be copied</span>
<span class="gmail-co1">#               copy:           entire table will be truncated on target and copied from source</span>
<span class="gmail-co1">#               pk:                     selective copy by primary key. only data not present on target</span>
<span class="gmail-co1">#                                       will be copied from source.</span><span class="gmail-co4">
tables</span>:<span class="gmail-co3">
  entities</span><span class="gmail-sy2">: </span>copy<span class="gmail-co3">
  properties</span><span class="gmail-sy2">: </span>copy<span class="gmail-co3">
  entities_in_aggregator</span><span class="gmail-sy2">: </span>copy<span class="gmail-co3">
  data</span><span class="gmail-sy2">: </span>pk<span class="gmail-co3">
  aggregate</span><span class="gmail-sy2">: </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">volkszaehler.org/vendor/bin/dbcopy</a> create -c /etc/dbcopy.yaml
</span></span><br></pre><pre class="gmail-code"><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">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)">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)">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)">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)">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)">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)">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">volkszaehler.org/vendor/andig/dbcopy/src/Command/CreateCommand.php</a> on line 151<br>pi@pi-Test:~ $<br></span></font></pre><pre class="gmail-code"><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 class="gmail-code"><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">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">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)">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)">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)">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)">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)">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)">volkszaehler.org/vendor/andig/dbcopy/dbcopy(35)</a>: Symfony\Component\Console\Application->run()<br>#6 /home/pi/<a href="http://volkszaehler.org/vendor/bin">volkszaehler.org/vendor/bin</a> in /home/pi/<a href="http://volkszaehler.org/vendor/andig/dbcopy/src/Command/CopyCommand.php">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 class="gmail-code"><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 class="gmail-code"><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 class="gmail-code"><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">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">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 class="gmail-code"><font face="arial,sans-serif">ich habe Tante G befragt aber nichts gefunden was mir hilft.<br></font></pre><pre class="gmail-code"><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 class="gmail-code"><font face="arial,sans-serif">mfg <br></font></pre><pre class="gmail-code"><font face="arial,sans-serif">Sven
</font></pre></div></div>