domoticz.db corrupt Topic is solved

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

Moderator: leecollings

Post Reply
Ptje
Posts: 73
Joined: Sunday 06 March 2016 23:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Schaijk
Contact:

domoticz.db corrupt

Post by Ptje »

Hello,

Can somebody help my, to repair my domoticz.db ? I did try the solutions with sqlite but it result in a empty .db file.I don't know what I'm doing wrong.

Greetings,
Peter
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: domoticz.db corrupt

Post by waaren »

Ptje wrote: Monday 17 August 2020 1:34 Can somebody help my, to repair my domoticz.db ? I did try the solutions with sqlite but it result in a empty .db file.I don't know what I'm doing wrong.
Can you describe in more detail what you did to repair the database?

Also send you a PM
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Ptje
Posts: 73
Joined: Sunday 06 March 2016 23:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Schaijk
Contact:

Re: domoticz.db corrupt

Post by Ptje »

Hello Waaren,

You are my hero today. The repaired db you send me, works !!! Many thanks.

Greetings,
Peter
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: domoticz.db corrupt

Post by waaren »

Ptje wrote: Monday 17 August 2020 9:30 The repaired db works.
Good that it works again!

Reason the recovery failed initially was that the dump process spotted some (or an) error(s) and added "ROLLBACK;" as last line in the dump file.
To force the recovery process to load the data anyway you need to change the last line of the dump file to "COMMIT;"
You can do that with an editor or with the sed program with below command

Code: Select all

sed -i '$ s/ROLLBACK;/COMMIT;/g' /tmp/myDump.sql # change last line in dump to prevent rollback
(assuming your dump file is in /tmp as mydump.sql)
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: Google [Bot] and 1 guest