hello,
normally when i roll back i just install a previous domoticz.db file from backup
i now also see domoticz.db-wal and domoticz.db-shm
what are these files for?
can is safely remove those and will they be regenerated?
domoticz.db-wal domoticz.db-shm
Moderators: leecollings, remb0
- FireWizard
- Posts: 1967
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: domoticz.db-wal domoticz.db-shm
Hi @Gravityz,
Use Google and you get an excellent explanation:
Use Google and you get an excellent explanation:
.db-wal and .db-shm are temporary files generated by SQLite when operating in Write-Ahead Logging (WAL) mode to improve performance and allow simultaneous reading/writing. The -wal file holds recent transaction logs, while the -shm file manages shared memory for concurrent access. These files should not be deleted while the app is running, as they contain data not yet committed to the main database file.
Key Details regarding .db-wal and .db-shm:
Purpose: The WAL (Write-Ahead Log) approach acts as a, high-speed, temporary, note-taking area (the -wal file) before updates are permanently moved to the main database.
File Deletion: These files are typically deleted automatically when the database is closed properly or during a checkpoint, but may persist if a crash occurs.
Handling in Backups: If backing up a SQLite database, it is crucial to include both the .db file, the -wal file, and the -shm file to avoid data corruption or loss.
Context: These are common in Android Room databases and various applications, especially in high-concurrency environments.
If you are attempting to move or analyze the main .db file, ensure the connection is closed first, or copy all three files together, as the data in -wal is critical, while -shm is merely temporary shared memory.
-
Gravityz
- Posts: 652
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: domoticz.db-wal domoticz.db-shm
thanks. i just discovered it myself so next time i will google first.
domoticz only makes backups of the .db file
what happens if you need to roll back, replace domoticz.db with a previous backup and the wal ans hm files are still there.
domoticz only makes backups of the .db file
what happens if you need to roll back, replace domoticz.db with a previous backup and the wal ans hm files are still there.
- waltervl
- Posts: 6677
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2025.1
- Location: NL
- Contact:
Re: domoticz.db-wal domoticz.db-shm
You should not just replace the db file but import the db file. Or stop Domoticz service first (db file will be synced with wal and shm) and then replace the db file.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
Gravityz
- Posts: 652
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: domoticz.db-wal domoticz.db-shm
yes that is how i always do it.
stop domoticz, replace db with older build, start older build container.
i have serious issues with the latest update.
i just tried again and i am now back on 16782 (renamed the wal and shm files before restoring)
The hue bridge is still running the latest 1.75 fw
sofar no crashen or errors so i think hue might have solved the issue also since the problems started with update 1.74 while i now have 1.75 which was mandatory.
i am starting to believe the domoticz hue changes are responsible for all the problems.
you have read my previous problems with the thermostat and later other devices which fail to trigger scripts anymore.
if the code is rght things need to work otherwise there is no way to solve things
the weird thing is that i am aparently the only one with problems when updating and the only one without problems on the old build
stop domoticz, replace db with older build, start older build container.
i have serious issues with the latest update.
i just tried again and i am now back on 16782 (renamed the wal and shm files before restoring)
The hue bridge is still running the latest 1.75 fw
sofar no crashen or errors so i think hue might have solved the issue also since the problems started with update 1.74 while i now have 1.75 which was mandatory.
i am starting to believe the domoticz hue changes are responsible for all the problems.
you have read my previous problems with the thermostat and later other devices which fail to trigger scripts anymore.
if the code is rght things need to work otherwise there is no way to solve things
the weird thing is that i am aparently the only one with problems when updating and the only one without problems on the old build
Who is online
Users browsing this forum: No registered users and 1 guest