PQA Clearquest

  • Posted on
  • by
  • in
  • Hooked up new PQA schema database and data database
  • Starting to code merge routines
  • Created PQA Schedule (See below)

Moving MS/SQL Databases

Moving a MS/SQL Database from one host to another involves a bit of tweaking to get the new system to recognize that it has a new database. I will attempt to detail here what needs to be done.

In order to import Clearquest databases to a new MS SQL Database Server:

  1. Place imported datafile onto new machine.
  2. Start the MS SQL Server Enterprise Manager (C:\Windows\system32\mmc.exe /s "C:\Program Files\Microsoft SQL Server\80\Tools\BINN\SQL Server Enterprise Manager.msc")
  3. Expand tree until you see "(local)" then "Databases". Right click on Database and select New Database to create an empty new database. Name the database appropriately. On the Data Files tab we changed the default path of C:\Program Files\Microsoft SQL Server\MSSQL\data\<database name>.mdf to a more approriate place. Also check the Transaction Log tab to adust path.
  4. Restore database by right clicked on the new database you created and selecting All Tasks: Restore Database. Under Restore select From Device then click Add then find the restored db file. Under Options change the paths for Move to physical file name.
  5. For Clearquest Schema databases only (You may need to restart the SQL Server Enterprise Manager after the above restore of the database): Since Clearquest uses a database to hold the schema and that schema points to known user databases, importing a Clearquest schema will have entries that point over to projection databases! These need to change:
    • In SQL Sever Enterprise Manager locate your imported schema database and double click on Tables.
    • Find master_dbs, right click on master_dbs and select Open Table: Return All Rows.
    • Change the server column to the name of the new server
    • Select Run (the ! symbol in the toolbar)
  6. Folllow instructions at How to resolve permission issues when you move a database between servers that are running SQL Server for fixing permissions problems.
  7. Import user databases. Note the fix above regarding master_dbs:server is not required for user databases

Merge Routines and Connecting to Multiple Schemas

With two schema databases I was having problems with my Perl script connecting to the databases. In the past I had:

      ## Internal variables ##
      my $session;
      my $login           = "admin";
      my $password    = "*****";
      my $masterdb    = ""; # Don't need a masterdb (Using default?)
      my $db_name;
    ...
      sub StartSession {
        $db_name = shift;

        $session = CQPerlExt::CQSession_Build ();

        $session->UserLogon ($login, $password, $db_name, $masterdb);
      } # StartSession

Now when I run this in the presence of two schema databases I get:

The database "MASTR" belonging to master database "2002.05.00" is an invalid name. Enter the correct name of a ClearQuest user database. at c:/Program Files/Rational/ClearQuest/lib/CQPerlExt.pm line 3713.

I think I need to specify the proper $ masterdb name but I don't know what that might be... Hmmm... Seems that $masterdb is really just the Connection name that you'd see when you start Clearquest Designer or Clearquest Client and there are multiple schemas to choose from. That's odd because that could be potentially anything as the user could rename it. However if I use PQA_Old on p4test (which is what I named the old schema connection) then it works.

OK, more work on this tomorrow. I have already defined the new defect record in my Perl module. I just have to start coding the merge routines now...

PQA Schedule

The following is a rough estimate of the work needed to be completed to get to the point where we are ready to convert the live production databases

  • Restore new Schema DB and Data DB (1 Day)
  • Investigate record/field mappings (2 Days)
  • Determine order fo record additions (1 Day)
  • Investigate requirements for adding of records to Clearquest (2 Days)
  • Code/Test merge procedures (3 Day)
  • Test conversion on p4test (4 Days)

Total: 13 Days