RTFM articles content migration

Hello RT admins

In the README file is clearly specified the procedure to make an upgrade of
RTFM (2.0.4 to 2.1.40), I ran the script rt-setup-database without any
trouble. The custom fields for the content were created too and assigned to
the article classes, but the articles content is still empty. Looking at the
database, the “old” articles content is in a table called
fm_articlecfvalues.

Is there a procedure or script to copy the content to its final location (I
guess it goes to the table ObjectCustomfieldvalues)

Thank you very much Jesse for your last answer.

-luis

Luis Moreno wrote:

Hello RT admins

In the README file is clearly specified the procedure to make an upgrade of
RTFM (2.0.4 to 2.1.40), I ran the script rt-setup-database without any
trouble. The custom fields for the content were created too and assigned to
the article classes, but the articles content is still empty. Looking at the
database, the “old” articles content is in a table called
fm_articlecfvalues.

Are you certain you assigned the custom field to article classes? I’ve
still got the old article content in FM_ArticleCFValues, too, but the
data has been copied into ObjectCustomFieldValues and FM_ArticleCFValues
doesn’t update when I modify the content text while
ObjectCustomFieldValues does.

I ask because I actually just ran into this today and that was the
issue. I ran the migrate-2.0-to-2.1 script, did the DB schema etc.
updates, installed 2.2.0RC4 and restarted the webserver. Browsing to
RTFM shows the articles, but doesn’t display the actual contents of the
articles, though it does show up in the history. Trying to create a new
article shows a page with no text entry field to actually enter the
article body. There are a couple or three posts on the list about this,
but I didn’t see any actual answers other than “re-enter all the
articles manually”, which wasn’t quite the answer I was hoping for.

Anyway, after the usual cursing, swearing and futzing around, I did
finally get the content to display. The problem was that the Body, the
first custom field, exists, but isn’t assigned to any RTFM article classes.

In the web interface, I went to RTFM / Configuration / Custom Fields,
then selected the body CF. At this point I was at the “Editing
CustomField Body” page. I clicked on the “Applies To” link, and nothing
was selected.

My first go 'round I discounted this screen because the objects I could
select were “Support”, “Accounts”, “Abuse”, etc. – basically my RT
Queues – and I’m thinking that, no, this custom field shouldn’t apply
to my queues and so left it alone (i.e. with the CF applying to nothing).

Next time I visited the screen, in desperation I clicked the “Check All”
button and Submitted, figuring I could always just undo it if I screwed
it up. However, when I left the RTFM config and viewed my articles, the
content now showed up. At this point, after a bit of furrowed brow
thinking, I realized that “Support” and so on are my RT Queues, but
they’re also the names of my RTFM article classes, and since the Body CF
is now associated with all articles (since I applied the CF to all
article classes), the contents of the Body CF is now displayed and
available when I view the article. A blank text entry field also shows
up when I go to create a new article.

'Course I’m no RT expert and said explanation of why it now works may
actually be worth rather less than an equivalent volume of raw sewage,
but the content of my articles now display anyway so I’m happy. That’s
how I fixed it–YMMV. :wink:

Note to Jesse et al: besides the obvious README documentation updates,
I’m pretty certain that the migrate-2.0-to-2.1 should do the SQL
equivalent of the above automatically. Other custom fields may only
belong to certain article classes, but in the old RTFM if I’m not
mistaken (again, not an expert) every article has a body, and so the
Body CF should be applied to all classes. Basically, the CF to article
class associations should be migrated by the script just as whatever
else the script migrates is migrated.

Having the Body CF present but not applied to anything and thence not
showing up at all is rather confusing, unfairly making ops doubt their
ability to comprehend simple English and/or follow a simple 5-step set
of instructions. :wink:

Oh, and an unrelated note: the docs also assume you’re upgrading RTFM in
place. I’m actually doing a fresh RT and RTFM install on a new, beefier
server, with just the DB copied over from the old server.
The migrate-2.0-to-2.1 script, however, relies on files only present in
the old version of RTFM. The script, therefore, immediately quit,
complaining about a missing module. The usual cursing, swearing and a
few find commands later and I located the missing Perl module on the old
server. I then recognized the assumption made by the devs, tar’d up and
dropped the old RTFM files into the appropriate place on the new server,
and then the script decided to run.

