Labels can complicate the migration away from Gmail, especially if the receiving service doesn't provide specific import tools. This post describes a way of handling such a case.
https://www.locked.de/how-to-migrate-gmail-to-another-provider-without-breaking-the-mail-history