I suggested eSoftTools IMAP backup and migration program if you don't know how to export IMAP accounts' emails to Thunderbird local folder.This is the best way to export your data safely and securely. This software saves your emails in various file formats like, PST, EML, EMLX, MSG, HTML, MHTML, MBOX, and PDF. it also migrates IMAP account emails to another IMAP account and cloud apps.
More - Export IMAP Account email Knows to Thunderbird Local folder