Migrate P1-USB usage data to P1-WiFi

Moderator: leecollings

Post Reply
Justino
Posts: 19
Joined: Thursday 14 January 2016 19:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10548
Location: The Netherlands
Contact:

Migrate P1-USB usage data to P1-WiFi

Post 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
Justino
Posts: 19
Joined: Thursday 14 January 2016 19:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10548
Location: The Netherlands
Contact:

Re: Migrate P1-USB usage data to P1-WiFi

Post by Justino »

Anyone who can help me migrate this data?
JimmyH1969
Posts: 153
Joined: Tuesday 28 June 2016 16:38
Target OS: Windows
Domoticz version: Beta
Location: Amersfoort NL
Contact:

Re: Migrate P1-USB usage data to P1-WiFi

Post 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.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Migrate P1-USB usage data to P1-WiFi

Post 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)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest