Home Company Services Portfolio Contact us nav spacer

As root, install these:

  apt-get install build-essential zlib1g-dev libjpeg62-dev tk8.4-dev
  apt-get install libxml2-dev libssl-dev libxslt1-dev
  apt-get install python2.4 python2.4-dev python-virtualenv

As normal user from here on

Check out the buildout and create python environment:

  cd $HOME/instances
  svn co https://svn.upfronthosting.co.za/svn/upfront/Wqms/branches/oit-buildout wqms_oit
  virtualenv --python=/usr/bin/python2.4 --no-site-packages wqms_oit

Download and install python imaging:

  pushd /tmp
  wget http://packages.upfronthosting.co.za/sources/python-imaging/python-imaging_1.1.5.orig.tar.gz
  tar zxf python-imaging_1.1.5.orig.tar.gz
  cd Imaging-1.1.5
  $HOME/instances/wqms_oit/bin/python setup.py install
  popd

Bootstrap and run buildout:

  cd wqms_oit
  bin/python bootstrap.py
  bin/buildout -v

Create a new database, season to your own tastes, but remember to edit parts/instance/product.conf if you veer off the beaten path:

  $ mysql -u root
  mysql> create database wqms
  mysql> grant all privileges on wqms.* to wqmslinux@localhost identified by 'lkfh347kgut3';
  mysql> flush privileges;
  mysql> \q

Get the new staging database, assuming you already have wqms.sql.gz, which should be a dump of the current staging database:

  zcat wqms.sql.gz | mysql -u wqmslinux -plkfh347kgut3 wqms

Run the oit migration scripts. For any .sql file, pipe it into mysql like so:

  mysql -u wqms -plkfh347kgut3 wqms < products/Wqms/dbscripts/oit_migration/00_treatmentprocess.sql

For any .py file, do this:

  bin/python bin/instance run \
    products/Wqms/dbscripts/oit_migration/03_sampledata_categories_default.py

NB NB NB very important

A bug in buildout and/or virtualenv creates the scripts in the bin directory with the wrong #! interpreter at the top. This causes it to run /usr/bin/python2.4 instead of $HOME/instances/wqms_oit/bin/python, which in turn messes up the PYTHONPATH causing it not to find PIL. For this reason you must start the instance like this:

    bin/python bin/instance fg

"bin/instance fg" or "./bin/instance fg" or your custom "zope" alias will almost certainly cause problems.