Up until 4 Aug my Windows database was in C:\Program Files (x86)\Domoticz
Then I 'updated' to Windows 8.1
Since then a new database was created in C:\ProgramData\Domoticz
How can I merge the 2 databases to get all of the old and new data?
If they were Windows SQL Server dbs I would use sql to select from one and bulk load into the other.
Any helpful suggestions?
How to merge 2 domoticz.db databases?
Moderators: leecollings, remb0
- Westcott
- Posts: 423
- Joined: Tuesday 09 December 2014 17:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: UK - Glos
- Contact:
How to merge 2 domoticz.db databases?
Last edited by Westcott on Friday 28 August 2015 11:37, edited 1 time in total.
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
- gizmocuz
- Posts: 2552
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: How to merge 2 domoticz.db databases?
Even if it was SQL, you would have different ID's for all tables.
The paths you mentioned are the same
C:\ProgramData\Domoticz (Up until 4 Aug)
C:\ProgramData\Domoticz ( 'updated' to Windows 8.1)
it will be a manual job, and i suggest making a backup of both databases of course.
In the database that has the least data, change all *_calendar data to match the right DeviceRowID
You can use SQLite Expert Personal edition for this.
For example, in your old database your 'Outdoor Light' had DeviceRowID=123 and in your new database it has DeviceRowID=50
Then copy/paste it from one database to the other
Did you not noticed this 24 days ago ?
The paths you mentioned are the same
C:\ProgramData\Domoticz (Up until 4 Aug)
C:\ProgramData\Domoticz ( 'updated' to Windows 8.1)
it will be a manual job, and i suggest making a backup of both databases of course.
In the database that has the least data, change all *_calendar data to match the right DeviceRowID
You can use SQLite Expert Personal edition for this.
For example, in your old database your 'Outdoor Light' had DeviceRowID=123 and in your new database it has DeviceRowID=50
Then copy/paste it from one database to the other
Did you not noticed this 24 days ago ?
Quality outlives Quantity!
- Westcott
- Posts: 423
- Joined: Tuesday 09 December 2014 17:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: UK - Glos
- Contact:
Re: How to merge 2 domoticz.db databases?
Thanks, I've corrected the old path.
It took me a while to find the new database, although I'd noticed that all history before 4 Aug was missing.
Fortunately I was a .Net and MS SQL Server developer before I retired.
It took me a while to find the new database, although I'd noticed that all history before 4 Aug was missing.
Fortunately I was a .Net and MS SQL Server developer before I retired.
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
-
- Posts: 21
- Joined: Sunday 06 December 2015 21:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Contact:
Re: How to merge 2 domoticz.db databases?
If I make daily backup of the domoticz.db then I have only daily data right? So how can I merge them to get one database with all data instead of separate daily databases?
-
- Posts: 19
- Joined: Sunday 01 September 2013 13:16
- Target OS: Windows
- Domoticz version:
- Contact:
Re: How to merge 2 domoticz.db databases?
No, daily backups backup the whole database.rjobaan wrote:If I make daily backup of the domoticz.db then I have only daily data right? So how can I merge them to get one database with all data instead of separate daily databases?
-
- Posts: 21
- Joined: Sunday 06 December 2015 21:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Contact:
Re: How to merge 2 domoticz.db databases?
but if I check the domoticz.db I can not find all the data only from one day.
I just copied the db into my pc and opened in SQL light and check the table Meter or table MultiMeter and I only see data of 24 hours?
Could you please explain what you mean ? I still think I need to backup every day the domoticz.db and combine them somehow
How are you guys doing this? I am still wondering how you save the data of every day?
I just copied the db into my pc and opened in SQL light and check the table Meter or table MultiMeter and I only see data of 24 hours?
Could you please explain what you mean ? I still think I need to backup every day the domoticz.db and combine them somehow
How are you guys doing this? I am still wondering how you save the data of every day?
-
- Posts: 21
- Joined: Sunday 06 December 2015 21:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Contact:
Re: How to merge 2 domoticz.db databases?
Am I correct that the domoticz.db has only a daily, monthly and yearly data? So not the daily data for an whole year right? I make a back up of everything but still the db consists daily data, so to get daily data for a whole month you need to merge the db? How can I do that?
Who is online
Users browsing this forum: No registered users and 1 guest