Fatal error on database migration with Trac v1.0.1
|Reported by:||ryank-inovonics||Owned by:||Jun Omae|
When attempting to migrate a Trac v1.0.1 site from SQLite to PostgreSQL, got this error:
Copying tables: ProgrammingError: Cannot operate on a closed database. Exception AssertionError: AssertionError() in <bound method PooledConnection.__del__ of <trac.db.pool.PooledConnection object at 0x95ef324>> ignored attachment table...
After poking around in
admin.py found that creating the new environment closes any existing database connections, namely the one for the old environment's SQLite database. Swapped the new environment creation section with old environment's database open and query. With this change the migration completed successfully. See attached diff for the changes made to
Maybe a change in behavior of environment creation in Trac 1.0.x?