4.0.0: Upgrade database independently of installed code base?

I am attempting to upgrade my RT instance from 3.8.7 to 4.0.0.

My elected approach is to set up the 4.0.0 instance alongside
the original 3.8.7 instance (i.e. two separate databases), and
verify that the 4.0.0 instance works properly before retiring
the 3.8.7 one.

I have successfully set up the 4.0.0 code base as a “new
installation” via “make install,” set up a separate MySQL
database for 4.0.0 and copied the 3.8.7 schema into it.

I understand that I need to apply a series of sequential
upgrades to the copied database in order to make it a 4.0.0
schema and complete the 4.0.0 setup, but I can’t see how this
is done.

The README document states in step 6b that “make upgrade” will
provide the command necessary to upgrade the database. This
implies a need to overwrite an existing code base–which, in my
case, is not happening.

Given my use case–one which I hadn’t imagined would be all
that uncommon–what is the correct approach to getting the
database updated to the correct schema?

(I apologise if this is explicitly covered somewhere in the
docs. Things get harder to absorb as you read them over and
over again…)

I am attempting to upgrade my RT instance from 3.8.7 to 4.0.0.

My elected approach is to set up the 4.0.0 instance alongside
the original 3.8.7 instance (i.e. two separate databases), and
verify that the 4.0.0 instance works properly before retiring
the 3.8.7 one.

I have successfully set up the 4.0.0 code base as a “new
installation” via “make install,” set up a separate MySQL
database for 4.0.0 and copied the 3.8.7 schema into it.

I understand that I need to apply a series of sequential
upgrades to the copied database in order to make it a 4.0.0
schema and complete the 4.0.0 setup, but I can’t see how this
is done.

The README document states in step 6b that “make upgrade” will
provide the command necessary to upgrade the database. This
implies a need to overwrite an existing code base–which, in my
case, is not happening.

Given my use case–one which I hadn’t imagined would be all
that uncommon–what is the correct approach to getting the
database updated to the correct schema?

make upgrade will actually cleanly install everything into /opt/rt4
for you and print out the line. It is something like this:

/opt/rt4/sbin/rt-setup-database --action upgrade --dba YOURDBAUSERNAME

that last part is obviously site-specific.

Please also review docs/UPGRADING-3.8 and docs/UPGRADING-4.0 and
complete any relevant database upgrade steps listed there.

-kevin

I understand that I need to apply a series of sequential
upgrades to the copied database in order to make it a 4.0.0
schema and complete the 4.0.0 setup, but I can’t see how
this is done.

make upgrade will actually cleanly install everything into
/opt/rt4 for you and print out the line. It is something
like this:

/opt/rt4/sbin/rt-setup-database --action upgrade --dba YOURDBAUSERNAME

that last part is obviously site-specific.

Please also review docs/UPGRADING-3.8 and docs/UPGRADING-4.0
and complete any relevant database upgrade steps listed
there.

Thanks Kevin–this mostly worked. Some further observations:

  1. The rt-setup-database script relies on the existence of an
    etc/upgrade directory, which in my case wasn’t copied as
    part of the installation (probably due to my use of “make
    install” over “make upgrade”). I got around this by
    adding:

     --datadir $TARBALL/etc/upgrade
    

    to the command line of rt-setup-database (substituting the
    actual location of the tarball extraction for $TARBALL).

  2. I got some Perl errors and warnings while performing the
    database upgrade, but these are probably best left for
    a new discussion thread.

  1. The rt-setup-database script relies on the existence of an
    etc/upgrade directory, which in my case wasn’t copied as
    part of the installation (probably due to my use of “make
    install” over “make upgrade”). I got around this by
    adding:

    --datadir $TARBALL/etc/upgrade
    

    to the command line of rt-setup-database (substituting the
    actual location of the tarball extraction for $TARBALL).

It actually just expects to run from $TARBALL since it is the step you
run after running make upgrade

-kevin