DLXS Database Upgrade Utility
From DLXS Documentation
Main Page > Working with DLXS Components > Working with DLXS Utilities and Applications > DLXS Database Upgrade Utility
These instructions assume you are upgrading from a version 6 MySQL database used with DLXS release 13 to a version 7 database MySQL for DLXS release 14.
Contents |
Overview
This document describes the upgrade process for the dlxs database. This document assumes you are upgrading from a version 6 MySQL database used with DLXS release 13 to a version 7 database MySQL for DLXS release 14. Please consult previous release documentation at http://docs.dlxs.org/ for upgrading from earlier database versions.
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 6 MySQL database
Use the mysqldump
command line client to dump a copy of your current version 6 MySQL DLXS database. For example:
% mysqldump -u dlxsadm -p dlxs_v6 > dlxs_v6_dump.sql
Step 2. Create an empty MySQL database
Create an empty MySQL database specifying the name you want it to have for your DLXS release 14 installation, e.g. dlxs_v7
. Please refer to this section of the installation instructions for information on creating a MySQL database.
Step 3. Populate the empty MySQL database with the dump
Use the mysql
command line client to load the dump of your version 6 DLXS database into the empty database that will become a version 7 DLXS database after you upgrade it.
% mysql -u dlxsadm -p dlxs_v7 < dlxs_v6_dump.sql
Step 4. Run the upgrade_6_7 script
Bring the database into which you loaded the dump up to version 6 using the $DLXSROOT/bin/db/upgrade_6_7 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.
% cd $DLXSROOT/bin/db; ./upgrade_6_7
IMPORTANT NOTE |
---|
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 dynamic browse database building documentation |
Once the upgrade is completed you will have a version 7 DLXS database compatible with release 14 of the DLXS middleware.
The following is a list of changes that the upgrade script makes:
SQL Command |
---|
UPDATE `Version` SET `version`='7.0' |
ALTER TABLE Collection ADD `sponsor` text |
UPDATE Collection set `sponsor`= WHERE class='bib' |
UPDATE Collection set `sponsor`= WHERE class='text' |
UPDATE Collection set `sponsor`= WHERE class='findaid' |
UPDATE Collection set `sponsor`= WHERE class='image' |
ALTER TABLE Collection ADD `oai` varchar(250) |
UPDATE Collection set `oai`= WHERE class='bib' |
UPDATE Collection set `oai`= WHERE class='text' |
UPDATE Collection set `oai`= WHERE class='findaid' |
UPDATE Collection set `oai`= WHERE class='image' |
ALTER TABLE Collection MODIFY `host` varchar(250) DEFAULT 'localhost' |
ALTER TABLE `BookBagDB` MODIFY `username` varchar(255) NOT NULL |
ALTER TABLE ImageClass ADD `brwsadds` varchar(250) |
UPDATE ImageClass set `brwsadds`= 'off' WHERE class='image' |
ALTER TABLE ImageClass ADD `recordcount` varchar(250) |
UPDATE ImageClass set `recordcount`= WHERE class='image' |
ALTER TABLE ImageClass ADD `mediacount` varchar(250) |
UPDATE ImageClass set `mediacount`= WHERE class='image' |
CREATE TABLE `oaisets` (`id` varchar(150) NOT NULL default , `oaiset` varchar(32) NOT NULL default , PRIMARY KEY (`id`,`oaiset`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 |
CREATE TABLE `oai` (`id` varchar(150) NOT NULL default , `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `oai_dc` mediumblob, `mods` mediumblob, `marc21` mediumblob, PRIMARY KEY (`id`), KEY `timestamp` (`timestamp`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 |
CREATE TABLE `nameresolver` (`id` tinytext NOT NULL, `coll` tinytext, `url` tinytext, `modified` timestamp NOT NULL default CURRENT_TIMESTAMP, PRIMARY KEY `id` (`id`(300),`coll`(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8 |
ALTER TABLE `idresolver` MODIFY `url` mediumtext NULL |