Trac 0.11.7 -> 0.12 upgrade through virtualmin fails

Upgrading Trac to version 0.12 ..
Found in cache ..
Found in cache ..
Upgrade command failed :
.. done

with access to site saying:

Trac Error

TracError: The Trac Environment needs to be upgraded.

Run "trac-admin /home/subv/public_html/trac/cb upgrade"

which doesn't work.

So according to this:

Following command has been needed first once per server, to upgrade (adding this for the bug fix and for others having this issue):

./bin/easy_install --upgrade Trac==0.12


That's odd that your upgrade failed, because I just did an install of 0.11.7 and then upgraded it to 0.12 within Virtualmin, and it worked fine!

The command Virtualmin uses to do the upgrade is :

bin/trac-admin trac upgrade

does that not work if run manually?

Looks like the command changed (?) according to this :

it is:

trac-admin /path/to/projenv upgrade

And the projenv is the project-named subfolder inside the install folder.

Here is the first attempt i did, presuming that virtualmin did download the latest before failing at upgrading, as well as the error result i got:

$ ./bin/trac-admin /home/site/public_html/trac/project1 upgrade

Traceback (most recent call last):
  File "./bin/trac-admin", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.5/site-packages/", line 2561, in <module>
  File "/usr/lib/python2.5/site-packages/", line 626, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.5/site-packages/", line 524, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: Trac==0.12

This is what i then did and worked:

./bin/easy_install --upgrade Trac==0.12
Searching for Trac==0.12
Best match: Trac 0.12
Running Trac-0.12/ -q bdist_egg --dist-dir /tmp/easy_install-vcOfCx/Trac-0.12/egg-dist-tmp-frXbwP
Adding Trac 0.12 to easy-install.pth file
Installing trac-admin script to /usr/bin
Installing tracd script to /usr/bin

Installed /usr/lib/python2.5/site-packages/Trac-0.12-py2.5.egg
Processing dependencies for Trac==0.12
Searching for Genshi>=0.6
Best match: Genshi 0.6
Processing Genshi-0.6-py2.5.egg
Moving Genshi-0.6-py2.5.egg to /usr/lib/python2.5/site-packages
Adding Genshi 0.6 to easy-install.pth file

Installed /usr/lib/python2.5/site-packages/Genshi-0.6-py2.5.egg
Finished processing dependencies for Trac==0.12

$ ./bin/trac-admin /home/dev1/public_html/trac/dev1 upgrade

Upgrade done.

You may want to upgrade the Trac documentation now by running:

  trac-admin /home/dev1/public_html/trac/dev1 wiki upgrade

$ ./bin/trac-admin /home/dev1/public_html/trac/dev1 wiki upgrade

I had to do the first easyInstall upgrade command only for the first site, then second site didn't need it (but still failed first for the virtualmin upgrade too, so had to manually upgrade too).

Don't have other trac installs to test, sorry.

You won't be able to run that command ./bin/trac-admin /home/site/public_html/trac/project1 upgrade from the command line unless you have PYTHONPATH set to something like : /home/site/public_html/lib/python

Virtualmin does this when doing the upgrade, which is why the trac-admin command works ..