Fatal error on database migration with Trac v1.0.1
|Reported by:||ryank-inovonics||Owned by:||jun66j5|
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 admin.py.
Maybe a change in behavior of environment creation in Trac 1.0.x?
Change History (6)
Changed 16 months ago by ryank-inovonics
comment:4 Changed 16 months ago by jun66j5
- Resolution set to fixed
- Status changed from new to closed