flipturn.org - stuff. things. other stuff.
dvorak | pantera | hacks


Here are my notes on upgrading my original TracOnDreamhost installation to Trac 0.11.

Upgrading Software

Install the python packages using the default python 2.3 supplied by dreamhost, but in my local site-packages. Note that due to the svn post-commit problems I describe below, I'm forcing the eggs to be installed as unzipped packages.

  • easy_install -Z --prefix=$HOME Trac=0.11

Install the openid authentication plus the required support libraries:

  • easy_install -Z --prefix=$HOME python-openid
  • cd ~/src
  • wget http://hg.sandbox.lt/authopenid-plugin/archive/v0.1.3.tar.gz
  • tar xfvz v0.1.3.tar.gz
  • easy_install -Z --prefix=$HOME authopenid-plugin-v0.1.3
  • easy_install -Z --prefix=$HOME ElementTree

Database Updates

The database and wiki have to be updated, but make sure to create a backup because it's not automated if you want to downgrade again

  • trac-admin $TRAC_ENV upgrade --no-backup
  • trac-admin $TRAC_ENV wiki upgrade

Converting Wiki-Macros

The MilestoneTickets macro has to be converted into the new format plugin and moved to the $TRAC_ENV/plugins directory. This wasn't as difficult as I anticipated, despite not being able to find any conversion howto here or here. I eventually found the updated TicketBoxMacro on which I had originally based my macro. Looking at the source I was able to figure out how to get the environment from the formatter:

def execute(formatter, txt):
    env = formatter.env

and the boilerplate to create the macro entry:

from trac.wiki.macros import WikiMacroBase

class MilestoneTicketsMacro(WikiMacroBase):

    def expand_macro(self, formatter, name, args):
        """Return some output that will be displayed in the Wiki content.

        `name` is the actual name of the macro (no surprise, here it'll be
        `args` is the text enclosed in parenthesis at the call of the macro.
          Note that if there are ''no'' parenthesis (like in, e.g.
          [[MilestoneTickets]]), then `args` is `None`.
        return execute(formatter, args)


The old Trac 0.10.* cgi scripts still seem to work; you'll just need to remove the old trac directory from $HOME/lib/python2.3/site-packages directory so that python will pick up the new Trac 0.11 install.


One of the appeals of moving to Trac 0.11 was the OpenID support. The AuthOpenID plugin works as advertized, but you'll have to create new permissions for the initial admin user::

trac-admin $TRAC_ENV permission add https://your_openid_url TRAC_ADMIN

Subsequent permissions you can modify using the web interface now built in to Trac 0.11.

svn post-commit script

There's a nice svn post-commit script that updates Trac tickets on checkin. It stopped working after I upgraded to Trac 0.11.

After putting some verbose output in the script, I found out that zipped python eggs need a directory to be unzipped, and they were defaulting to the /dh/apache/.python-eggs directory which didn't have permissions. I added the line

export PYTHON_EGG_CACHE='/home/[username]/svn/[svn-project]/hooks/tmp'

to the svn post-commit bash script, and that worked.

A better solution is to avoid zipped python eggs. I reinstalled everything as unzipped eggs (as reflected above) and I don't have to use this PYTHON_EGG_CACHE hack.

Testing the post-commit script

The post-commit script can be tested from the command line:

./post-commit /home/[username]/svn/[svn-project] revision_number

Adding email responders

Trying to set up email notification, I changed the notification section of the trac.ini to:

always_notify_owner = true
always_notify_reporter = false
always_notify_updater = true
mime_encoding = base64
smtp_always_bcc = username@mail.yourdreamhostdomain.com
smtp_always_cc = 
smtp_default_domain = 
smtp_enabled = true
smtp_from = username@mail.yourdreamhostdomain.com
smtp_password = your_password
smtp_port = 25
smtp_replyto = username@mail.yourdreamhostdomain.com
smtp_server = mail.yourdreamhostdomain.com
smtp_subject_prefix = __default__
smtp_user = username@mail.yourdreamhostdomain.com
use_public_cc = false
use_short_addr = false
use_tls = false

I had a hard time figuring out the SMTPAuthenticationErrors that were occurring in the trac log. I found a simple python example to test SMTP and figured out that the username that Dreamhost expects includes the hostname, so for smtp_user use username@mail.yourdreamhostdomain.com instead of just username.

Dreamhost server change

On 1 Sep 2009, dreamhost changed my server and this new server doesn't use python 2.3 as the default anymore: it uses python 2.4. This broke my trac instance. However, it looks like mysql and svn support are available by default in the new /usr/lib/python2.4/site-packages, so maybe I can use the new python 2.4 if I update my trac scripts?

UPDATE: yep, it looks like by changing ~/trac.yourdreamhostdomain.com/index.fgci to change the references from python 2.3 to python 2.4, it picks up the mysql and svn libraries from /usr/lib/python2.4/site-packages, and OpenID from ~/lib/python2.4/site-packages. Had to reinstall authopenid package using easy_install --prefix=$HOME -UZ . after commenting out the install_requires stanza in setup.py. The easy install dependency stuff didn't seem to be working on dreamhost, so I installed the python-openid package manually.

erection pharmacy erection pills new york erection pills new york erection pharmacy
free levitra sample pack cialis professional online cialis over the counter levitra over the counter