Fixing the SQLite DB for a Trac Instance

August 20, 2009

in sysadmin

’bout time I add some sysadmin content here.
If you ever have a trac instance go boom with an error like “DatabaseError: database disk image is malformed” you can often fix the problem by doing an sqlite dump/reload:

$ cd /path/to/trac-sqlite-db-directory # find the trac.db file
$ su www-data   # switch to the owner of the db file
$ mv trac.db trac.db.damaged
$ sqlite3 trac.db.damaged .dump|sqlite3 trac.db 
Be Sociable, Share!

Leave a Comment

Previous post:

Next post: