Talented application that it is wacssetup can now handle upgrading an existing installation as well as configuring a new one. Well at least since Wacs 0.8.6 it can, with a little help from it's friends wacsschema and wacspop!
Before attempting anything as fundamental as altering the database schema, it's vitally important to back up the database first. So before we actually run wacssetup to do the upgrade, we'll take a dump of the database to disc just in case.
For MySQL5 the simplest way of taking a suitable database dump is to use the mysqldump supplied as part of MySQL. Typical usage is as follows:
Tip | |
---|---|
Do make sure that you've got space to store the resulting database dump file in the current directory. mysqldump can be run in any directory. You might want to make a special directory to store such dumps in. |
% mysqldump -u wacs -p wacs > wacs-db-dump.mysql
Enter password:
%
The parameters are -u
followed by the username
you use to access the wacs database. If you've forgotten what this is, the
dbuser value in the /etc/wacs.d/wacs.cfg
is the one you want for this. The next parameter is -p
which tells it to prompt you for a password. The final parameter is the
name of the wacs database; again this can be confirmed from the
dbname value in the wacs config file. The greater-than (>) sends
the output into the file we've named wacs-db-dump.mysql
(you might want to include the date in the name). The mysqldump
program will then prompt for a password and silently perform the
dump unless there's a problem.
It's also a good idea to check the file has been created. If you run the linux head command on the resulting database dump, it should look something like this:
% head wacs-db-dump.mysql
-- MySQL dump 10.13 Distrib 5.1.56, for redhat-linux-gnu (x86_64)
--
-- Host: localhost Database: wacs
-- ------------------------------------------------------
-- Server version 5.1.56
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
[...]
%
For Oracle 10 databases, it's probably best to use the database
export command, exp. You invoke exp
without options and simply follow the prompts and in most cases accept
the defaults. Here we've chosen to specify the name of the database dump
file as wacs-dump-31Jul11.dmp
instead of the default
of expdat.dmp
.
% exp Export: Release 11.1.0.6.0 - Production on Sun Jul 31 07:50:46 2011 Copyright (c) 1982, 2007, Oracle. All rights reserved. Username: wacs Password: Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Enter array fetch buffer size: 4096 > Export file: expdat.dmp > wacs-dump-31Jul11.dmp (1)E(ntire database), (2)U(sers), or (3)T(ables): (2)U > Export grants (yes/no): yes > Export table data (yes/no): yes > Compress extents (yes/no): yes > Export done in US7ASCII character set and AL16UTF16 NCHAR character set server uses WE8MSWIN1252 character set (possible charset conversion) About to export specified users ... User to be exported: (RETURN to quit) > wacs User to be exported: (RETURN to quit) > . exporting pre-schema procedural objects and actions . exporting foreign function library names for user WACS . exporting PUBLIC type synonyms . exporting private type synonyms . exporting object type definitions for user WACS About to export WACS's objects ... . exporting database links . exporting sequence numbers . exporting cluster definitions . about to export WACS's tables via Conventional Path ... . . exporting table ASSOC 36065 rows exported EXP-00091: Exporting questionable statistics. . . exporting table CONN 429 rows exported EXP-00091: Exporting questionable statistics. . . exporting table DOWNLOAD 44141 rows exported EXP-00091: Exporting questionable statistics. . . exporting table IDMAP 4457 rows exported EXP-00091: Exporting questionable statistics. . . exporting table KEYWORD 171 rows exported EXP-00091: Exporting questionable statistics. . . exporting table MODELS 3402 rows exported EXP-00091: Exporting questionable statistics. . . exporting table PHOTOGRAPHER 75 rows exported EXP-00091: Exporting questionable statistics. . . exporting table SETS 33882 rows exported EXP-00091: Exporting questionable statistics. . . exporting table TAG 1026 rows exported EXP-00091: Exporting questionable statistics. . . exporting table VENDOR 15 rows exported EXP-00091: Exporting questionable statistics. . exporting synonyms . exporting views . exporting stored procedures . exporting operators . exporting referential integrity constraints . exporting triggers . exporting indextypes . exporting bitmap, functional and extensible indexes . exporting posttables actions . exporting materialized views . exporting snapshot logs . exporting job queues . exporting refresh groups and children . exporting dimensions . exporting post-schema procedural objects and actions . exporting statistics Export terminated successfully with warnings. %
With the database now backed up, we can proceed to use wacssetup to perform the upgrade. As usual you can invoke wacssetup by following the link on either the WACS front page or by typing it directly. On most package WACS installations it's URL will be: http://localhost/cgi-bin/wacs/wacssetup.