Hello,
The way I do migrations is by using imapsync. A bash script reads all mailbox info (source, user, pass >>> destination, user, pass) from a file and imapsync transfers over the messages via IMAP. This way I do not have to deal with possible issues. It might be slower though than rsync (I haven’t tested). But the best of all is that I don’t need to take offline any services.
Apart from all that, Gilles (the creator of imapsync) is a great person and I love imapsync 😎