From b9c5de0187fe842c4956d8053e668e8a06db971f Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Sun, 5 Feb 2023 17:31:57 +0000 Subject: [PATCH] configDB: add debug option to support migration problems git-svn-id: https://svn.fhem.de/fhem/trunk@27183 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_configdb.pm | 1 + fhem/configDB.pm | 2 ++ 2 files changed, 3 insertions(+) diff --git a/fhem/FHEM/98_configdb.pm b/fhem/FHEM/98_configdb.pm index adbcd77f6..18561ce85 100644 --- a/fhem/FHEM/98_configdb.pm +++ b/fhem/FHEM/98_configdb.pm @@ -185,6 +185,7 @@ sub CommandConfigdb { when ('migrate') { return "\n Migration not possible. Already running with configDB!" if $configfile eq 'configDB'; + $data{cfgDB_debug} = 1 if (lc($param1) eq 'debug'); Log3('configdb', 4, "configdb: migration requested."); $ret = _cfgDB_Migrate; } diff --git a/fhem/configDB.pm b/fhem/configDB.pm index 61887fc87..1d7b8c25b 100644 --- a/fhem/configDB.pm +++ b/fhem/configDB.pm @@ -525,6 +525,7 @@ sub cfgDB_SaveCfg { ## prototype used in fhem.pl $t = localtime; $out = "#created $t"; push @rowList, $out; + Debug "\n".join("\n",@rowList) if defined($data{cfgDB_debug}); return @rowList if defined($data{cfgDB_rawList}); # Insert @rowList into database table @@ -751,6 +752,7 @@ sub _cfgDB_Connect { # add configuration entry into fhemconfig sub _cfgDB_InsertLine { my ($fhem_dbh, $uuid, $line, $counter) = @_; + Log 0, "configDB: $line" if defined($data{cfgDB_debug}); my ($c,$d,$p1,$p2) = split(/ /, $line, 4); my $sth = $fhem_dbh->prepare('INSERT INTO fhemconfig values (?, ?, ?, ?, ?, ?)'); $sth->execute($c, $d, $p1, $p2, $counter, $uuid);