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:
- Install the packages sqlite (v2) and sqlite3 (guess the version )
aptitude install sqlite sqlite3
- Dump the old database and convert it to sqlite3
1 2 3 4 5 6
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!