head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	2001.06.28.00.35.15;	author ms;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Factored out the migrate scripts in each migration path into master migrate.
upgrade_tigris calls migrate which in turn does the proper actions for the migration path to upgrade.
Added ScriptOrder.lst to each migration path which lists scripts to run, takes relative or full paths.
migrateIZ is the script I wasnt easily able to factor away from the old classic-1.0.0/migrate script so it gets called in the ScriptOrder.lst.
@
text
@#!/bin/sh

SBX=/home/ms/sandbox
DIR=/home/ms/sandbox/helm/scripts/migration/classic-1.0.0

IZDB=$IZ_DATABASE_NAME
DBUSR=$DATABASE_USER
DBPW=$DATABASE_PASSWORD
DB=$DATABASE_NAME

DBADMIN=$DATABASE_ADMIN_USER
DBADMINPW=$DATABASE_ADMIN_PASSWORD

if [ -z "$IZDB" ]; then
    IZDB='issues'
fi

echo "Setting the issues database to '${IZDB}'"

# Upgrade the issues database: 
# NOTE: it is assumed that this upgrade is a special case (classic 
# to 1.0), and that therefore there is only a single issues database
# to upgrade. 

if [ ! -d /var/lib/mysql/${IZDB} ]; then 
 
  echo "/var/lib/mysql/${IZDB} not found; looking for bugzilla"

  # There are two kinds of 'classic' here - classic with bugzilla
  # (with tables in the tigris database), and classic with issuezilla
  # (with a free-standing 'issues' database).  In the case of the 
  # former, we need to take special steps first to isolate and upgrade
  # the db to 'issues' before proceeding:

  # Remove all the bugzilla-related table from the old database,
  # and put them in their own database (before dropping them from
  # tigris database):

  echo "Extracting bugzilla from ${DB} to ${IZDB}"
  $DIR/bugzilla_extract_from_joist.pl -t ${DB} \
    -u ${DBADMIN} -p ${DBADMINPW} -i ${IZDB}

  echo "Upgrading bugzilla to issuezilla"
  # Upgrade to issuezilla:
  mysql -u${DBUSR} -p${DBPW} ${IZDB} \
    < $DIR/BZ_TO_IZ.issuezilla.sql 
fi

@
