Perforce Public Knowledge Base - P4DTI Migrating Perforce Jobs to Bugzilla
Reset Search
 

 

Article

P4DTI Migrating Perforce Jobs to Bugzilla

« Go Back

Information

 
Problem

How do I migrate Perforce jobs to Bugzilla via P4DTI?


Solution

Before P4DTI is started for the first time, any existing Perforce jobs must be deleted or P4DTI will not start. However, existing Perforce jobs can be preserved using the method outlined below. For more complete information about migrating Perforce jobs, see the P4DTI Advanced Administrator's Guide.

Before you begin migrating Perforce jobs you can specify the following items in config.py:

  • If users wish to continue using the Perforce job naming convention 'jobxxxxxx' set this function to 1:
    use_perforce_jobnames = 1 
    
    
  • If users will still be entering jobs in Perforce you can add this function:
    def replicate_job_p(job):
    return 1


Migrating existing jobs from Perforce to Bugzilla

  1. Set up a test Perforce installation using a backup of your production Perforce installation. Call this server "p4test". Please contact Perforce Support if you need a temporary license for your test server.
  • Set up a test Bugzilla installation.
  • Start another Perforce server in the two user (demo) mode. Call this server "p4temp".
  • Modify config.py to point to "p4temp" and your test Bugzilla installation. Make sure that the Bugzilla configuration accurately represents your current workflow. Examine the replicated_fields section in config.py, and add the Bugzilla fields you want to replicate to Perforce.
  • Start P4DTI using run.py to generate a jobspec for "p4temp". You can exit P4DTI once it finishes initializing.
  • Save your P4DTI generated jobspec using
    p4 jobspec -o > tempspec
    
    
  • Next, work with "p4test".
  • Modify config.py to point to "p4test".
  • Run p4 users and make sure that all users have valid email addresses.(P4DTI matches users based on email addresses.)
  • Run migrate_users.py to populate the Bugzilla database with your Perforce user's email addresses as Bugzilla user names.
  • Add the replicator_address from config.py as a Bugzilla user.
  • Save the jobspec using
    p4 jobspec -o > testspec
    
    
  • Run check_jobs.py to make sure that all of the jobs match the current jobspec. Correct any problems reported.
  • For debugging purposes, the best method is to initially set up config.py to only migrate a single job, via the migrate_p function in config.py, like the following:
    def migrate_p(job): 
    return job["Job"] == "job000001"
    
    
  • Write the translate_jobspec functions to translate jobs from the old jobspec to the new jobspec. Basically, you need to map the fields from testspec to tempspec. Modify two things in config.py:

    • translate_jobspec -- how the fields get translated required by Bugzilla
    • prepare_issue -- supply default values for fields required by Bugzilla

    Tip: You do not need to translate fields that have matching names in both jobspecs.

    There are some examples of this in the doc:

    http://public.perforce.com/public/perforce/p4dti/release/2.4.5/aag/index.html#section-4.7
     
  • Run migrate.py to see if the one job migrated correctly to Bugzilla.
  • Assuming the one job migrated correctly, try migrating all of the desired jobs, by modifying the migrate_p function in config.py.
  • Run refresh.py to update the jobs in your "p4test" server.
  • Now you are ready to start P4DTI in the normal mode with run.py.
  • Try creating a bug in Bugzilla, assign the bug, and fix it in Perforce.
  • Once you are satisfied the test system works properly:
    • backup the live Perforce and Bugzilla instances
    • make the required modifications to the live system (the same steps you did to the test systems.)
    • run the migration on the live system.
  • Once the migration is complete on the live system, the final step is to run refresh.py. The migration step copies the existing Perforce jobs data to the Bugzilla database. Running refresh.py replaces the existing Perforce jobs with the newly created jobs from the Bugzilla database.
Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255