(Solved) How restore a "Automatic Backup" ?? Topic is solved

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!

Moderators: leecollings, remb0

Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
User avatar
costo
Posts: 73
Joined: Tuesday 11 August 2015 17:35
Target OS: Linux
Domoticz version: 2025.1
Location: Netherlands
Contact:

(Solved) How restore a "Automatic Backup" ??

Post by costo »

In Setup-Settings-System there is the "Automatic Backup" option.
I activated it and found out that in the protected folder /domoticz/backups there are Monthly, Daily and Hourly backups.
I can't find out how to restore from a automatic generated backup file.
Is there a simple way ??

Domoticz 2026.4
Hardware: HP-T530 thin client 128/4Gb
linux Mint 22.1 Cinnamon
Last edited by costo on Thursday 19 November 2026 17:25, edited 1 time in total.
RNEE
Posts: 97
Joined: Sunday 05 August 2018 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.4
Location: NL/Eindhoven area
Contact:

Re: How restore a "Automatic Backup" ??

Post by RNEE »

Via setup->settings->backup/restore.
Domoticz (since 2016) on Docker on Raspberry PI 5 with 500 Gb NVMe|Milight|KaKu + RFXCOM|Goodwe|Smartstuff P1 meter|Buienradar|Afval kalender|Tuya-wifi|Zigbee + deCONZ Conbee II|Marstek 5,12Kwh via Modbus on Pusr-dr134|MQTTMapper|Quatt v2|DTGbot|
User avatar
waltervl
Posts: 7037
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: How restore a "Automatic Backup" ??

Post by waltervl »

RNEE wrote: Thursday 19 November 2026 7:08 Via setup->settings->backup/restore.
That only works if you start the browser on the domoticz server itself as it expects the file on the local host (your laptop, PC, smartphone etc).
Or copy the to be restored backup file from the domoticz server to the local host.

Another way is to stop domoticz through command line

Code: Select all

sudo service domoticz stop
Go the the domoticz install folder
Make a backup of the domoticz.db file (the current in use domoticz database file)
Copy the to be restored backup file as domoticz.db in the domoticz install folder (overwriting the existing domoticz.db file)
Start domoticz again

Code: Select all

sudo service domoticz start
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
imautohuttraeger
Posts: 474
Joined: Saturday 14 March 2020 13:40
Target OS: Raspberry Pi / ODroid
Domoticz version: lat.beta
Location: Germany
Contact:

Re: How restore a "Automatic Backup" ??

Post by imautohuttraeger »

Or - if your Domoticz is not running anymore, via the terminal. Save the backup on a save place, Install Domoticz new, restore the database by the backup file:

https://wiki.domoticz.com/Going_back_to ... us_version
Stop, look and listen.
User avatar
imautohuttraeger
Posts: 474
Joined: Saturday 14 March 2020 13:40
Target OS: Raspberry Pi / ODroid
Domoticz version: lat.beta
Location: Germany
Contact:

Re: How restore a "Automatic Backup" ??

Post by imautohuttraeger »

Or this way, that once worked for me: (copied and automatically translated from my German AI helper notes, when I once ran into trouble):

1. Start a root shell
sudo -i

2. Stop Domoticz
systemctl stop domoticz

3. Navigate to the backup directory and list available backups
cd /home/pi/domoticz/backups
ls -la
Review the list and identify the backup from before today's update (check the date/time in the filename).

4. Back up the current (faulty) Domoticz binary (as a precaution)
cp /home/pi/domoticz/domoticz /home/pi/domoticz/domoticz_broken_$(date +%Y%m%d)

EDIT: Drop or amend step 5, like @waltervl mentioned (see his comment below). As he correctly stated:
Step 5 is not correct, no need for tar. See my earlier (modified) answer. Do not trust AI on this.
Spoiler: show
5. Restore the backup[/quote]
The exact command depends on the name of the backup file. Typically:
tar -xzvf <BACKUP-FILENAME> -C /home/pi/domoticz/
(Please use the exact filename as shown in the output from the `ls -la` command in step 3.)
6. Correct permissions (if necessary)
chown -R pi:pi /home/pi/domoticz
chmod +x /home/pi/domoticz/domoticz

7. Restart Domoticz
systemctl start domoticz
systemctl status domoticz

8. Exit the root shell
exit
Last edited by imautohuttraeger on Thursday 19 November 2026 10:11, edited 6 times in total.
Stop, look and listen.
User avatar
waltervl
Posts: 7037
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: How restore a "Automatic Backup" ??

Post by waltervl »

imautohuttraeger wrote: Thursday 19 November 2026 9:22 Or without installing Domoticz brand new: (copied and automatically translated from my German AI helper notes, when I once ran into trouble):

1. Start a root shell
bash
sudo -i

2. Stop Domoticz
bash
systemctl stop domoticz

3. Navigate to the backup directory and list available backups
bash
cd /home/pi/domoticz/backups
ls -la
Review the list and identify the backup from before today's update (check the date/time in the filename).

