The next significant activity in the upgrade process is to ensure that we have the latest version of the program code. Now obviously if we're using a packaged installation, it's a relatively straightforward process to install the packages that relate to the new version. Unfortunately as we have no repositories on sourceforge.net, it can be a little bit more frustrating than it really should be. Still, hopefully you can find a package manager that will let you update the packages as needed.
However if you're making your own changes, or wish to run the
very latest developement code straight from the Subversion repository on
sourceforge, we've created a command line application called
upgrade. This conventionally lives in the install
directory of the source code tree and upgrades the application
code to the latest. It is perfectly possible to use the upgrade
command to place the latest subversion application code over
the top of a WACS installation installed by packages and wacssetup
. That should work just fine.
The application code and related icons and other HTML bits are looked
after by the upgrade command; to run this download and unpack the new
distribution source code tree, and as the super user (root)
run the following commands. Please make sure it is using the correct
wacs.cfg file by setting WACS_CONFIG
in the environment
if necessary:
# cd unpack_location
/install
# ./upgrade
WACS - Upgrade
--------------
Welcome to the WACS Upgrade script. This script will
attempt to upgrade an existing WACS installation to the
latest version. It does not attempt any of the initial
package installation steps, so if you've not installed
WACS before, you should be using easyinstall instead.
It will ask for confirmation before modifying any configuration
files (but as always you should have backups before upgrading
anything.
Do you wish to continue? (y/n): y
[...]
#
At the end of it's run, upgrade will print out some key notes about things that will require manual attention to get the new release working. The section below will give you some guidance on how these may be achieved.
The upgrade command will give you some information on what extra steps you may need to take to migrate to this release. For example, it may tell you that a new database field needs to be added to a particular model schema. If you've used the wacsschema command to update your schema, you don't need to worry about these.
If not, you will have to make the schema changes that are needed by
hand using your database's SQL command line tools.
In the transition from 0.5 to 0.6.x the mrace field was
added, and upgrade will tell you about this. First step is to find the
specification of the field from the appropriate SQL script in the
creation directory, so for Oracle this will be
creation/ora_models.sql
. From this you will see that the
field specification for Oracle is:
[...] mrace varchar2(15), [...]
You have three options for adding this to the database - you can choose to alter the existing schema (may leave fields in an odd order in describe); you can rename the existing table, create the new one, copy the data across and then repoint any relational constraints to the new table; or you can export your entire database, create a fresh one and import the records back in (the tools do not cover connections, saved searches or customised infra-structure tables (keywords, vendors, photographers) at present but are otherwise quite usuable). The former is quick and easy if the database supports it but leaves the field list in an odd order; the middle one is more work but produces a fully "normal" schema in the end but requires serious black magic if your database understands relational constraints. The final one is *VERY* experimental at this point but will improve with time.
Here is a worked example that shows how to use the alter table syntax in Oracle's SQL*Plus command interpreter to add one field called mrace:
% sqlplus [...] Username: wacs Password: **** sqlplus> alter table models > add ( mrace varchar2(15) ); Table altered. sqlplus> commit; Commit complete. sqlplus> desc models [...] MRACE VARCHAR2(15) sqlplus> quit %
Another issue you need to be aware of is that the upgrade script will
not over-write any existing files in the wacs web document tree (by
default this is /var/www/html/wacs
) because you may well
have tailored them and we wouldn't want to overwrite those. You may well
therefore need to look at what is in the htmlbones directory and copy
some of the new files across into your web tree, or merge the new html
into your modified version of the pages.
Obviously over time the defaults data we provide for the key database tables does get added to, improved and bug fixed. How you choose to handle this very much depends on how much you've customised your keywords, vendor and photographer data relative to the distributed versions. At the simplest level, it might be nice to simply reload everything but of course if your database enforces referential integrity as it should, you can't just drop an entire data set that has relations pointing to it. The current compromise is that the wacs data importer, wacspop will only create new entries that are not currently in the existing database. Any entry that is already there will remain unchanged, quite possibly not benefiting as it should from an update.