Page 1 of 1

Unable to restore backup?

Posted: Thursday 22 November 2018 22:41
by Naki
I'm running Domoticz on a Raspberry Pi with a few z-wave and 433MHz devices. Earlier this week the sdcard broke down. But I was using rsync to make a copy of the filesystem every 6th hour so I thought it would be ok. However, I'm unable to get it to work the way it did.

I've done a clean install of latest Raspbian and Domoticz(to /home/pi/domoticz). After this I was able to access Domoticz and it was completely empty as expected.

I then tried to stop it and copy domoticz.db from my backup. But when restarting it was still completely empty. Even tried another browser.

I then tried to stop it and copy the entire domoticz-directory from my backup. But it was still empty when I started again.

Is it time to assume my backup is busted or is there some additional steps that needs to be don?

Re: Unable to restore backup?

Posted: Friday 23 November 2018 6:44
by waaren
Naki wrote: Thursday 22 November 2018 22:41 I'm running Domoticz on a Raspberry Pi with a few z-wave and 433MHz devices. Earlier this week the sdcard broke down. But I was using rsync to make a copy of the filesystem every 6th hour so I thought it would be ok. However, I'm unable to get it to work the way it did.
I've done a clean install of latest Raspbian and Domoticz(to /home/pi/domoticz). After this I was able to access Domoticz and it was completely empty as expected.
I then tried to stop it and copy domoticz.db from my backup. But when restarting it was still completely empty. Even tried another browser.
I then tried to stop it and copy the entire domoticz-directory from my backup. But it was still empty when I started again.
Is it time to assume my backup is busted or is there some additional steps that needs to be don?
Would be worthwhile to look directly in your backup database to see what is in there. I use sqlite3 on the RPI or SQLite expert on my W10 to do that but many other tools are available.
All hardware can be found in the table Hardware and all devices should be in the table DeviceStatus

Re: Unable to restore backup?

Posted: Friday 23 November 2018 8:26
by Naki
waaren wrote: Friday 23 November 2018 6:44 Would be worthwhile to look directly in your backup database to see what is in there. I use sqlite3 on the RPI or SQLite expert on my W10 to do that but many other tools are available.
All hardware can be found in the table Hardware and all devices should be in the table DeviceStatus
Thanks! Tried it now and got

Code: Select all

sqlite> .open /home/pi/domoticz/domoticz.db
sqlite> .tables
Error: database disk image is malformed
But after running

Code: Select all

sqlite3 domoticz.db ".dump" | sqlite3 new_domoticz.db
It seems like everything is back again.