Well, only about halfway, actually–it bombed out complaining about an
undefined function ‘new’ in RT::FM::TransactionCollection blah blah.
This one was pretty easy: adding ‘use RT::FM::TransactionCollection;’
at the top of the script cured that, once I verified
RT::FM::TransactionCollection had actually been copied over in my
tarball of the old server’s RTFM.

All in all, it was a bit of an adventure, but the new server’s working
and holding up under light testing. Weekend, here I come… :slight_smile:

Cheers,

Craig.

Craig. Thanks for your answer.

I re run the migrate script (migrate-2.0-to-2.1) just to verify, and I
realice it is failing just before the importing articles (line 109), with
this error:

perl -I/usr/lib/rt/ ./sbin/migrate-2.0-to-2.1

[Mon Nov 13 13:01:30 2006] [crit]: RT::FM::Article::CurrentUserHasRight
Unimplemented in RT::FM::ArticleCollection.
(/usr/lib/rt//RT/FM/ArticleCollection_Overlay.pm line 38)
(/usr/lib/rt//RT.pm:295

Any idea?

-luis

Luis Moreno wrote:

Craig. Thanks for your answer.

I re run the migrate script (migrate-2.0-to-2.1) just to verify, and I
realice it is failing just before the importing articles (line 109), with
this error:

perl -I/usr/lib/rt/ ./sbin/migrate-2.0-to-2.1

[Mon Nov 13 13:01:30 2006] [crit]: RT::FM::Article::CurrentUserHasRight
Unimplemented in RT::FM::ArticleCollection.
(/usr/lib/rt//RT/FM/ArticleCollection_Overlay.pm line 38)
(/usr/lib/rt//RT.pm:295

Any idea?

I’ve got all of 1 RT / RTFM install + upgrade under my belt. I don’t
exactly have a whole lot of experience to draw upon, so if you’re not
seeing one of the exact issues I found and dealt with, it’s pretty
unlikely that I can help.

Given that, and relying more on general Perl knowledge than on actual
RTFM experience, one of the issues I ran into was that the
migrate-2.0-to-2.1 script relies on code from your previous RTFM
installation. If you’ve already installed (i.e. run ‘make install’)
RTFM-2.2.0RC4, then that old code is likely no longer present, and so
just re-running the script won’t work. I suggest this because it will
then fail when it tries to execute the missing code, and the resulting
error will look as it looks above. In that case, you’ll need to restore
the old RTFM code from backup or, possibly, the old RTFM version’s
installation tarball before re-running the script.

At any rate, to be clear I don’t really know and this, in the end, is
just a guess. YMMV.

Good luck…

Craig.

Hi Craig, and rt-users

I follow your suggestion and it works, the migration script
(migrate-2.0-to-2.1) needs the previous version of RTFM installed. For
future reference, here is a summary of the migration steps.

These steps have been tested in a linux 2.6.11-1.1369 box (Fedora Core 4
dist) with Apache/2.0.54, RT 3.4.5, and upgrading RTFM-2.0.4 to RTFM-2.1.40.
Database: PostgreSQL (8.0.7)

. Assuming RTFM 2.0.4 is installed here:/opt/rt3

. In the directory of the RTFM-2.1.40 sources, execute the following
commands:

perl Makefile.PL

It will ask you path for RT.pm (in our case is /usr/lib/rt/)

. Run the migration script, and redirect the output to a file (just to check
for errors later)

perl -I/opt/rt3/lib/ -I/usr/lib/rt/ ./sbin/migrate-2.0-to-2.1 |tee

migrate.out 2>&1

. Install the new RTFM

make install

. Upgrade the schema

for j in ls etc/upgrade/; do for i in schema acl insert; do

/usr/sbin/rt-setup-database -dba <your_rtdbuser> --dba-password
<your_rtdbuser_password> --action $i --datadir etc/upgrade/$j; done; done

. Restart the httpd server

/etc/init.d/httpd restart

. Assign the customfields to the classes>
Login the RT web interface->
Config->RTFM->Custom Fields->->Apply-> Select the classes
the customfield will apply to (the common is to select all) and then click
Send

Thanks Craig and Jesse for your help.

-luis