wiki:AutoUpgradePlugin

Auto-upgrade a Trac environment

Description

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:

  • trac/env.py

     
    594594            env.log.error("Exception caught while checking for upgrade: %s",
    595595                          exception_to_unicode(e, traceback=True))
    596596        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()
    600601
    601602    return env
    602603

See also: trac:#7082

This plugin is horrible and hacky. I would have done it a better way if I could.

Bugs/Feature Requests

Existing bugs and feature requests for AutoUpgradePlugin are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

You can check out AutoUpgradePlugin from here using Subversion, or browse the source with Trac.

Example

Enable the plugin. After that, upgrades will be done automatically.

Recent Changes

[6714] by k0s on 2009-10-14 22:19:33
noting GPL license
[6713] by k0s on 2009-10-14 22:04:16
fake exception to unicode if it doesnt exist
[6712] by k0s on 2009-10-14 21:58:37
use better way of determining if the component is enabled

Author/Contributors

Originally developed at The Open Planning Project

Author: k0s
Maintainer: none
Contributors:

Last modified 2 years ago Last modified on Jul 31, 2012, 8:57:04 AM

Attachments (1)

Download all attachments as: .zip