Theresa Arzadon-Labajo

Migrating RT 3.6.4 to RT 4.0

Posted by Administrator (admin) on Oct 12 2011
Tech Stuff >> Unix-Linux
Instead of upgrading our existing RT installation,  I wanted to create a whole new instance on a new server, since our RT3 installation was on an older architecture.

1.  Create a new machine.  I created ours in a KVM environment.
     
2.  On the new machine
      a.  Download the RT tar ball from:
http://blog.bestpractical.com/2011/04/rt-400-released.html
The latest release can be downloaded from:  http://www.bestpractical.com/rt/download_file.html
      b.  Install the required packages in the README file.
            1)  This is what I installed: httpd, gcc, mysql, mysql-server, perl-CPAN, mod_perl, make, perl-XML-Parser, perl-YAML
            2) Configure CPAN if not done already:
# perl -MCPAN -e shell
      c.  Follow the General  Installation instructions in the README file.
# tar xzvf rt-4.0.0.tar.gz
# ./configure
# make testdeps
# make fixdeps
# make install   (We will follow 6a in README because were are creating a fresh install, but then will also be doing parts of 6b for upgrading the database)


     d.  If you are using iptables, make sure things look okay.  If mysqld is not running, turn it on.  If you plan on using SSL, make sure you have the certificates.
     e.  From your RT3 installation, copy your customizations from RT_SiteConfig.pm into RT4's RT_SiteConfig.pm.  These are the things that I added:
Set( $rtname, 'your.domain.name');
Set($Organization , "your.domain.name");
Set($RTAddressRegexp , '^your-rt-user\@your.domain.name$');
Set($CorrespondAddress , 'your-rt-user@your.domain.name');
Set($CommentAddress , 'rt-comment@your.domain.name');
Set($WebPort , 443);# + ($< * 7274) % 32766 + ($< && 1024));
Set($WebBaseURL , "https://rtservername.your.domain.name:$WebPort");
Set($DatabaseUser , 'your-rt-user');
Set($DatabasePassword , 'your-rt-databasepw');
Set($DatabaseName , 'your-rt4-database');
#Set($DatabaseName , 'your-rt3-database');

     f.  On the new machine, Initialize new database so you have a clean RT4 install of the database
#  make initialize-database

     g.  Dump the RT3 database on the old server. Copy the database file to the new server
#  mysqldump --default-character-set=binary rt3-database -p > rt3-database.sql
#  scp rt3-database.sql user@rt4server:

     h.  Import the RT3 database into your new server.  Make sure the database name is different than the one you used to initialize the RT4 database.
# mysql rt3-database < /path/rt3-database.sql

     i.  From the UPGRADING.sql page, generate the SQL queries and apply it to your database :
# perl /path-to-rt-install/rt-4.0.0/etc/upgrade/upgrade-mysql-schema.pl rt3-database dbuser dbpassword  > /path/queries.sql
# mysql rt3-database < /path/queries.sql

     j.  From 6b in README,  I looked in the make file and just ran the command pertaining to upgrading the database.  I don't need to upgrade the files because I created a new RT4 installation.
# sbin/rt-setup-database --dba root --prompt-for-dba-password --action upgrade

     k.  Now, the database will work with the RT4 installation.   You have an option to just change the database name in RT_SiteConfig.pm to the database you just imported, or you can dump the RT3 upgraded database and import it into the RT4 database that was newly created.  I chose to do the latter.
#  mysqldump --default-character-set=binary rt4-database -p > /path/rt4database-orig.sql
#  mysqldump --default-character-set=binary rt3-database -p > /path/rt3database-upgradetort4.sql
#  mysql rt4-database < /path/rt3database-upgradetort4.sql

     l.  Consult docs/web_deployment.pod for the apache configuration.  I copied my conf files from the old server and compared it with the documentation to make sure everything was correct.

     m.  Restart mysqld and httpd.  Access your site from a browser to verify it looks ok.  I had to turn off SELinux to get it to work, but I'm sure it will be a quick fix.

     n.  Update your aliases file so that it points to your new rt-server.  If you are using a remote mail server, make sure to copy over the new rt-mailgate





           

Last changed: Oct 12 2011 at 4:26 PM

Back

Comments

For RT 3.8.x? By Guest on Oct 24 2011 at 6:13 AM
Hi,

Is it the same process for RT 3.8.x also??
Am trying to upgrade our already in use RT.
Do please let us know.
Re: Migrating from 3.8.X By Administrator on Nov 04 2011 at 3:52 PM
This should work with upgrading from 3.8.X. When you run the rt-setup-database command, it will ask you what version you are upgrading from. Just input your version (3.8.X) and hit enter. The script will tell you all the upgrades that will be applied.

