DLXS Database Upgrade Utility
From DLXS Documentation
Revision as of 14:51, 24 July 2007
Contents |
Overview
This document describes the upgrade process for the dlxs database. This document assumes you are upgrading from a version 5 MySQL database used with DLXS release 12, 12a to a version 6 database MySQL for DLXS release 13. Please consult previous release documentation at http://docs.dlxs.org/ for upgrading from earlier database versions. Also, please note that the CSV database option is not supported in DLXS release 13, database version 6.
If you are currently running a version 5 CSV database you must create an empty MySQL database and run the script $DLXSROOT/bin/db/dbmove -s CSV -t MySQL to populate it before following the steps below. Please refer to the DBMOVE documentation for this step.
Each version of the database is meant to be run with a specific version of DLXS. For example, version 5 of the database works only with versions 12 and 12a of DLXS. If you need to have two or more versions of DLXS running, you will need to set up a database with the appropriate version for each DLXS installation. If this is of interest to you, contact DLXS Help for guidance in doing this.
Below is a series of steps to follow to upgrade your database. You should upgrade the database after installing the DLXS middleware since the upgrade script is part of the installation and depends on values you supply during installation.
Step 1. Dump a copy of your version 5 MySQL database
Use the mysqldump
command line client to dump a copy of your current version 5 MySQL DLXS database. For example:
% mysqldump -u dlxsadm -p dlxs_v5 > dlxs_v5_dump.sql<code></p>
. Please refer to this <a href="../installation/index.html#mysqlconfig">section</a> of the installation instructions for information on creating a MySQL database. Step 2. Create an empty MySQL database
<p>Create an empty MySQL database specifying the name you want it to have for your DLXS release 13 installation, e.g. <code>dlxs_v6
Step 3. Populate the empty MySQL database with the dump
Use the mysql
command line client to load the dump of your version 5 DLXS database into the empty database that will become a version 6 DLXS database after you upgrade it.
% mysql -u dlxsadm -p dlxs_v6 < dlxs_v5_dump.sql<code></p>
Step 4. Run the upgrade_5_6 script
<p>Bring the database into which you loaded the dump up to version 6 using the $DLXSROOT/bin/db/upgrade_5_6 script. There are no command line parameters to the script. It reads the server name, database name, username, and password out of $DLXSROOT/lib/LibGlobals.cfg as supplied by you at install time. </p>
<p><code>% cd $DLXSROOT/bin/db; ./upgrade_5_6<code></p>
<p>
<tbody align="LEFT">
IMPORTANT NOTE
</tbody>
Due to schema changes to the dynamic browse tables (ItemBrowse, ItemBrowseCounts, ItemColl) that are not backward compatible, the upgrade process will create new empty versions of these tables. Following the upgrade process it will be necessary to re-generate the data rows for these tables for collections other than the sample data collections sampletc_utf8, sampleic, and samplefa. Please consult the <a href="browse.html#PopulatingTables">dynamic browse database building documentation</a>
<p>Once the upgrade is completed you will have a version 6 DLXS database compatible with release 13 of the DLXS middleware.</p>
<p>The following is a list of changes that the upgrade script makes:</p>
<tbody align="LEFT">
SQL Command
DROP TABLE `DbStructure` DROP TABLE `Bkup_BibClass`, `Bkup_BibClassGroup`, `Bkup_Collection`, `Bkup_FindaidClass`, `Bkup_FindaidClassGroup`, `Bkup_GroupColl`, `Bkup_GroupData`, `Bkup_ImageClass`, `Bkup_ImageClassGroup`, `Bkup_TextClass`, `Bkup_TextClassGroup` ALTER TABLE `ImageClass` DROP `viewtabform` UPDATE `Collection` SET `appmodule`='ImageApp' WHERE `appmodule`='ImageApp/mysqlImageApp' ALTER TABLE `Collection` ADD COLUMN `authsystems` text UPDATE Collection SET authsystems='um' ALTER TABLE `ImageClass` ADD COLUMN `range_srchflds` text NULL DEFAULT NULL ALTER TABLE `ImageClass` ADD COLUMN `privileged_users` text NULL DEFAULT NULL ALTER TABLE `Collection` ADD COLUMN `browseupdatemodule` varchar(250) NULL DEFAULT NULL UPDATE `Collection` SET `browseupdatemodule`='BrowseUpdate/ImageMysqlBU' WHERE `class`='image' AND (`browseupdatemodule` IS NULL OR `browseupdatemodule`=) UPDATE `Collection` SET `browseupdatemodule`='BrowseUpdate/FindaidBU' WHERE `class`='findaid' AND (`browseupdatemodule` IS NULL OR `browseupdatemodule`=) UPDATE `Collection`, `TextClass` SET `browseupdatemodule`= CASE WHEN `encodingtype`='monograph' THEN 'BrowseUpdate/MonographBU' WHEN `encodingtype`='serialissue' THEN 'BrowseUpdate/SerialIssueBU' WHEN `encodingtype`='serialarticle' THEN 'BrowseUpdate/SerialArticleBU' ELSE NULL END WHERE `Collection`.`collid`=`TextClass`.`collid` AND (`browseupdatemodule` IS NULL OR `browseupdatemodule`=) ALTER TABLE `GroupData` DROP COLUMN `ignoreon` DROP TABLE `ItemBrowse` CREATE TABLE `ItemBrowse` (`idno` varchar(250) default NULL, `collid` varchar(250) default NULL, `field` varchar(250) default NULL, `value` varchar(250) default NULL, `rank` varchar(250) default NULL, KEY `idno` (`idno`), KEY `collid` (`collid`), KEY `field` (`field`), KEY `value` (`value`)) DROP TABLE `ItemBrowseCounts` CREATE TABLE `ItemBrowseCounts` (`collid` varchar(250) default NULL, `field` varchar(250) default NULL, `value` varchar(250) default NULL, `count` int(11) default NULL, KEY `field` (`field`), KEY `value` (`value`), KEY `collid` (`collid`)) DROP TABLE `ItemColl` CREATE TABLE `ItemColl` (`idno` varchar(250) NOT NULL default , `collid` varchar(250) default NULL, `moddate` date default NULL, `xmlmeta` text, `pagesequence` int(11) default NULL, KEY `idno` (`idno`), KEY `collid` (`collid`)) ALTER TABLE `PageviewFig` ADD INDEX(`seq`) DROP TABlE `sessions` CREATE TABLE `sessions` (`id` varchar(32) NOT NULL default , `a_session` longblob, PRIMARY KEY (`id`)) DROP TABLE IF EXISTS `BookBagDB_upgradetemp` CREATE TABLE `BookBagDB_upgradetemp` DEFAULT CHARSET=utf8 SELECT * FROM `BookBagDB` ALTER TABLE `BookBagDB_upgradetemp` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY ALTER TABLE `BookBagDB_upgradetemp` MODIFY `modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP ALTER TABLE `BookBagDB_upgradetemp` ADD INDEX `username_2` (`username`,`class`) ALTER TABLE `BookBagDB_upgradetemp` ADD INDEX(`shared`) ALTER TABLE `BookBagDB_upgradetemp` ADD INDEX(`class`) ALTER TABLE `BookBagDB_upgradetemp` ADD INDEX(`temp`) DROP TABlE `BookBagDB` ALTER TABLE `BookBagDB_upgradetemp` RENAME TO `BookBagDB` </tbody>
<p></p>