I wrote a small CLI tool for migrating/copying tickets from RT4 to RT5: RT / RT Ticket Migrator · GitLab
Probably won’t be using it myself anymore, but here it is in case someone else wants to.
It uses the APIs so it’s quite resistant to the database inconsistencies which tend to pile up. Note that this is not intended for moving huge loads of tickets. Just e.g. open tickets in one queue at a time.