Instructions for installing BugTrack on
Windows 2000 with IIS 5.0 and Sql Server 2000
Last Update 3/9/2002
8. Initialize the BugTrack Database

This step initializes the database, but to prepare for that you'll need to modify 3 perl files that are part of BugTrack. You can use any text editor, like NotePad, for this step.
  1. Find and open the file named \tools\setup.pl where BugTrack is installed.
  2. Change the following lines:

    } elsif (conf::getDBDSN() =~ /ODBC/) {
    $INCR = 'counter';
    $DATE = 'date';
    $TEXT = 'memo';


    to:

    } elsif (conf::getDBDSN() =~ /ODBC/) {
    $INCR = 'int identity(1,1) primary key';
    $DATE = 'datetime';
    $TEXT = 'text';


  3. Because of an idiosyncracy with Sql Server, you will now have to make manual changes to the data types for some columns defined in the \tools\setup.pl script. Specifically, any column with a name that ends in '_id' with a data type of 'int' needs to be changed to 'varchar(8)'. For instance, the create table statement for the bug_cvs table looks like this:

    push @sql, qq {
      create table bug_cvs (id $INCR not null,
      bug_id int not null,
      filename varchar(200) not null)
    };


    This needs to be changed to:

    push @sql, qq {
      create table bug_cvs (id $INCR not null,
      bug_id varchar(8) not null,
      filename varchar(200) not null)
    };


  4. Make the same change to all other columns with names ending '_id' in all other table definitions, then
  5. Save and close this file.
  6. Find and open the file named \lib\conf.pm where BugTrack is installed.
  7. Change the following lines:

    # Set the database access information
    my $db_dsn = 'dbi:Pg:dbname=bt';
    my $db_user = 'adam';
    my $db_pass = '';


    to:

    # Set the database access information
    my $db_dsn = 'dbi:ODBC:bt';
    my $db_user = 'BugTrackDBO';
    my $db_pass = '{your password here}';


  8. Be sure to put your password where I've written {your password here}.
  9. Save and close this file.
  10. One more change. Find and open the file named \lib\dbase.pm where BugTrack is installed.
  11. Change the lines:

    foreach $field (@fields) {
        if (($field =~ /description/) or
       ($field =~ /comment/) or
       ($field =~ /notify/)) {
        $st->bind_param($i, $sql, DBI::SQL_LONGVARCHAR);
        }
        $i++;
    }

    by commenting out one line:

    foreach $field (@fields) {
        if (($field =~ /description/) or
       ($field =~ /comment/) or
       ($field =~ /notify/)) {
    #   $st->bind_param($i, $sql, DBI::SQL_LONGVARCHAR);
        }
        $i++;
    }

    Make certain the pound sign(#) is in the very first column of the line.

  12. Press the Windows Start button, select Run, type in command, and press OK.
  13. Navigate to the installation directory for BugTrack and
  14. Make tools your current subdirectory (e.g., CD\bt-2.9\tools).
  15. Type in Perl setup.pl and press Enter.
Assuming everything up to this point has been done correctly, that should successfully create all of the BugTrack tables in the database.
<Back  |  Next>