Page 1 of 1
Migrate P1-USB usage data to P1-WiFi
Posted: Monday 18 March 2019 10:00
by Justino
Hi there,
I used the P1-USB for 2,5 years and replaced it with the P1-WiFi Gateway.
Would like to migrate the data, which my P1-USB collected, to my P1-WiFi device so i habe all the log data in one place and can safely remove the P1-USB device.
So, does anyone know how i can migrate my P1 USB data to my new P1-WiFi device?
Kind regards,
Justino
Re: Migrate P1-USB usage data to P1-WiFi
Posted: Wednesday 20 March 2019 12:14
by Justino
Anyone who can help me migrate this data?
Re: Migrate P1-USB usage data to P1-WiFi
Posted: Wednesday 20 March 2019 13:01
by JimmyH1969
At the Electricity and Gas device you can click on Adjust/Aanpassen and the you can select replace/Vervang. Selecting the new device will do what you want as far as i know.
Re: Migrate P1-USB usage data to P1-WiFi
Posted: Wednesday 20 March 2019 16:24
by waaren
Justino wrote: ↑Wednesday 20 March 2019 12:14
Anyone who can help me migrate this data?
Before you start; ensure you have a working and tested backup process !
stop domoticz
#copy live database to backup copy
cd domoticzdir
sudo cp domoticz.db domoticz.keep_20190320
# change OLD_ID and NEW_ID in sqlite commands below
sudo sqlite3 domoticz.db
-- For P1 elektricity
-- prevent double entries;
delete from multimeter where devicerowid = OLD_ID and date in (select date from multimeter where devicerowid = NEW_ID);
delete from multimeter_calendar where devicerowid = OLD_ID and date in (select date from multimeter_calendar where devicerowid = NEW_ID);
-- transfer old device to new device;
update multimeter set devicerowid = NEW_ID where devicerowid = OLD_ID;
update multimeter_calendar set devicerowid = NEW_ID where devicerowid = OLD_ID;
.quit
start domoticz and test. If not OK you can copy the domoticz.keep_20190320 back to domoticz db
Repeat the same for P1 Gas (change multimeter to meter and multimeter_calendar to meter_calendar)