Sqlite Database Browser crahses - how to restore the DB with journal file
Asked Answered
H

1

7

I worked on my sqlite Database with the program "SQlite Database Browser". The program crashed and I lost my changes. But the db-journal file is still there. How can I recover the database with the journal file? When I open the database with the SQLite Database Browser the old database opend.

What can I do?

Thanks :-)

Hyperplasia answered 22/10, 2011 at 10:34 Comment(0)
D
2

Unless you enabled Write-Ahead logging, I'm afraid that your changes are probably lost. The default journalling system in SQLite works in the opposite way than you are expecting.

From the documentation:

The traditional rollback journal works by writing a copy of the original unchanged database content into a separate rollback journal file and then writing changes directly into the database file. In the event of a crash or ROLLBACK, the original content contained in the rollback journal is played back into the database file to revert the database file to its original state.

See:

WAL: https://sqlite.org/wal.html

File formats, including journals: https://sqlite.org/fileformat.html

Debar answered 26/6, 2015 at 15:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.