With trac 0.11dev (r8197) the postgres backup function does not work if there was no user configured in the db string (e.g. 'postgres://localhost/foo'):
branches/0.11-stable/trac/db/postgres_backend.py@8197#L111
Traceback (most recent call last):
File "trac-admin", line 8, in <module>
load_entry_point('Trac==0.11.5stable-r8080', 'console_scripts', 'trac-admin')()
File "/trac/admin/console.py", line 1317, in run
return admin.onecmd(command)
File "/trac/admin/console.py", line 133, in onecmd
rv = cmd.Cmd.onecmd(self, line) or 0
File "/usr/lib64/python2.5/cmd.py", line 219, in onecmd
return func(arg)
File "/trac/admin/console.py", line 1154, in do_upgrade
self.__env.upgrade(backup=do_backup)
File "/trac/env.py", line 455, in upgrade
self.backup(backup_dest)
File "/trac/env.py", line 423, in backup
return DatabaseManager(self).backup(dest)
File "/trac/db/api.py", line 110, in backup
return connector.backup(dest)
File "/trac/db/postgres_backend.py", line 111, in backup
'-U', db_prop['user'],]
KeyError: 'user'
Just from looking at the source code, I suspect that MySQL will have the same problem:
branches/0.11-stable/trac/db/mysql_backend.py@8197#L157
Thanks for the report!
Patch appreciated (should be easy, doing the same kind of check as for the
'port'
in the MySQL version).