How to convert a running version of PTS from version 1.6 to 1.7 2/12/97 ---------------------------------------------------------------------- $Id: convert,v 1.1.1.1 1997/06/17 17:33:52 shevett Exp $ ---------------------------------------------------------------------- PTS Version 1.70 has many structure changes from previous versions of PTS, not the least of which is the jump from Msql 1.0 to 2.0. This changeover is not trivial, and requires some working knowledge of how MSQL tables are formatted to do things right. *********************************************************************** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING *********************************************************************** This is -NOT- a trivial procedure. You have ample opportunies to really destroy the data within your PTS system. Part of this install is also the upgrade from Msql 1.0 to 2.0, which will require the recompilation of PHP/FI, and possible the rebuilding of your apache server. Be prepared. The way is perilous. ---------------------------------------------------------------------- This document gives the steps necessary to make the changeover if you wish to preserve your existing data. 1 msqldump all tables to .dump files a Create a temporary working directory b type 'relshow pts' to get a list of tables within PTS c For each table, tyhpe 'msqldump pts tablename > table.dump 2 Make a copy of these dump files to some safe location (say, bermuda) 3 remove 'primary key' entries from each file. a Edit each dump file, and remove the words 'PRIMARY KEY' wherever they appear 4 edit status.dump and change the word 'value' to 'label' in the table definition. 5 edit followups.dumps and change the 'f_text' field definition from a CHAR(255) definition to a TEXT(100) entry. Before: f_text CHAR(255), After: f_text TEXT(100), 6 edit projects.dump and change the 'problem' field definition from a CHAR(255) definition to a TEXT(100) entry. 7 edit tasks.dump and change the 'problem' field definition from a CHAR() definition to a TEXT(100) entry. 8 Add the 'group' field to the projects table a Edit projects.dump, and add the following line into the table definition right at the bottom, just after 'summary': group char(10) b Make sure there is a comma after the summary line. The last few lines should look like this now: summary CHAR(80), group char(10) ) \g c Go through each line of data, (all the lines starting with 'insert'), and add another ,'' to the end of the insert. So, for each entry, go to the end of the line, and, just before the right parentheses, insert a comma and two single quotes. 9 Drop the current database from msql 1.0.xx *** WARNING *** - this will -destroy- the current data within your PTS system. The only copy you will have of that data is what is in the edited files we are working with, as well as that one you shipped off to bermuda. (you did copy it, didn't you?) a Use 'msqladmin': 'msqladmin drop pts' 10 Go ahead and upgrade your MSQL server to 2.0b4 or later. (see the Hughes documentation on how to do this. Note that if you upgrade Msql, you should upgrade php/fi to 2.0b10 or later, and you'll have to recompile your apache module. 11 Create the new PTS database within the msql 2 server (see the 'install' doc for how to do this - but dont load the .struct table definitions). 12 Load the data into the msql 2.0 server a For each table you dropped from the old server, load them each up into the new server using 'msql': msql pts < followups.dump b Load up the new tables from the 'struct' definition that weren't in the old system msql pts < groups.struct c Add the new rows into 'prefs' that weren't in the old version: msql pts insert into prefs values('default','projmail','no','') \g insert into prefs values('default','taskmail','no','') \g 13 Create the new indexes a Go through each table, adding the new indexes: msql pts create index followups on followups (tid) \g create index groups on groups (id) \g create index people on people (login) \g create index prefs on prefs (login) \g create index projects on projects (pid) \g create index tasks_tid on tasks (tid) \g