Re: [sqlite] Restore SQLite DB from WAL

2017-09-02 Thread Simon Slavin
On 1 Sep 2017, at 1:23pm, LincolnBurrows wrote: > Sometimes, the corruption is only or mostly in indexes, in which case it > would be possible to get some or most records by trying to dump the entire > database with .dump, and use those commands to create a new database: > > $ sqlite3 mydata.d

Re: [sqlite] Restore SQLite DB from WAL

2017-09-02 Thread LincolnBurrows
Sometimes, the corruption is only or mostly in indexes, in which case it would be possible to get some or most records by trying to dump the entire database with .dump, and use those commands to create a new database: $ sqlite3 mydata.db ".dump" | sqlite3 new.db The easiest and most reliable way

Re: [sqlite] Restore SQLite DB from WAL

2012-07-23 Thread gsm-ginger
> The WAL file does not store a bunch of DELETE FROM statements. The WAL > file stores 4k pages of the database file as they will appear after the > delete occurs. Details at http://www.sqlite.org/fileformat2.html > So, no, there is no way to do what you are asking Is there, instead, a method for

Re: [sqlite] Restore SQLite DB from WAL

2012-07-23 Thread Gilleán Ó Raghallaigh
> I think your sms-controlling app has synced the whole sms database > with some server. When you start your phone it shows you local data > but then it sees that server has latest data (maybe using modification > date on the database, maybe some synchronization token stored in the > database) and

Re: [sqlite] Restore SQLite DB from WAL

2012-07-23 Thread Pavel Ivanov
> In each case the same thing happens, the messages briefly display, then > disappear I think your sms-controlling app has synced the whole sms database with some server. When you start your phone it shows you local data but then it sees that server has latest data (maybe using modification date o

Re: [sqlite] Restore SQLite DB from WAL

2012-07-23 Thread gsm-ginger
> The WAL file does not store a bunch of DELETE FROM statements. The WAL > file stores 4k pages of the database file as they will appear after the > delete occurs. Details at http://www.sqlite.org/fileformat2.html > So, no, there is no way to do what you are asking. Damn! Failing that, is there a

Re: [sqlite] Restore SQLite DB from WAL

2012-07-23 Thread Richard Hipp
On Mon, Jul 23, 2012 at 3:51 PM, wrote: > > Is there any way to merge the lost data stored in mmssms.db-wal / > mmssms.db-shm back into mmssms.db? For example, if the DB/WAL stores a > bunch of DELETE FROM statements could they be changed to INSERT INTO? > The WAL file does not store a bunch of

Re: [sqlite] Restore SQLite DB from WAL

2012-07-23 Thread gsm-ginger
So close, yet so far! This is really getting on my wick... >> Example scenario where vast swathes of content have vanished from >> mmssms.db thanks to an unintentional mass-DELETE FROM through the naughty >> Android SMS app: >> >> ls -al /data/data/com.android.providers.telephony/databases/mm* >>

Re: [sqlite] Restore SQLite DB from WAL

2012-07-23 Thread Richard Hipp
On Mon, Jul 23, 2012 at 12:10 PM, wrote: > Hi, everyone > > Is it possible to restore deleted rows or dropped tables provided the WAL > and shm files are still intact and contain the data you want to restore? > The WAL file does not contain the old data, it contains the new data. If the WAL fil