<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Nur Text Zchn";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
span.E-MailFormatvorlage17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.NurTextZchn
{mso-style-name:"Nur Text Zchn";
mso-style-priority:99;
mso-style-link:"Nur Text";
font-family:"Calibri","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoPlainText>Hallo,<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>aktuell läuft eine komplette VZ-Installation auf einem Raspi3 mit µSD. Ich möchte DB, Frontend und Middleware auf einen weiteren Raspi4 mit SSD auslagern.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Die DB-Struktur hat sich zwischenzeitig geändert. Die alte, automatisch vergebene fortlaufende ID ist entfallen und der primary key ist nun die Kombination aus channel_id und timestamp.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm'><p class=MsoPlainText style='border:none;padding:0cm'>Ich habe als Probelauf die DB auf meinem Test-/Spielsystem auf die neue Struktur konvertiert. Das hat funktioniert. Ich kann auf alle Daten zugreifen und auch über die API manuell Daten schreiben.<o:p></o:p></p><p class=MsoPlainText style='border:none;padding:0cm'><o:p> </o:p></p></div><p class=MsoPlainText><span lang=EN-US>MariaDB [volkszaehler]> show columns from data;<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>+------------+------------+------+-----+---------+-------+<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>| Field | Type | Null | Key | Default | Extra |<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>+------------+------------+------+-----+---------+-------+<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>| channel_id | int(11) | NO | PRI | NULL | |<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>| timestamp | bigint(20) | NO | PRI | NULL | |<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>| value | double | NO | | NULL | |<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US>+------------+------------+------+-----+---------+-------+<o:p></o:p></span></p><div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm'><p class=MsoPlainText style='border:none;padding:0cm'><span lang=EN-US>3 rows in set (0.028 sec)<o:p></o:p></span></p></div><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText>Nun wollte ich die DB mittel dbcopy in eine SQLite DB sichern um sie auf den Raspi4 einzuspielen. <span lang=EN-US>Da meckert dbcopy das es keinen simple primary key in data findet…<o:p></o:p></span></p><div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm'><p class=MsoPlainText style='border:none;padding:0cm'><span lang=EN-US><o:p> </o:p></span></p></div><p class=MsoPlainText><span lang=EN-US>entities: copying 11 rows (overwrite)<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> [============================] 100% < 1 sec/< 1 sec 11 rows<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>properties: copying 90 rows (overwrite)<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> [============================] 100% < 1 sec/< 1 sec 90 rows<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>entities_in_aggregator: copying 0 rows (overwrite)<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US> 0 [->--------------------------] < 1 sec 6.0 MiB<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US>In CopyCommand.php line 40:<o:p></o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm'><p class=MsoPlainText style='border:none;padding:0cm'><span lang=EN-US> <span style='background:red;mso-highlight:red'>Table data doesn't have a simple primary key</span><o:p></o:p></span></p></div><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p><p class=MsoPlainText>Wie bekomme ich dbcopy erklärt das es nun channel_id und timestamp als primary key verwenden soll?<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Viele Grüße<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Micha<o:p></o:p></p></div></body></html>