Binary Attachments Corrupted in Migration to new box

My binary attachments (spreadsheets, screenshots, etc…) got corrupted
after migrating to a new box.

I’m migrating from:
FreeBSD 4.11, RT 3.2.2, MySQL 4.1.7, Apache 1.3.33, Perl 5.8.4,
mod_perl-1.29, DBI-1.42_1
–TO–>
RHEL 4.3, RT 3.4.5, MySQL 4.1.2-3, Apache 2.0.52, Perl 5.8.5,
mod_fastcgi-2.4.2, DBI-1.40-8

Everything else seems fine, but the attachments are corrupt.

How I upgraded:

  1. Install RT 3.4.5 on my RHEL box.
  2. Dumped mysql database:
    mysqldump --opt --add-drop-table --single-transaction --user=root
    –password=my_pass_was_here rt3 | gzip > /usr/backup/rt3_db_last2.sql.gz
  3. deleted the rt3 database on the RHEL box
  4. I was initially getting an error message when importing:

ERROR 1153 (08S01) at line 78: Got a packet bigger than
’max_allowed_packet’ bytes
mysqldump: Got errno 32 on write

  1. I edited /etc/my.cnf (in the [mysqld] section)
    #max_allowed_packet = 1M
    max_allowed_packet = 16M

  2. successfully imported DB:
    mysql -p rt3 < rt3_db_last2.sql

  3. Ran schema upgrade scripts appropriate for 3.2.2 to 3.4.5
    /usr/local/rt3/sbin/rt-setup-database --action schema --datadir
    /usr/local/src/rt-3.4.5/etc/upgrade/3.3.0 --prompt-for-dba-password
    /usr/local/rt3/sbin/rt-setup-database --action acl --datadir
    /usr/local/src/rt-3.4.5/etc/upgrade/3.3.0 --prompt-for-dba-password
    /usr/local/rt3/sbin/rt-setup-database --action insert --datadir
    /usr/local/src/rt-3.4.5/etc/upgrade/3.3.0 --prompt-for-dba-password
    /usr/local/rt3/sbin/rt-setup-database --action schema --datadir
    /usr/local/src/rt-3.4.5/etc/upgrade/3.3.11 --prompt-for-dba-password
    /usr/local/rt3/sbin/rt-setup-database --action acl --datadir
    /usr/local/src/rt-3.4.5/etc/upgrade/3.3.11 --prompt-for-dba-password
    /usr/local/rt3/sbin/rt-setup-database --action insert --datadir
    /usr/local/src/rt-3.4.5/etc/upgrade/3.3.11 --prompt-for-dba-password

  4. Clear mason cache dir:
    rm -fr /usr/local/rt3/var/mason_data/obj

  5. Stop and start apache:
    service httpd stop
    service httpd start

  6. When I open existing tickets with attachments on the new box they
    are corrupt (e.g. jpg’s garbled, downloaded spreadsheets messed-up).

  7. If I upload new binary attachments to RT on new box it works fine.

Any suggestions? I’m guessing this is probably more of a mysql->mysql
problem, but I’m not sure how to deal with it.

Thanks,
Mike

Mike Patterson
Systems Manager
UC Berkeley Extension

Ithin you have to mysqldump with: --default-character-set=binary

-ToddOn Wed, May 10, 2006 at 08:36:41AM -0700, Mike Patterson wrote:

My binary attachments (spreadsheets, screenshots, etc…) got corrupted
after migrating to a new box.

I’m migrating from:
FreeBSD 4.11, RT 3.2.2, MySQL 4.1.7, Apache 1.3.33, Perl 5.8.4,
mod_perl-1.29, DBI-1.42_1
–TO–>
RHEL 4.3, RT 3.4.5, MySQL 4.1.2-3, Apache 2.0.52, Perl 5.8.5,
mod_fastcgi-2.4.2, DBI-1.40-8

Everything else seems fine, but the attachments are corrupt.

How I upgraded:

  1. Install RT 3.4.5 on my RHEL box.
  2. Dumped mysql database:
    mysqldump --opt --add-drop-table --single-transaction --user=root
    –password=my_pass_was_here rt3 | gzip > /usr/backup/rt3_db_last2.sql.gz
  3. deleted the rt3 database on the RHEL box
  4. I was initially getting an error message when importing:

ERROR 1153 (08S01) at line 78: Got a packet bigger than
‘max_allowed_packet’ bytes
mysqldump: Got errno 32 on write

  1. I edited /etc/my.cnf (in the [mysqld] section)
    #max_allowed_packet = 1M
    max_allowed_packet = 16M

  2. successfully imported DB:
    mysql -p rt3 < rt3_db_last2.sql

  3. Ran schema upgrade scripts appropriate for 3.2.2 to 3.4.5
    /usr/local/rt3/sbin/rt-setup-database --action schema --datadir
    /usr/local/src/rt-3.4.5/etc/upgrade/3.3.0 --prompt-for-dba-password
    /usr/local/rt3/sbin/rt-setup-database --action acl --datadir
    /usr/local/src/rt-3.4.5/etc/upgrade/3.3.0 --prompt-for-dba-password
    /usr/local/rt3/sbin/rt-setup-database --action insert --datadir
    /usr/local/src/rt-3.4.5/etc/upgrade/3.3.0 --prompt-for-dba-password
    /usr/local/rt3/sbin/rt-setup-database --action schema --datadir
    /usr/local/src/rt-3.4.5/etc/upgrade/3.3.11 --prompt-for-dba-password
    /usr/local/rt3/sbin/rt-setup-database --action acl --datadir
    /usr/local/src/rt-3.4.5/etc/upgrade/3.3.11 --prompt-for-dba-password
    /usr/local/rt3/sbin/rt-setup-database --action insert --datadir
    /usr/local/src/rt-3.4.5/etc/upgrade/3.3.11 --prompt-for-dba-password

  4. Clear mason cache dir:
    rm -fr /usr/local/rt3/var/mason_data/obj

  5. Stop and start apache:
    service httpd stop
    service httpd start

  6. When I open existing tickets with attachments on the new box they
    are corrupt (e.g. jpg’s garbled, downloaded spreadsheets messed-up).

  7. If I upload new binary attachments to RT on new box it works fine.

Any suggestions? I’m guessing this is probably more of a mysql->mysql
problem, but I’m not sure how to deal with it.

Thanks,
Mike


Mike Patterson
Systems Manager
UC Berkeley Extension


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

We’re hiring! Come hack Perl for Best Practical:
Careers — Best Practical Solutions

Todd,

That fixed it.

Thanks,
Mike

Todd Chapman wrote: