I am running OH2.5.12 and have been running ever since a
mysql persistence service attached to a MariaDB database . To prepare for migration to OH V3 I changed the persistence to
jdbc-mariadb and as the old DB had different data types I have created a new database.
But as I like to keep the data in one source my wish is to move the data from the old
Items### tables into the new database.
I am aware that the numbering is different and that I have to check which
ItemXXX table in the old database belongs to which
ItemYYY in the new database.
I was wondering if someone in the community knows a way how to "read the data from the old table and insert it into the new table as I am no SQL specialist. What I assume is that you need to read out the value pair (date and ItemValue) and insert row by row it into the new table as the data types may vary.
To those of you who have a deeper knowledge on SQL programming I would kindly ask for your support how to script such a procedure or give me some hints to a documentation where a rookie like me can find what I am looking for.
Here is what I found in Google and what I think should work:
INSERT INTO dest_database.destination_table (DestColumn_1, DestColumn_2) SELECT SourceColumn_1, SourceColumn_2 FROM source.database.source_table
But it does not work Hence any advise is kindly appreciated.
Thank you for your guidance!!!