You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a small bug in the converter/history2db.js which prevents some datapoints to be converted.
I converted a history.0 to a sql.0 instance (MSSQL-Server) with your script and most but not all datapoints were converted. So I searched for the reason why some datapoints were missing in SQL. The script said for example:
Ignore ID history.smartmeter.0.1-0~2_8_0__255.value.json: smartmeter.0.1-0~2_8_0__255.value
The datapoint-name in ioBroker and also SQL for this datapoint is
smartmeter.0.1-0:2_8_0__255.value but the filename is: smartmeter.0.1-0~2_8_0__255.value.json
So the history-instance replaces ":" chars in filenames with "~" chars because ":" aren't allowed in filenames. But the converter script don't take these replaced chars into account.
As a quick and dirty workaround I changed line 198 from
const id = file.substring(8, file.length - 5);
to
const id = file.substring(8, file.length - 5).replace('~', ':');
which worked for me. But I am not sure if other illegal file name chars can cause the same problem so this shouldn't be a general solution.
Regards, Stefan
The text was updated successfully, but these errors were encountered:
... so there is a lot more that gets replaced and the problem currently is that we can not reliably map back this because the pure JSON content does not contain any information on the real object ID ... so I have basically no real solution for that tbh
Hello,
I found a small bug in the converter/history2db.js which prevents some datapoints to be converted.
I converted a history.0 to a sql.0 instance (MSSQL-Server) with your script and most but not all datapoints were converted. So I searched for the reason why some datapoints were missing in SQL. The script said for example:
Ignore ID history.smartmeter.0.1-0~2_8_0__255.value.json: smartmeter.0.1-0~2_8_0__255.value
The datapoint-name in ioBroker and also SQL for this datapoint is
smartmeter.0.1-0:2_8_0__255.value but the filename is:
smartmeter.0.1-0~2_8_0__255.value.json
So the history-instance replaces ":" chars in filenames with "~" chars because ":" aren't allowed in filenames. But the converter script don't take these replaced chars into account.
As a quick and dirty workaround I changed line 198 from
const id = file.substring(8, file.length - 5);
to
const id = file.substring(8, file.length - 5).replace('~', ':');
which worked for me. But I am not sure if other illegal file name chars can cause the same problem so this shouldn't be a general solution.
Regards, Stefan
The text was updated successfully, but these errors were encountered: