Friday, December 1, 2017

Creating Development Schema Repositories

Posted on 
When you have multiple Clearquest Designers you quickly realize that you cannot easily do parallel development of the schema. The best way to do this is to work through a development schema repository and to create development schemas for each schema designer. To create a development schema repository you should first create an empty database for Clearquest to work in. You can create an empty database by following the instructions for Creating a Test Database. Next you must use the Clearquest Maintenance Tool to create a new Schema Repository:
  • Start the Clearquest Maintenance Tool
  • Select Schema Respository: Create
  • The Maintenance Tool then asks you to fill out information regarding the location of your schema database. Fill in information about the database server and Administrator Name and password. Do not create a sample database at this time. The Clearquest Maintenance tool will take some time to set up the new schema repository.

Exporting a CQProfile.ini for this new Development Schema Repository

In order to see this new development schema repository you should export the schema repository from the Clearquest Maintenance Tool. This exported cqprofile.ini can be shared with out Schema Developers who would import the .ini file into their environment using the Clearquest Maintenance Tool. You export the cqprofile.ini by selecting File: Export Profile. You need only select the new repository you created.

Click on the "..." button to select where to store the .ini file and what it's name will be - I used C:\Cygwin\tmp\MPSDev.ini and click Finish. This file can be passed to your fellow Schema Developers.

Importing Users

Your new development schema repo has no users in it except a default set of users including the "admin" user (with no password). Run the User Administration tool on production (MCBU) and export all of the users. Run the User Administration tool again on the new development schema repo (e.g. MPSDev) and import the users.

Clean up Unnecessary Schemas

Now's a good time to remove additional default schemas in your development schema repo like Common, DefectTracking, Enterprise, etc. You cannot delete the Blank schema.

Seeding the Development Schema Repo with the Latest Version from Production

One trick to seed your new development schema repo with a recent version of the production schema is to create a new development schema in the production schema repo based off of the latest version of the production schema. Then export that whole schema of the new development schema and import it into the new development schema repo. You will only have the history of the latest version of the schema but that's OK for development purpose. Make sure you specify an appropriate Schema Name and Comment when you export the schema from production:

Note: We are giving this schema the name MPSDev because that's what we want it to be called in the new development schema repo. Also, the comment is appropriate when we will be looking at it in the MPSDev development schema repo.

Do not associate a database with this schema, there's no reason. We don't care as we are only using this to exportschema from production -> development schema repo. We'll create databases there. We don't need to check out this schema either.

Exporting the Schema from Production

We assume you have created a new development schema in the production schema repo based off of the tip of the production database. You need to export that with:

$ cqload exportschema -dbset MCBU admin <password> <schemaname> <path to <schemaname>.full.schema>]]>

Where <schemaname> is the name of the development schema name you created in the production schema repo

Importing the Schema into the Development Schema Repo

Next we import this full.schema of only the tip of production to seed a development schema in the development schema repo.

$ cqload importschema -dbset MPSDev admin <password> <path to <schemaname>.full.schema> ********************************************************* Starting importschema ********************************************************* CRMMD1264E The import file ".\MPSDev.full.schema" is invalid: CRMMD1422E The schema requires the following package(s), which is(are) not currently installed in the database... revision '2.1' of package 'EmailPlus' revision '1.2' of package 'Resolution' revision '2.1' of package 'Attachments'. ********************************************************* ERROR: importschema FAILED! *********************************************************

Oops! We need to import these packages into our new schema. Right click on your new development schema repo in Clearquest Designer and select Install Package. Expand the EmailPlus and select 2.1 to install that. Repeat this for Resolution and Attachments. Repeat the cqload importschema.

Remove Old Schema in Production Repo

You can remove the schema you created above in the Production repo as it is no longer needed.

Create Dev Schemas

You are now free to create development schemas in the new development schema repo as described Creating a Development Schema as well as test databases and seeding them.

No comments:

Post a Comment

Posted on  November 23, 2005 Continued to help several users with connecting to the new Controller Clearquest Database for Vinh...