Moving from a gentoo linux 2.4 box, RT 3.6.4, mysql 4.0.8 to an ubuntu 12.04 server, RT 4.0.10 and mysql 5.5
Export 3.6.4 Database
On RT 3.6.4 machine as root (obviously must know the root mysql password):
mysqldump -p --opt rt3 > rt3.sqlCopy this file to the new machine. All further steps are on new machine.
Prepare SQL for Import
You have to edit rt3.sql with vim or sed, and remove all references to "Type=Innodb" (this is default in mysql now), and search for "timestamp(" and remove the bracketed section.. (eg. "timestamp(14)" is now just "timestamp").
Create Database for Import
mysql -pNOTE: above replace rt_user and rt_pass by the user/password you wish to use for RT. Also, it may seem counter intuitive to name database rt4, since we are importing rt3 - just remember the end target is 4.0.10.
create database rt4 character set latin1;
grant all on rt4.* to rt_user identified by 'rt_pass';
Import 3.6.4 Database
mysql -p --default-character-set=binary rt4 < rt3.sqlDownload/Configure/Install RT 4.0.10
Download RT 4.0.10 source, extract to temp dir, run .configure with needed parameters (see your 3.6.4 install), and basically follow README up to and including "make install". This should install in /opt/rt4. Be sure to configure RT_SiteConfig.pm and configure apache2 as needed (beyond scope of this post).
From the temp dir used above execute the following:
make upgrade-databaseIf it fails at 3.7.81, do this:
(From 3.6.4 to 3.7.87)
mysql -p rt4
CREATE INDEX CachedGroupMembers3 on CachedGroupMembers (MemberId, ImmediateParentId);
(From 3.7.81 to 3.7.87)
perl etc/upgrade/upgrade-mysql-schema.pl rt4 rt_user rt_pass > queries.sqlIf it fails at 3.8.2, do this:
(again replacing rt_user and rt_pass with user/password you wish to use for RT)
mysql -p rt4 < queries.sql
(this takes about 3 times as long as the initial import!)
alter database rt4 default character set utf8;
(From 3.7.87 to 4.0.9)
mysql -p rt4
drop index groupmembers1 on GroupMembers;
create unique index groupmembers1 on GroupMembers (GroupId,MemberId);
(From 3.8.3 to 4.0.9)
perl -I /opt/rt4/local/lib -I /opt/rt4/lib etc/upgrade/shrink_cgm_table.plNow test, test, test... :)
(takes even longer than above query)
perl -I /opt/rt4/local/lib -I /opt/rt4/lib etc/upgrade/shrink_transactions_table.pl
perl etc/upgrade/vulnerable-passwords --fix