Upgrade error from 3.8.1 with RTFM 2.4 Can't locate object method "new" via package "RT::FM::Article"

I am attempting to upgrade an old system with RT 3.8.1, RTFM 2.4 and MySQL 4.1.22. I have working clean install of 5.0.5 on latest Debian/MariaDB and now I am running ‘upgrade-database’ but its failing at the 4.0.19 step.

[71413] [Fri Dec 8 02:30:47 2023] [warning]: Update Custom Field LookupType for CF.1 The new value has been set. (/home/rtadmin/rt-5.0.5/etc/upgrade/4.0.19/content:12)
Couldn’t finish ‘upgrade’ step.

ERROR: One of initial functions failed: Can’t locate object method “new” via package “RT::FM::Article” (perhaps you forgot to load “RT::FM::Article”?) at /home/rtadmin/rt-5.0.5/sbin/…/lib/RT/ObjectCustomFieldValue.pm line 308.

make: *** [Makefile:396: upgrade-database] Error 255

I tried running ‘upgrade-articles’, both before and after running ‘upgrade-database’, and at different versions, but it fails with the same error. I dropped and reimported the rt3 data between attempts just to be sure. Is there a specific sequence to upgrading that I should be following? Should I stop ‘upgrade-database’ at a particular version, run ‘upgrade-articles’, then continue ‘upgrade-database’ up to 5.0.5?

So looking at the db I can see RT::FM::Articles is a value under ObjectCustomFieldValues.ObjectType, so excluded that table (as well as all FM_* tables) from my rt3 mysqldump and I was able to get past 4.0.19 upgrade. Recreating my articles by hand would be a pain but isn’t the end of the world.

Next hurdle now is 4.3.10:

[76261] [Fri Dec 8 09:06:12 2023] [critical]: DBD::mysql::st execute failed: Table ‘Assets’ already exists at /home/rtadmin/rt-5.0.5/sbin/…/lib/RT/Handle.pm line 570. (/home/rtadmin/rt-5.0.5/sbin/…/lib/RT.pm:409)

DBD::mysql::st execute failed: Table ‘Assets’ already exists at /home/rtadmin/rt-5.0.5/sbin/…/lib/RT/Handle.pm line 570.

make: *** [Makefile:396: upgrade-database] Error 11

Hey,

Have you been checking various UPGRADING-x.x files as you move forward, there’s good content in them. Information on how to handle the RTFM extension integration to core is in UPGRADING-4.0, including how to migrate your existing articles.

With the issue with the Assets table, did you run the 4.3.10 upgrade twice? Are you able to check what tables are present in your database? etc/upgrade/4.3.10/schema.mysql is the database patch it is trying to use.

Cheers,
Andrew

I have no clue if this is the correct method or not, but this finally worked for me.

After running initialize-database on a clean install, i logged in to mysql and dropped the rt5 db it created, then I created rt5 myself. I then imported my sql dump from rt3.

Once that imported I changed the values in ObjectCustomFieldValues.ObjectType from RT::FM::Article to RT::Article. Also, I dropped FM_Classes.Hotlist due to another error along the way.

I was then able to upgrade-database from 3.8.1 to 5.0.5 in one shot, and then upgrade-articles and upgrade-mysql-schema queries.