October 18, 2007

Migrating Perforce Jobs

Helix ALM

Works with TestTrack 7.6 and later

Works with P4COM API released on 9/07

This article includes information for migrating Perforce Jobs into TestTrack Pro. This application should not alter your Perforce server, but run it at your own risk. Be sure to back up!You'll need:
  • Working Perforce client/server installation.
You'll get:
  • A comma-separated value file that contains your Perforce Jobs, ready for import into TestTrack Pro.

Download

The download contains the source files and binaries for the application. Download the P4JobExport zip file.
  • P4JobExport.exe - Executable built with C# .Net and Visual Studio 2005. The application exports Perforce Jobs to a comma-separated value file, ready for import into TestTrack Pro.
  • Source Code - Visual Studio 2005 solution and all required source code to build the executable. You only need this if you want to make changes to the application or it doesn't work as-is in your environment.

Application Overview

The application and accompanying library should run without any additional configuration. The application connects to your Perforce server using your cached credentials from the system. If this doesn't work in your environment, you can update the source to specify connection data manually. The application accepts one parameter, which is an optional file path/name for the CSV output file. If this is not given, the CSV will be output to the execution directory. The application also writes a log file to the execution directory. The application does not return success or failure, so you should check the log file thoroughly to ensure everything worked as expected. The application uses the P4COM interface to interact with the Perforce server. The dll is included in the source, and is required to build the application (be sure to register it).

Application Flow

  1. Connect to Perforce server.
  2. Fetch users via the users command, and retain <username/full name> pairs.
  3. Fetch jobs via the jobs -l command.
  4. Parse jobs, building one csv line per job.
    • Maintain list of distinct Job field names.
    • Replace every username with matching full name.
  5. Write CSV line for distinct Job field names.
  6. Write CSV line for every Job.
  7. Exit