Depending on your specific needs, you probably want one of imapsync, isync/mbsync, or OfflineIMAP. You could also use mutt or Thunderbird or the client of your choice to connect to both servers and move items through the UI.
In this article https://anarc.at/blog/2021-11-21-mbsync-vs-offlineimap/ the author observes missing emails with both of them.
And I thought neither tool supported upload, am I mistaken?
Is simply using rsync to transfer the mail folders from one Maildir-based email server to another a viable approach?