You can also reference the instructions below to see if there is anything else that needs to be done:
https://github.com/bestpractical/rt/blob/stable/docs/UPGRADING-3.8
This works pretty well; thanks for the help! By Guest on Jun 20 2012 at 3:16 PM
This works pretty well; thanks for the help!

I'm using Ubuntu 12.04 and had some minor problems with the RT_config.pm. The main one being that the database name should be the old database name when you run the database upgrade command. (You've created a new rt4 instance so that's the name that naturally finds its way into the config file.)

There were some minor troubles with the logic that selects the type database being used; I simply "Set(DatabaseType, 'mysql');". And the logic for SQLite also never actually sets a dbc_dbname so "Set($DatabaseName, 'rt4');".

That seems to have done it for the DB. Now there are some Apache2 "fixes" to sort out.
Problems Upgrading By Guest on Oct 22 2014 at 8:29 AM
First of all i want to say thank you for this upgrade tutorial ;)

I followed your tutorial step by step to upgrade our rt from 3.8.7 to the last version (4.2.8) and every thing went very well till the step where we have to upgrade the DB.

Proceed [y/N]:Y
Processing 3.8.8
Now inserting data.
Processing 3.8.9
Now inserting data.
Processing 3.9.1
Now inserting data.
Processing 3.9.2
Now inserting data.
[23291] [Wed Oct 22 13:25:44 2014] [warning]: DBD::mysql::st execute failed: Unknown column 'main.DelegatedBy' in 'where clause' at /usr/local/share/perl/5.18.2/DBIx/SearchBuilder/Handle.pm line 586, line 8. (/usr/local/share/perl/5.18.2/DBIx/SearchBuilder/Handle.pm:586)
[23291] [Wed Oct 22 13:25:44 2014] [warning]: RT::Handle=HASH(0x6726eb8) couldn't execute the query 'SELECT main.* FROM ACL main WHERE (main.DelegatedBy > '0') AND (main.DelegatedFrom > '0') ' at /usr/local/share/perl/5.18.2/DBIx/SearchBuilder/Handle.pm line 599, line 8.
DBIx::SearchBuilder::Handle::SimpleQuery('RT::Handle=HASH(0x6726eb8)', 'SELECT main.* FROM ACL main WHERE (main.DelegatedBy > \'0\')...') called at /usr/local/share/perl/5.18.2/DBIx/SearchBuilder.pm line 239
DBIx::SearchBuilder::_DoSearch('RT::ACL=HASH(0x673b318)') called at /tmp/rt-4.2.8/sbin/../lib/RT/SearchBuilder.pm line 985
RT::SearchBuilder::_DoSearch('RT::ACL=HASH(0x673b318)') called at /usr/local/share/perl/5.18.2/DBIx/SearchBuilder.pm line 507
DBIx::SearchBuilder::Next('RT::ACL=HASH(0x673b318)') called at /tmp/rt-4.2.8/sbin/../lib/RT/ACL.pm line 194
RT::ACL::Next('RT::ACL=HASH(0x673b318)') called at ./etc/upgrade/3.9.2/content line 21
RT::Handle::__ANON__() called at /tmp/rt-4.2.8/sbin/../lib/RT/Handle.pm line 821
eval {...} called at /tmp/rt-4.2.8/sbin/../lib/RT/Handle.pm line 821
RT::Handle::InsertData('RT::Handle=HASH(0x6726eb8)', './etc/upgrade/3.9.2/content', undef) called at sbin/rt-setup-database line 381
main::__ANON__() called at ./etc/upgrade/3.9.5/backcompat line 11
main::__ANON__('CODE(0x67206c8)') called at sbin/rt-setup-database line 391
main::__ANON__() called at ./etc/upgrade/4.1.13/backcompat line 34
main::__ANON__('CODE(0x6715f40)') called at sbin/rt-setup-database line 391
main::__ANON__() called at sbin/rt-setup-database line 394
main::action_insert('prompt-for-dba-password', 1, 'package', 'RT', 'dba', 'root', 'datafile', undef, 'action', ...) called at sbin/rt-setup-database line 562
main::action_upgrade('action', 'upgrade', 'dba', 'root', 'package', 'RT', 'prompt-for-dba-password', 1) called at sbin/rt-setup-database line 209 (/usr/share/perl/5.18/Carp.pm:103)
Processing 3.9.3
Now populating database schema.
[23291] [Wed Oct 22 13:25:44 2014] [critical]: DBD::mysql::st execute failed: Can't DROP 'DelegatedBy'; check that column/key exists at /tmp/rt-4.2.8/sbin/../lib/RT/Handle.pm line 528. (/tmp/rt-4.2.8/sbin/../lib/RT.pm:388)
DBD::mysql::st execute failed: Can't DROP 'DelegatedBy'; check that column/key exists at /tmp/rt-4.2.8/sbin/../lib/RT/Handle.pm line 528.

Did you have this error or know what can lead to this ??

Thank you in advance ;)

Add Comment