Importing a whack of old tickets into a week old install

Ok,

First off I know this is probably not reccomended, but we recently had a major failure on one of our systems that just happened to be the system running RT.

I had to get it up and runnning on another box immediately and therefore didnt get the chance to restore the old db from backup and import that into the new install before we started using the new one.

Now for the problem. I’ve got thousands of old tickets full of usefull information, and the first couple hundred tickets now have the same ticket id as my new tickets.

Is is safe for me to write a perl script that re-writes the ticket id’s and inserts them into the live database? How will it effect RT if there are tickets with a higher ticket number but older timestamps?

My system is running rh7.2 (x86)/mysql 3.23.44/Apache/1.3.22/RT 2.0.9

any pointers would be appreciated, if this is a FAQ, please just ignore me, I wanted to send the email out ASAP so I can get this resolved before there’s a billion tickets in the new system.

thanks,
ryan

– Ryan Speed - Network Administrator - http://www.datawave.ca

Hmm…

I’d say from an MySql point of view - you could just pump em in there -
but changing Id, as well as that the owner / requestor / dependencies are
different id
with a new install they’d just be kinda floating in there.

As far as I can see the ID really only is an id and nothing else.

Is is safe for me to write a perl script that re-writes the ticket id’s and inserts them into the live database? How will it effect RT if there are tickets with a higher ticket number but older timestamps?

Yes, but no. I cannot see a reason why RT2 would object if you did
this, but if someone replies to a ticket that’s been renumbered, their
reply will be lost, or added to the wrong ticket. Perhaps you can
renumber only those that would conflict and hope that’s far enough back
in time that you won’t get new correspondence on them?

If you do renumber the tickets, be extra careful to ensure you’ve
updated all references to the ticket id in other tables :wink:

bje

Is is safe for me to write a perl script that re-writes the ticket id’s and inserts them into the live database? How will it effect RT if there are tickets with a higher ticket number but older timestamps?

Yes, but no. I cannot see a reason why RT2 would object if you did
this, but if someone replies to a ticket that’s been renumbered, their
reply will be lost, or added to the wrong ticket. Perhaps you can
renumber only those that would conflict and hope that’s far enough back
in time that you won’t get new correspondence on them?

In any case, if you’re ever in the instance of having a new installation
as a temporary measure (or slow upgrade), put a fake row in the Tickets
table with an id number above the highest number in the previous
installation. This will insure that new tickets created will be numbered
(thanks to auto_increment on the id column) in a way that doesn’t conflict
with your previous ticketing system.

Not that Byron or I have any liking for keeping the same numbering system
or anything :wink:

                         Bruce Campbell                            RIPE
               Systems/Network Engineer                             NCC
             www.ripe.net - PGP562C8B1B                      Operations