importing database not working Topic is solved

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
Duggel
Posts: 15
Joined: Friday 08 May 2015 10:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

importing database not working

Post by Duggel »

Hello,

I've been using Domoticz on the same Raspberry pi (2B) since 2015, unfortunately about 3 weeks ago the sd-card got corrupt and went into "read-only" mode. Since then Domoticz and some other services went offline (probably because no logging can't be written).
I can acces the data via ssh and ftp but both are very (VERY) slow (booting the old raspberry with the broken sd takes about 30 minutes).

To stay up date I bought a new raspbery (4B) and flashed a blanc installation to a new sd, installed domoticz, etc.
So far so good, but when trying to "restore" the domoticz.db file the problems started..

I stopped domoticz, renamed the "blanc" domoticz.db file and placed back the domoticz.db from the old pi.
Started domoticz again and... nothing. No devices, no configuration (double checked in private session).

Next step was activating the fresh domoticz.db again and try to upload the backup file via the frontend.
Direct after uploading, domoticz crashed (logging is attached, but this goes way beyond my raspberry knowledge) and doesn't work unless I restore the "blanc" .db file. I tried 1 backup file from the hourly backup-dir, but same result.
What can I try to get back my "old" configuration (please say there are options.... 5 years of scriting, configurating and expanding).

What I noticed:
domoticz.db: 1,4MB
files in hourly backup folder: eveything between 2 and 6MB (why the large difference, is this normal?)
Attachments
domoticz_crash.log
(15.92 KiB) Downloaded 31 times
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: importing database not working

Post by waaren »

Duggel wrote: Wednesday 21 October 2020 15:35 What can I try to get back my "old" configuration (please say there are options.... 5 years of scriting, configurating and expanding).
A first step might be to perform the steps in this topic database check and repair Howto
If the database turns out to be ok then start with all hardware disabled. (see this post )
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Duggel
Posts: 15
Joined: Friday 08 May 2015 10:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: importing database not working

Post by Duggel »

waaren wrote: Wednesday 21 October 2020 16:54 A first step might be to perform the steps in this topic database check and repair Howto
The database was malformed and the repair did some good...
My preferences came back, and so came the scenes, but only about 10 devices (should be at least 300+).
waaren wrote: Wednesday 21 October 2020 16:54 If the database turns out to be ok then start with all hardware disabled. (see this post )
I tried "update hardware set enabled = 0 ;" but this query takes ages (can't be good).
Now I ran a simple COUNT on the hardware table... after 10 minutes stil no output (console only shows ...> )
I guess there's something wrong with this table. I wil Google... but if someone knows how to check/repair you're welcome to share.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: importing database not working

Post by waaren »

Duggel wrote: Thursday 22 October 2020 8:42 I tried "update hardware set enabled = 0 ;" but this query takes ages (can't be good).
Now I ran a simple COUNT on the hardware table... after 10 minutes stil no output (console only shows ...> )
I guess there's something wrong with this table. I wil Google... but if someone knows how to check/repair you're welcome to share.
Happy to help. If you send me a PM with a link where I can download your database (or a recent backup), I will have a look.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Duggel
Posts: 15
Joined: Friday 08 May 2015 10:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: importing database not working

Post by Duggel »

Finally found the problem... Because the SD card had issue's the current domoticz.db + all backups in Hourly and Daily were corrupt.
Luckily the august backup was ok, so I manneged to restore from that one.

The corrupt databases could be repaired, but that didn't mean the database-content was complete/good for domoticz.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest