Chapter 9. Upgrading An Existing Installation

Table of Contents

About Upgrading
Introduction
The WacsSchema Command
Software & Data Upgrade Tools
The Upgrade Command
Additional Steps
Upgrading The Data

About Upgrading

Introduction

While it is obviously vital to be able to upgrade an existing WACS installation from one release to another, there are a great number of factors that come into play. It is not always easy to resolve these and with WACS we've taken a modular approach to handling the issues presented. This means that we've provided tools for the necessary changes as separate entities and then integrated them together with the existing wacssetup web application to provide a wide palette of options. You can choose to let wacssetup walk you through the whole upgrade process, or you can choose to use each tool individually to customise the process to your needs.

The key things that need to be considered are:

Table 9.1. Aspects of an Upgrade

WhatDescriptionApplication
Database SchemaThis covers the shape of the database, the information it stores and how it does sowacsschema
Application CodeThe actual code of the applications themselvesOS Package Manager or upgrade command
Predefined ValuesThis covers the various pre-defined data like keywords, icon associations, photographer info and the likewacspop
New Fields ContentThis covers how new fields in existing records will be populated to allow the new applications to make use of themT.B.A.

We will discuss each of the tasks and the tools available to help with it individually before then walking you through letting wacssetup preform the entire process for you.

The WacsSchema Command

The new wacsschema compares the structure of the database to which it is currently talking with the files in the creation directory distributed with the latest version of the application code. If these differ, it provides a mechanism to update the existing database schemas to the new structure or to create new schemas where they are not present it the current database. This application is very unusual in that it has both a command line and web mode of operation, both of which function essentially in the same way. In general, it will ignore local customisations and leave them untouched during the upgrade process.

[Warning]Warning

Changing the database structure is by it's very essence a tricky process and you should make absolutely sure you have good backups before attempting it. Seriously, please don't ignore this warning!

The first page shown to you by the wacsschema is a simple summary of the current state and takes no actions, so it's not fundamentally dangerous to invoke it. Just don't click on the Make These Changes button unless you're very sure and have backups! Shown below is typical of what it says if run on an upgraded installation that still has a pre-Wacs 0.8.5 database schema:

As you will see from this, it has determined that there are missing fields from the sets, models and keyword database schemas; that user, attrib and notes schemas are missing entirely. All the other database schemas are found to be complete and up to date. In the web version, it gives you the option to click on the Make These Changes button and it will run the appropriate SQL (we HOPE) to alter and/or create the database schemas as necessary.

[Note]Note

wacsschema does not remove any fields it does not recognise, so existing additional custom database fields will be left intact. Additionally it uses the SQL scripts relevant to the SQL Database type being used (ie MySQL5, Oracle, etc) from the creation directory within the wacs installation. Were you to add extra fields into those files, wacsschema would attempt to add them for you.

For those of you who either prefer command line applications or who are using a web hosting service where wacssetup doesn't work, wacsschema will automatically work in text-only mode if it doesn't detect that it's been run by a web server. Shown below is what it says when run in text mode:

% wacsschema
Schema photographer is unchanged.
Schema vendor is unchanged.
Schema sets is missing fields saltmedia, sfocus, sfps, sinter, snext, 
sprev, srank, ssetpos, sskipfr.
Schema models is missing fields magency, maltimage, mbirthdate, mbody
image, mdress, mlabia, monfile, mstarsign.
Schema assoc is unchanged.
Schema idmap is unchanged.
Schema download is unchanged.
Schema tag is unchanged.
Schema conn is unchanged.
Schema keyword is missing fields kiwear, kiwscore.
Schema user is not present in current database.
Schema attrib is not present in current database.
Schema notes is not present in current database.
%

As you will see wacsschema returns to the command prompt after delivering it's verdict on the database schema. If you want the Text Mode version to actually make the changes, you need to run wacsschema with the -y option. Thus to actually perform the schema update, you would use:

% wacsschema -y
[...]
%

In the next chapter we will see the use of wacsschema as integrated into the wacssetup for a simple and straightforward WACS upgrade.