|Version 5 (modified by k0s, 6 years ago) (diff)|
auto upgrade a trac environment via a plugin
The AutoUpgradePlugin, when enabled, will automatically upgrade the environment when it needs an upgrade. Except for checking for the AutoUpgradePlugin being enabled, it is equivalent to a small patch to trac.env:
594 594 env.log.error("Exception caught while checking for upgrade: %s", 595 595 exception_to_unicode(e, traceback=True)) 596 596 if needs_upgrade: 597 raise TracError(_('The Trac Environment needs to be upgraded.\n\n' 598 'Run "trac-admin %(path)s upgrade"', 599 path=env_path)) 597 try: 598 env.upgrade(backup=True) 599 except TracError, e: 600 env.upgrade() 600 601 601 602 return env 602 603
See also: trac:#7082
If you have any issues, create a new ticket.
Download the zipped source from here.
Enable the plugin. After that, upgrades will be done automatically.
Originally developed at The Open Planning Project