4. Back up the current (faulty) Domoticz binary (as a precaution)
bash
cp /home/pi/domoticz/domoticz /home/pi/domoticz/domoticz_broken_$(date +%Y%m%d)

5. Restore the backup
The exact command depends on the name of the backup file. Typically:
bash
tar -xzvf <BACKUP-FILENAME> -C /home/pi/domoticz/
(Please use the exact filename as shown in the output from the `ls -la` command in step 3.)

6. Correct permissions (if necessary)
bash
chown -R pi:pi /home/pi/domoticz
chmod +x /home/pi/domoticz/domoticz

7. Restart Domoticz
bash
systemctl start domoticz
systemctl status domoticz

8. Exit the root shell
bash
exit
Step 5 is not correct, no need for tar. See my earlier (modified) answer. Do not trust AI on this.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
RNEE
Posts: 97
Joined: Sunday 05 August 2018 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.4
Location: NL/Eindhoven area
Contact:

Re: How restore a "Automatic Backup" ??

Post by RNEE »

I think the OP asked for an easy way.. :D

But @costo is your database beyond repair?
There are possibilies to Repair ? Did you try them?
Domoticz (since 2016) on Docker on Raspberry PI 5 with 500 Gb NVMe|Milight|KaKu + RFXCOM|Goodwe|Smartstuff P1 meter|Buienradar|Afval kalender|Tuya-wifi|Zigbee + deCONZ Conbee II|Marstek 5,12Kwh via Modbus on Pusr-dr134|MQTTMapper|Quatt v2|DTGbot|
User avatar
imautohuttraeger
Posts: 474
Joined: Saturday 14 March 2020 13:40
Target OS: Raspberry Pi / ODroid
Domoticz version: lat.beta
Location: Germany
Contact:

Re: How restore a "Automatic Backup" ??

Post by imautohuttraeger »

waltervl wrote: Thursday 19 November 2026 9:25
Step 5 is not correct, no need for tar. See my earlier (modified) answer. Do not trust AI on this.
Good point - thank you for taking care. I have edited my comment accordingly.
Stop, look and listen.
User avatar
imautohuttraeger
Posts: 474
Joined: Saturday 14 March 2020 13:40
Target OS: Raspberry Pi / ODroid
Domoticz version: lat.beta
Location: Germany
Contact:

Re: How restore a "Automatic Backup" ??

Post by imautohuttraeger »

RNEE wrote: Thursday 19 November 2026 9:33 I think the OP asked for an easy way.. :D
That's certainly right, but for me as a non-coding-guy, this is the easy way:
- copy
- paste
- hoping it works

😉
Stop, look and listen.
RNEE
Posts: 97
Joined: Sunday 05 August 2018 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.4
Location: NL/Eindhoven area
Contact:

Re: How restore a "Automatic Backup" ??

Post by RNEE »

imautohuttraeger wrote: Thursday 19 November 2026 10:27
RNEE wrote: Thursday 19 November 2026 9:33 I think the OP asked for an easy way.. :D
That's certainly right, but for me as a non-coding-guy, this is the easy way:
- copy
- paste
- hoping it works

😉
OP knew where the files are and as a Linux user understands what to do.

In my opinion we are in 2026 now.

If Domoticz wants a larger audience it should be easy to use.

Off topic :
@imautohuttraeger are you family of Laureline ? :D
About Laureline : https://youtu.be/9pKYkhABb4w?si=LVo5nhvuIRkWrvKm
Domoticz (since 2016) on Docker on Raspberry PI 5 with 500 Gb NVMe|Milight|KaKu + RFXCOM|Goodwe|Smartstuff P1 meter|Buienradar|Afval kalender|Tuya-wifi|Zigbee + deCONZ Conbee II|Marstek 5,12Kwh via Modbus on Pusr-dr134|MQTTMapper|Quatt v2|DTGbot|
User avatar
imautohuttraeger
Posts: 474
Joined: Saturday 14 March 2020 13:40
Target OS: Raspberry Pi / ODroid
Domoticz version: lat.beta
Location: Germany
Contact:

Re: How restore a "Automatic Backup" ??

Post by imautohuttraeger »

RNEE wrote: Thursday 19 November 2026 10:48 Off topic :
@imautohuttraeger are you family of Laureline ? :D
About Laureline : https://youtu.be/9pKYkhABb4w?si=LVo5nhvuIRkWrvKm
No, she is not a relative of mine. But the aliens are looking a little bit like me 😄
Stop, look and listen.
User avatar
costo
Posts: 73
Joined: Tuesday 11 August 2015 17:35
Target OS: Linux
Domoticz version: 2025.1
Location: Netherlands
Contact:

Re: How restore a "Automatic Backup" ??

Post by costo »

Thanks for all the usefull answers. So (for the moment) there is no easy way to restore a 'automatic backup'.
My problem was that I accidently deleted hardware with a persistentUSB.
I understand now how I could have used a Hourly backup from a little before, but it's not very easy.
So instead I followed the 'hard way' and reinstalled a USBDevice-by-ID as described in the wiki.

Domoticz is running fine
Post Reply