You can have the Gmail emails be forwarded to your own email server, or have your server fetch them from Gmail, and then migrate bit by bit, the most important accounts first.

Before SPF and the like, it used to be trivial to also send email with a different From address (like your existing Gmail address) from your own server, but that’s not the case anymore.