Trac 0.11.7 -> 0.12 upgrade through virtualmin fails

Upgrading Trac to version 0.12 ..
Found http://ftp.edgewall.com:80/pub/trac/Trac-0.12.tar.gz in cache ..
Found http://www.saddi.com:80/software/flup/dist/flup-1.0.tar.gz 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: http://trac.edgewall.org/wiki/TracUpgrade

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
Status: 
Active

Comments

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 :

http://trac.edgewall.org/wiki/TracUpgrade

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/pkg_resources.py", line 2561, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 626, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", 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
Reading http://pypi.python.org/simple/Trac/
Reading http://trac.edgewall.org/
Reading http://trac.edgewall.org/wiki/TracDownload
Reading http://trac.edgewall.com/
Reading http://projects.edgewall.com/trac
Reading http://projects.edgewall.com/trac/wiki/TracDownload
Best match: Trac 0.12
Downloading ftp://ftp.edgewall.com/pub/trac/Trac-0.12.zip
Processing Trac-0.12.zip
Running Trac-0.12/setup.py -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
Reading http://pypi.python.org/simple/Genshi/
Reading http://genshi.edgewall.org/
Reading http://genshi.edgewall.org/wiki/Download
Best match: Genshi 0.6
Downloading http://ftp.edgewall.com/pub/genshi/Genshi-0.6-py2.5.egg
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 ..