After a mail server failure, where mail data is lost, it may be possible to recover a user's mail from the Thunderbird local IMAP cache.
DO NOT reconnect Thunderbird to the new mail server
Set Thunderbird to Offline Mode
Copy (drag and drop) the still-visible mail and mail folders from the IMAP account into Local Folders
Once you are confident that all the desired mail has been copied/moved to Local Folders:
Set Thunderbird to Online Mode
Connect the new mail server account
Copy or move the mail from Local Folders to the new IMAP folders