Migration/Upgrade of RT to a different VM with a different OS and on a different RT version

Hi everyone,

The company I am working for uses RT 4.2.3 since 2014 on CentOS. We are looking to upgrade RT on ad different operating system (Possibly Ubuntu 20.04/22.04) without losing any tickets.

What would be the best way to approach this migration, please?

Should we migrate RT 4.2.3 to the new OS and then upgrade it to RT 5.x, or is it possible to directly export the database and the configuration of RT 4.2.3 to the new RT 5.x?

Thanks

Dan

You can get a dump of the db:

https://docs.bestpractical.com/rt/5.0.2/system_administration/database.html

Then restore the db on the new machine, where you have RT5 installed on. Then you can run the make upgrade command and upgrade the db

1 Like

Hi, I finally got there. This is what I did:

Run this command on the old RT server

mysqldump -u root -p --default-character-set=utf8mb4 rt4 --ignore-table rt4.sessions --single-transaction | gzip > rt-date +%Y%m%d.sql.gz

Then move the archive to the new RT server and run this command in the folder with the backup:

gunzip -c rt-20220429.sql.gz | mysql -u root -p rt5

Which command should I run to update the database? make upgrade doesn’t seem to do anything. Should I run it in a specific folder?

Thanks

Hi,

From my personal notes :

Import process

  1. Install PV
    a. Sudo apt-get install pv
  2. To import the dump to the new DB run the command below :
    pv rt4.sql | mysql -u root -p rt5
  3. Enter the DB password

NOTE : The pv is used to monitor the progress of the process

This is what worked for me, from 4.4.4 to 5.0.0.

1 Like

Hi, thanks for that. Have you run any commands after

pv rt4.sql | mysql -u root -p rt5

to update the schema from 4.4.4 to 5.0.0? Or is it done with that command as well?

I am trying to import an RT 4.2.3 database to a 5.0.1 installation but after I use the command you provided I am able to log in but as soon as I open any ticket the server crashes.

After a clean installation of RT5 I dropped all tables of the rt5 database. I did not delete the database. After that, I imported the rt 4.4.4 database and then run the command “make upgrade-database”. Follow the script instructions and you should be good to go. As I understand, you imported over the existing database.

1 Like

Hey,

To upgrade the database you should be able to do something like:

rt-setup-database --action upgrade --force --skip-create --upgrade-from 4.2.3 --upgrade-to 5.0.3

This one of those things where’d be nice if RT could work out the version you’re upgrading from. :slight_smile:

Make sure you review the UPGRADING-4.4 and UPGRADING-5.0 docs!

1 Like

Just to be sure I am doing it correctly, in which folder are you running the command “make upgrade-database”, please?

No, I don’t need to import it over an existing database it can also be on a clean database.
We have currently a VM with RT 4.2.3 running on CentOS 6 and we are trying to migrate the RT to Ubuntu 22.04 with RT 5.0.x, so first I installed RT and now I am trying to move the database across.

You run the “make upgrade-database” in the directory where you ran the “make install” command to install RT5. Essentially the folder that was extracted from the downloaded archive (i.e. rt-5.0.2.tar.gz). If you import your database dump on a new database, the database name will be rt4, take that into consideration as it is required to be specified in the configuration files of your RT installation.

Also, please make sure you read the manual carefully on section 6b.

https://docs.bestpractical.com/rt/5.0.3/README.html

1 Like

Thank you so much I finally managed to upgrade it.