<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=MigrateBugzillaToRT</id>
	<title>MigrateBugzillaToRT - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=MigrateBugzillaToRT"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=MigrateBugzillaToRT&amp;action=history"/>
	<updated>2026-08-21T19:28:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=MigrateBugzillaToRT&amp;diff=2194&amp;oldid=prev</id>
		<title>Admin: 2 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=MigrateBugzillaToRT&amp;diff=2194&amp;oldid=prev"/>
		<updated>2016-04-06T20:14:35Z</updated>

		<summary type="html">&lt;p&gt;2 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; &amp;lt;nowiki&amp;gt;**************************&lt;br /&gt;
 * Bugzilla RT migration&lt;br /&gt;
 * Javier Garcia&lt;br /&gt;
 * Snow Valley&lt;br /&gt;
 * javier(dot)garcia(at)snowvalley(dot)com&lt;br /&gt;
 * 24/04/2009&lt;br /&gt;
 **************************&lt;br /&gt;
 &lt;br /&gt;
 Environment:&lt;br /&gt;
 - OS: Debian Etch 2.6.18-6-486&lt;br /&gt;
 - RT version: 3.8.2&lt;br /&gt;
 - MySQL version: 5.0.32-Debian_7etch8-log&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 I.  Download and untar migration files&lt;br /&gt;
 -----------------------------------&lt;br /&gt;
 tar -xvzf bugzilla-rt-convert.tar.gz&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 II.  Read README file&lt;br /&gt;
 -----------------------------------&lt;br /&gt;
 Please, pay attention to the README file inside bugzilla-rt-convert folder&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 III.  Replace initial data file&lt;br /&gt;
 -----------------------------------&lt;br /&gt;
 The original /opt/rt3/etc/initialdata file on RT3.8 has no  groups  information. We have  to  insert this&lt;br /&gt;
 information in our DB in order to avoid future issues loading tickets and queues.&lt;br /&gt;
 &lt;br /&gt;
 @Groups = (&lt;br /&gt;
     { Name        =&amp;amp;gt; &amp;#039;&amp;#039;,&lt;br /&gt;
       Type        =&amp;amp;gt; &amp;#039;Everyone&amp;#039;,&lt;br /&gt;
       Domain      =&amp;amp;gt; &amp;#039;SystemInternal&amp;#039;,&lt;br /&gt;
       Instance    =&amp;amp;gt; &amp;#039;&amp;#039;,&lt;br /&gt;
       Description =&amp;amp;gt; &amp;#039;Pseudogroup for internal use&amp;#039;,&lt;br /&gt;
       InsideTransaction =&amp;amp;gt; undef,&lt;br /&gt;
     },&lt;br /&gt;
     { Type        =&amp;amp;gt; &amp;#039;Privileged&amp;#039;,&lt;br /&gt;
       Domain      =&amp;amp;gt; &amp;#039;SystemInternal&amp;#039;,&lt;br /&gt;
       Instance    =&amp;amp;gt; &amp;#039;&amp;#039;,&lt;br /&gt;
       Name        =&amp;amp;gt; &amp;#039;&amp;#039;,&lt;br /&gt;
       Description =&amp;amp;gt; &amp;#039;Pseudogroup for internal use&amp;#039;,&lt;br /&gt;
       InsideTransaction =&amp;amp;gt; undef,&lt;br /&gt;
     },&lt;br /&gt;
     { Name        =&amp;amp;gt; &amp;#039;&amp;#039;,&lt;br /&gt;
       Type        =&amp;amp;gt; &amp;#039;Unprivileged&amp;#039;,&lt;br /&gt;
       Domain      =&amp;amp;gt; &amp;#039;SystemInternal&amp;#039;,&lt;br /&gt;
       Instance    =&amp;amp;gt; &amp;#039;&amp;#039;,&lt;br /&gt;
       Description =&amp;amp;gt; &amp;#039;Pseudogroup for internal use&amp;#039;,&lt;br /&gt;
       InsideTransaction =&amp;amp;gt; undef,&lt;br /&gt;
     },&lt;br /&gt;
     { Name        =&amp;amp;gt; &amp;#039;&amp;#039;,&lt;br /&gt;
       Type        =&amp;amp;gt; &amp;#039;Owner&amp;#039;,&lt;br /&gt;
       Domain      =&amp;amp;gt; &amp;#039;RT::System-Role&amp;#039;,&lt;br /&gt;
       Instance    =&amp;amp;gt; &amp;#039;&amp;#039;,&lt;br /&gt;
       Description =&amp;amp;gt; &amp;#039;SystemRolegroup for internal use&amp;#039;,&lt;br /&gt;
       InsideTransaction =&amp;amp;gt; undef,&lt;br /&gt;
     },&lt;br /&gt;
     { Name        =&amp;amp;gt; &amp;#039;&amp;#039;,&lt;br /&gt;
       Type        =&amp;amp;gt; &amp;#039;Requestor&amp;#039;,&lt;br /&gt;
       Domain      =&amp;amp;gt; &amp;#039;RT::System-Role&amp;#039;,&lt;br /&gt;
       Instance    =&amp;amp;gt; &amp;#039;&amp;#039;,&lt;br /&gt;
       Description =&amp;amp;gt; &amp;#039;SystemRolegroup for internal use&amp;#039;,&lt;br /&gt;
       InsideTransaction =&amp;amp;gt; undef,&lt;br /&gt;
     },&lt;br /&gt;
     { Name        =&amp;amp;gt; &amp;#039;&amp;#039;,       Type        =&amp;amp;gt; &amp;#039;Cc&amp;#039;,&lt;br /&gt;
       Domain      =&amp;amp;gt; &amp;#039;RT::System-Role&amp;#039;,&lt;br /&gt;
       Instance    =&amp;amp;gt; &amp;#039;&amp;#039;,&lt;br /&gt;
       Description =&amp;amp;gt; &amp;#039;SystemRolegroup for internal use&amp;#039;,&lt;br /&gt;
       InsideTransaction =&amp;amp;gt; undef,&lt;br /&gt;
     },&lt;br /&gt;
     { Name        =&amp;amp;gt; &amp;#039;&amp;#039;,&lt;br /&gt;
       Type        =&amp;amp;gt; &amp;#039;AdminCc&amp;#039;,&lt;br /&gt;
       Domain      =&amp;amp;gt; &amp;#039;RT::System-Role&amp;#039;,&lt;br /&gt;
       Instance    =&amp;amp;gt; &amp;#039;&amp;#039;,&lt;br /&gt;
       Description =&amp;amp;gt; &amp;#039;Pseudogroup for internal use&amp;#039;,&lt;br /&gt;
       InsideTransaction =&amp;amp;gt; undef,&lt;br /&gt;
     },&lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 IV.  print_prod.pl&lt;br /&gt;
 -----------------------------------&lt;br /&gt;
 This script loads tickets information from bugzilla in a file. There are issues in some of the loaded data, as&lt;br /&gt;
 lots of creation date fields contain the string ‘now()’ instead of a valid date. The best way to fix this is to&lt;br /&gt;
 replace the following lines in the script:&lt;br /&gt;
 &lt;br /&gt;
  ### sub print_prod&lt;br /&gt;
    my $created = &amp;#039;now()&amp;#039;;&lt;br /&gt;
    ...&lt;br /&gt;
    print &amp;quot;\t  Description\t=&amp;amp;gt; $desc,\n&amp;quot;;&lt;br /&gt;
        print &amp;quot;\t  Created\t=&amp;amp;gt; $created,\n&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 With these ones (NOTE: we are adding a random created date. Some people will need to modify this as they have to&lt;br /&gt;
 use the current date and time. Perl provides lots of time functions for this):&lt;br /&gt;
 &lt;br /&gt;
  ### sub print_prod&lt;br /&gt;
   my $created = &amp;#039;now()&amp;#039;;&lt;br /&gt;
  ...&lt;br /&gt;
   print &amp;quot;\t  Description\t=&amp;amp;gt; $desc,\n&amp;quot;;&lt;br /&gt;
  #&lt;br /&gt;
  ### ADDED TO AVOID now() DATES WHICH CAUSE LOADING ERRORS ON RT&lt;br /&gt;
   if ($created eq &amp;#039;now()&amp;#039;) {&lt;br /&gt;
   print &amp;quot;\t  Created\t=&amp;amp;gt; &amp;#039;2009-04-22 11:00:00&amp;#039;,\n&amp;quot;;&lt;br /&gt;
  }else {&lt;br /&gt;
   print &amp;quot;\t  Created\t=&amp;amp;gt; $created,\n&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 V.  print_bugs.pl&lt;br /&gt;
 -----------------------------------&lt;br /&gt;
 This  script  loads bugs  information  from bugzilla  in a  file. We are  in  the  same  situation again, as&lt;br /&gt;
 there a lots of corrupted data. The best way to fix this is to replace the following lines in the script:&lt;br /&gt;
 &lt;br /&gt;
  ### sub print_bugs&lt;br /&gt;
  my $created = &amp;#039;now()&amp;#039;;&lt;br /&gt;
  ...&lt;br /&gt;
  print &amp;quot;\t  Type\t=&amp;amp;gt; &amp;#039;ticket&amp;#039;,\n&amp;quot;;&lt;br /&gt;
  print &amp;quot;\t  Created\t=&amp;amp;gt; $created,\n&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 With these ones (NOTE: we are adding a random created date. Some people will need to modify this as they have to&lt;br /&gt;
 use the current date and time. Perl provides lots of time functions for this):&lt;br /&gt;
 &lt;br /&gt;
  ### sub print_bugs&lt;br /&gt;
  my $created = &amp;#039;now()&amp;#039;;&lt;br /&gt;
  ...&lt;br /&gt;
  print &amp;quot;\t  Type\t=&amp;amp;gt; &amp;#039;ticket&amp;#039;,\n&amp;quot;;&lt;br /&gt;
  #&lt;br /&gt;
  ### ADDED TO AVOID now() DATES WHICH CAUSE LOADING ERRORS ON RT&lt;br /&gt;
   if ($created eq &amp;#039;now()&amp;#039;) {&lt;br /&gt;
   print &amp;quot;\t  Created\t=&amp;amp;gt; &amp;#039;2009-04-22 11:00:00&amp;#039;,\n&amp;quot;;&lt;br /&gt;
  }else {&lt;br /&gt;
   print &amp;quot;\t  Created\t=&amp;amp;gt; $created,\n&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 VI.  migrate.sh&lt;br /&gt;
 -----------------------------------&lt;br /&gt;
 Modify create_user function adding a line for the DB  initialization. This initialization  is needed as ‘Nobody’&lt;br /&gt;
 and ‘System’ users are not automatically added by the original script.&lt;br /&gt;
 &lt;br /&gt;
  create_user(){&lt;br /&gt;
   passwd=$1&lt;br /&gt;
         perl $setup --action drop --dba root --dba-password $passwd&lt;br /&gt;
   # We have to initialize the DB, as we need to insert Nobody and&lt;br /&gt;
   # System users, which are required and the original script doesn&amp;#039;t&lt;br /&gt;
   # carry this out&lt;br /&gt;
         perl $setup --action init --dba root --dba-password $passwd&lt;br /&gt;
 &lt;br /&gt;
         # don&amp;#039;t insert scrip here&lt;br /&gt;
         perl bugimport --action init --dba root --dba-password $passwd&lt;br /&gt;
        perl print_users_groups.pl $passwd &amp;amp;gt; data.pl&lt;br /&gt;
         perl $setup --action insert --datafile ./data.pl --dba root --dba-password $passwd&lt;br /&gt;
         perl insert_ids_map.pl $passwd&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 VII.  Stop emailing&lt;br /&gt;
 -----------------------------------&lt;br /&gt;
 In order to avoid thousands of emails to be sent automatically, every time a new ticket is created, we have to&lt;br /&gt;
 stop our mail client&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 VIII.  Run migration script&lt;br /&gt;
 -----------------------------------&lt;br /&gt;
 The best way to run the script is redirecting the standard error (which contains also Perl warning&lt;br /&gt;
 and informational messages) to a file&lt;br /&gt;
 sh migrate.sh 2&amp;amp;gt; output&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 IX.  Delete queued emails&lt;br /&gt;
 -----------------------------------&lt;br /&gt;
 Before restarting the email client we have to delete all the queued emails:&lt;br /&gt;
  rm -f /var/spool/mqueue/* /var/spool/mqueue-client/*&lt;br /&gt;
 &lt;br /&gt;
 NOTE: If there are too much pending emails, rm won’t work and you will need to use the following command instead:&lt;br /&gt;
 &lt;br /&gt;
  cd /var/spool/mqueue&lt;br /&gt;
  find . -name &amp;#039;*&amp;#039; -print0 | xargs -0 rm&lt;br /&gt;
  cd /var/spool/mqueue-client&lt;br /&gt;
  find . -name &amp;#039;*&amp;#039; -print0 | xargs -0 rm&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 X.  Restart email client&lt;br /&gt;
 -----------------------------------&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>