LogicMachine Forum
All data in the database is gone after an alert - Printable Version

+- LogicMachine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2)
+--- Thread: All data in the database is gone after an alert (/showthread.php?tid=6137)



All data in the database is gone after an alert - Hadeel - 03.10.2025

Hi !
In my environment I had my LM running for over 3 years. 
Yesterday, for the first time all data in the database was gone and all objects and scripts are lost.
I can see alert log but there is no other log or error log.
Have you ever experienced this ? How can I avoid it from happening?


RE: All data in the database is gone after an alert - admin - 03.10.2025

Most likely a problem with the microSD card in LM. Run this script once and post what you get in Logs tab:
Code:
files = io.ls('/data/dbfail/')
log(files)



RE: All data in the database is gone after an alert - Hadeel - 03.10.2025

Thank you for looking into the inquiry!
This is what I got after executing the code.


RE: All data in the database is gone after an alert - admin - 06.10.2025

Run this and post the results:
Code:
res = io.readproc('ls -l /data/dbfail/')
log(res)
log(io.readfile('/data/dbfail/1.log'))
log(io.readfile('/data/dbfail/2.log'))



RE: All data in the database is gone after an alert - Hadeel - 14.10.2025

Thank you admin : ) This is what I got !


RE: All data in the database is gone after an alert - admin - 14.10.2025

It looks like you have a power fail when LM was saving the database to disk.
Run this once then reboot LM:
Code:
os.execute('cp /data/dbfail/2.db /data/storage/scada.db')

See if your objects and scripts are restored.