Tool to migrate from RT3 on postgres to RT3 on mysql

Is now available at

It’s a small tool I built for a client who wanted to move from Pg to
Mysql with their existing RT3 database.

You should start with a full RT database on postgres and an RT3 database
on mysql that contains only the schema and not the database content.


Request Tracker — Best Practical Solutions – Trouble Ticketing. Free.

There were questions on the list about doing it the other way around:
from MySQL to Postgres.

I have managed to use this tool to migrate RT 3.0.10 the other way
around – from mysql to postgres.

The procedure was:

  1. *rt-setup-database --action schema …
  2. Download
  3. Modify the script to reflect database locations, e.g.:
    * my $new_handle =
    or die $DBI::errstr;
    * my $old_handle =
    ‘,’’) or die $DBI::errstr;
  4. Switch to PostgreSQL DBA account: su postgres
  5. Run the script and make sure it worked OK. At this point you can
    login and see tickets, but not create tickets
  6. Reset the sequences in the database:
    * su postgres
    psql rtdb

    * For every SEQUENCE in /etc/request-tracker3/schema.Pg (I am
    using Debian; the location on your system may be in
    /opt/rt3. or somewhere else) do:
    o SELECT MAX(id) + 1 FROM ;
    o note the result
    _is_seq RESTART WITH ;


    1. Usual disclaimer: The above worked for me once; it is not
      guaranteed to work for you and you are strongly advised not to do
      it on the production database without prior testing.
    _is_seq RESTART WITH (SELECT MAX(id) +
    1 FROM
    ) should have worked but it didn’t and I had to
    split it in two. Postgres/SQL gurus might be able to explain why.
    Perl gurus may want to modify Jesse’s script to do all this
  7. In my totally unscientific Apples-to-Oranges comparison moving
    database to Postgres actually made things faster, contrary to what
    many people experience.
  8. Jesse Vincent wrote on 04/11/2004 4:12 PM:

Thanks, Alex.
Published: Request Tracker Wiki

		Best regards. Ruslan.

Alex wrote: