RT Importer Error

Hello,

I’ve been fighting an issue with trying to import a serialized database to a new server. I’ve tried on a barebones RT install, with no new tickets, etc. and I have tried it with a test server we have fleshed out with some tickets/attachments etc. I’ve also tried using the clone option in serializer, parsing it down to only certain queues I need, etc. No dice. I’m using version 4.4.2. Here is the error:

[root@RT-server-0101 sbin]# ./rt-importer /home/nick.s/RT-2018-07-10/
Logging warnings and errors to /home/nick.s/RT-2018-07-10/importer.log
Resuming partial import…
[31026] [Fri Jul 13 17:24:50 2018] [warning]:
Can’t use an undefined value as a HASH reference at /opt/rt4/sbin/…/lib/RT/Record.pm line 2534. (/opt/rt4/sbin/…/lib/RT/Migrate/Importer/File.pm:97)

Importer state has been written to the file:
/home/nick.s/RT-2018-07-10/partial-import

It may be possible to resume the import by re-running rt-importer.

And here is the dump from importer --list:

[root@RT-0101 sbin]# ./rt-importer --list /home/nick.s/RT-2018-07-10/
Logging warnings and errors to /home/nick.s/RT-2018-07-10/importer.log
=========== Dump of RT ===========

Total object counts:
119827 RT::Transaction
108103 RT::ObjectCustomFieldValue
33027 RT::Group
27237 RT::Attachment
8227 RT::Ticket
6891 RT::GroupMember
641 RT::CustomFieldValue
528 RT::Attribute
317 RT::ObjectCustomField
110 RT::CustomField
101 RT::User
32 RT::Link
24 RT::Article
11 RT::Class
8 RT::Topic
8 RT::ObjectClass
3 RT::Queue
2 RT::Asset
[29770] [Fri Jul 13 17:19:37 2018] [warning]: The following UIDs were expected but never observed: (./rt-importer:186)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::ObjectCustomFieldValue-RT-22 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::ObjectCustomFieldValue-RT-23 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::ObjectCustomFieldValue-RT-24 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::ObjectCustomFieldValue-RT-25 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::ObjectCustomFieldValue-RT-71 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::ObjectCustomFieldValue-RT-72 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::Queue-RT-12 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::Queue-RT-13 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::Queue-RT-14 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::Queue-RT-16 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::Queue-RT-17 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::Queue-RT-21 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::Queue-RT-4 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::Queue-RT-5 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::Queue-RT-6 (./rt-importer:187)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: The following UIDs (serialized => imported) referred to objects missing from the original database: (./rt-importer:192)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::ObjectCustomField-RT-163 => (not imported) (column => ObjectId) (./rt-importer:200)
[29770] [Fri Jul 13 17:19:37 2018] [warning]: RT::ObjectCustomField-RT-167 => (not imported) (column => ObjectId) (./rt-importer:200)

Have you tried to run rt-validator prior to playing with serializer? AFAIK you should first remove the inconsistencies and then do the dump. It should run like this:

/opt/rt4/sbin/rt-validator --check --resolve

If you encounter any issue that is not repaired, try to use the new validator from here and here. Both changes can be merged with these commands:

git clone https://github.com/bestpractical/rt.git
cd rt
git branch -l -a
git checkout -b validator remotes/origin/4.4/validator-create-missing-ticket-role-groups
git merge remotes/origin/4.4/validator-delete-more-dangling-txns

Then you can configure it and make as usual.

Sorry, I should have mentioned that - Yes I did run validator with check and resolve, it came through clean after the second pass.

Here is the line in question in the error:

sub PreInflate {
my $class = shift;
my ($importer, $uid, $data) = @_;

my $ca = $class->_ClassAccessible;

------>>>>>>> my %ca = %{ $ca };

if ($ca{ContentEncoding} and $ca{ContentType}) {
    my ($content_col) = grep {exists $ca{$_}} qw/LargeContent Content/;
    if (defined $data->{$content_col}) {
        my ($ContentEncoding, $Content) = $class->_EncodeLOB(
            $data->{$content_col}, $data->{ContentType},
        );
        $data->{ContentEncoding} = $ContentEncoding;
        $data->{$content_col} = $Content;
    }
}