trac: Solving sqlite-issues when upgrading from Debian etch to lenny

On my dev-server I had to upgrade to the newer version of debian lenny (which will be released as stable version this week).

The upgrade went fine but after it was finished trac (0.11.2.1 ) refused to start, throwing the error message

DatabaseError: file is encrypted or is not a database

According to the ticket system of trac the problem is the wrong version of sqlite which is used by trac. Sadly all my efforts to make the database useable again failed with the error message above.

After some research I discovered another way to let trac use the default sqlite3 but keeping my data alive. This chatlog states a simple way to convert your sqlite2 database to the newer sqlite3-format. Here is a quick walkthrough:

  1. Install the packages sqlite (v2) and sqlite3 (guess the version ;) )
    aptitude install sqlite sqlite3
  2. Dump the old database and convert it to sqlite3
    cd /path/to/trac-repos
    cd db
    mv trac.db trac.db.old-sqlite2
    sqlite trac.db.old-sqlite2 .dump | sqlite3 trac.db
    chown www-data:www-data trac.db
    /etc/init.d/apache2 restart

And you’re done. The old database is now named trac.db.old-sqlite2 in case you need it for whatever reason. The new one is named with the default name trac.db so trac will use this one if not specified otherwise in conf/trac.ini.

I hope this tip saves you from some worries after upgrading to Debian Lenny. Keep on coding!

This entry was posted 1 year ago by stevie
Tags: , , , , ,
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

3 Responses to “trac: Solving sqlite-issues when upgrading from Debian etch to lenny”

  1. [...] Auf einem Entwicklungsserver kam es beim Dist-Upgrade auf Lenny zu keinen bemerkenswerten Problemen. Selbst der Wechsel auf Python 2.5 gelang problemlos (einzige Ausnahme: Teamsoftware trac mit Sqlite-Backend). [...]

  2. Thanks a lot for this tip.

    This migration procedure should have been written in NEWS.Debian.gz or something like that.

    Olivier;

  3.  

    1 year ago

    Great how-to. Also, this link has some other steps for transitioning from etch to lenny’s trac:
    http://wiki.kartbuilding.net/index.php/Upgrade_Trac
    They forgot to mention at the end to also run ‘trac-admin /location/of/trac wiki upgrade’ as well.

  4.  
 

Leave a Reply