Damaged or corrupt SQLite database recovery

Download sqlite binaries from:
http://www.sqlite.org/download.html

I will use sqlite-tools-win32 in Windows 10:
http://www.sqlite.org/2017/sqlite-tools-win32-x86-3160200.zip

Following the instructions from spiceworks article  , I check the file integrity:

# (I use PowerShell as administrator)
.\sqlite3.exe .\jalcivar_db

# then check:
pragma integrity_check;

# exit
.quit

If I have error messages I can go to Next Step

# Extract an SQL dump:
echo .dump | .\sqlite3.exe .\jalcivar_db > jalcivar_db.sql

# With Notepad++, encode .sql to UTF-8 w/o BOM

# Create an new sqlite db file:
.\sqlite3.exe -init .\jalcivar_db.sql .\jalcivar_db.sqlite

.quit
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s