Comment by svilen_dobrev

8 hours ago

gmail uses IMAP.

make another mailbox (another provider - migadu, fastmail, proton, whoever) that has IMAP as well. (selfhosting.. is PITA. only if u really need it).

install some standalone mail-client - thunderbird, clawsmail, applemail, or k9 , aqua on android, whatever. Attach both mailboxes into that. Find out how to copy an e-mail from one folder into another.

Folder by folder, select all mails, copy from one mailbox into the other. Will take time.

(Beware, some clients (apple) will fuckup the mail-date, anything older than 5 years becomes 5 years old. or it shows like that. YMMV.)

i have made this multiple times, for 20+ years of mails...