ionicons-v5-l
Contact
Support

Gmail Migration: How to Migrate Gmail Labels

Gmail labels and IMAP folders work quite differently. Learn how best to convert Gmail labels when performing a Gmail migration without loosing your existing label hierarchy!

 . Email Migration How To  . Gmail Migration: How to Migrate Gmail Labels
How to Migrate Gmail Labels: All You Need to Know

By introducing the concept of labels, Google decided to forgo the traditional folder based system that is used by 99% of all email providers and opted for a custom solution to organise messages. Though labels are very popular among some users, they create serious challenges as soon as you leave the Gmail ecosystem. For example, if you add your Gmail address to an email client or migrate from Gmail to another provider, Gmail labels need to be mapped to create compatibility with the Internet’s default standard, the IMAP protocol.

In this article, you’ll learn how labels are converted to folders and what this means for your Gmail migration. So let’s jump right in!

💡 This article is relevant if you plan to migrate from Gmail to another provider. It’s less important if you migrate from another provider to Gmail or from Gmail to another Gmail account.

Summary:

Gmail labels work very differently from IMAP folders, which can lead to duplicates or missing messages when migrating from Gmail to another provider. Gmail converts labels into folders during migration, creating technical copies for emails with multiple labels. In this article, we’ll explain two different migration approaches to migrate Gmail label: Either by skipping duplicates to achieve a small mailbox or by crating 1:1 clone to exactly replicate Gmails label system.

On this page:

If you’d like to deep dive into Gmail default labels, have a look at this list. And in case there are still questions left, you’ll find the FAQs for the article here.

Gmail Architecture Basis:
How Gmail Labels & Tags Work

When it comes to organising email messages, Gmail stands out with one characteristic: Google works with labels instead of folders. While folders are a hierarchical concept to store messages, labels are added to the metadata of a message. This makes it possible to assign multiple labels to one email. If you log in to Gmail, you see labels displayed as tags right next to the message.

How to Migrate Gmail Labels: Emails with Multiple Labels
Email with two Gmail labels: Inbox & Business

Messages that have multiple labels show up under each label. Since this behaviour differs significantly from IMAP folders, you need to choose one of two possible approaches when converting Gmail labels to IMAP folders.

Of course, it’s not required for a message to have label. Emails without labels are still displayed in the All Mail default label. Gmail ships with multiple default labels, e.g. Inbox, Unread, Starred, Drafts, Trash and many more. For a detailed overview of Gmail default labels, have a look at this deep dive.

Gmail vs IMAP:
The Difference between Labels and Folders

So what’s the difference between Gmail labels and IMAP folders? Basically, it comes down to this key difference:

🏷️ Gmail labels are metadata information.
Because of this, one email can have multiple labels.

🗂️ IMAP folders are hierarchical containers.
Therefore, emails can typically exist in only one folder. If the same email is moved to multiple folders, a duplicate (so-called “cross-duplicate”) is created.

IMAP Compatibility of Gmail Labels:

Which makes us wonder: What happens if you add your Gmail account to a conventional IMAP client such as Outlook, Thunderbird, Apple Mail?

Given the big architectural difference between labels and folders, Google had to make labels compatible with IMAP. This is done by mapping labels into folders. Mapping Gmail labels is the only way IMAP clients can understand Google’s labels.

How does Google make Gmail labels accessible for IMAP?

  • When adding a Gmail account to an IMAP client, an email with multiple labels will appear in multiple IMAP folders.
  • To be able to be shown in multiple folders, one or more technical copies of the message are created.
  • These technical copies all point to the same message, as they reference the same Message-ID in the mail header.
  • This allows Gmail to continue using their metadata based label system (e.g. for the Gmail web interface).
  • IMAP clients can represent the same mail structure through the created technical copies (“cross-duplicates”).

➡️ The exception to the rule: The All Mail folder
As you might know from your Gmail web interface, every single email can be found under the All Mail label ([Gmail]/All Mail). This label contains all messages except those stored in Trash and Spam. You can understand this label as some kind of “master storage” for all relevant email data.

How to
Migrate Gmail Labels with MailJerry

When migrating your mailbox from Gmail to another provider using IMAP, your labels are mapped in the same way as when using an email client. This brings us to the question: How to deal with emails that have multiple labels?

During the email migration, every label is converted into an IMAP folder. And every email is moved into the respective folder. If an email contains two or more Gmail labels, Gmail provides a duplicate for every additional label. Here’s an example:

Gmail to IMAP default mapping behaviour:

Email in GmailEmail migrated to IMAPTotal Count
Message A with label “Important”Message A moved to folder “Important”1
Message B with labels “Important” and “Proposals”Message B moved to folder “Important”
Duplicate moved to folder “Proposals”
2

➡️ The Gmail default IMAP mapping inevitably creates duplicates in your new mailbox.

✅ But heads up! In MailJerry, we’ve implemented different solutions to help you deal with the Gmail mapping problem.

When performing a migration from Gmail to another provider, you can opt for one of these two approaches to handle duplicates:
A) Skip duplicates (default setting in MailJerry, creates smaller mailbox footprint)
B) Migrate duplicates (creates a 1:1 clone of Gmail, larger mailbox footprint)

Approach A: Skip Duplicates

✅ This is MailJerry’s default setting, it’s active by default.

How does it work?

  • MailJerry alphabetically walks through every folder. The first appearance of a message is copied in the respective folder of the new mailbox.
  • If the same message is found in another folder (identified by the Message-ID), the duplicate is skipped.

What you’ll receive:

  • The new mailbox will have no duplicates and therefore consume less storage space.
  • It is not a 1:1 clone of the Gmail mailbox because every email is only copied into the folder where it was first seen.

🧐 Hey – what about the All Mail folder? Isn’t it the first in line?
Well combined, Sherlock! Since the folder listing in IMAP is ordered alphabetically, “All Mail” would be one of the first folders. To prevent all emails being copied to “All Mail” and skipped for the remaining folders, MailJerry relies on the following order:

  1. Default folders (Inbox, Sent, Drafts…)
  2. Custom folders (= previously custom labels)
  3. All Mail

Since “All Mail” is the last in line, it will only contain emailst hat are located nowhere else (e.g. archived emails without further labels).

Approach B: Migrate Duplicates

How to Migrate Gmail Labels: Migrate Duplicates

✅ To migrate duplicates with MailJerry, open the “Advanced Settings” and enable “Migrate Duplicates” before or after the migration.

How does it work?

  • MailJerry alphabetically walks through every folder and copies every message to the new provider.
  • Emails with multiple labels are copied into each folder and are technically duplicates.

What you’ll receive:

  • As a result, you’ll receive a 1:1 clone of the Gmail mailbox.
  • Because of the duplicates caused by messages with multiple Gmail labels, you’ll have significantly more messages in the new mailbox compared to your Gmail account.
  • Therefore, the new mailbox is usually much bigger than the source and consumes more disk space.

Pros & Cons of Each Approach:

ApproachAdvantagesDisadvantages
Skip duplicates
  • Both mailboxes have about the same size & message count
  • Faster migration
  • Less storage space required
  • Target mailbox is not a 1:1 clone
  • Could feel like emails are missing
    (since they are stored only in one folder)
Migrate duplicates
  • 1:1 clone of the source mailbox
  • The new mailbox “feels” the same as the old mailbox
  • Message count does not match with the source mailbox
  • Slower migration
  • More storage space required
  • Deleted emails may still exist elsewhere

Pro Tip:
How to Exclude Certain Labels

If you wish to prevent certain Gmail labels from being migrated to your new mailbox, you can simply hide them for IMAP in the Gmail settings. Here’s how:

1. Sign in to your Gmail account at https://gmail.com.
2. In the sidebar, select Manage labels.
3. Disable “Show in IMAP” for every label you don’t want to migrate

How to Migrate Gmail Labels: Disable IMAP for Gmail Labels

➡️ Labels that are not visible over IMAP are not included in the migration. For example, you could hide the “All Mail” label to save storage space and still have all other messages sorted the way you are used to.

Deep Dive:
Gmail Default Labels

As mentioned earlier, Gmail ships with various default labels. These labels are assigned to or removed from a message when a user performs a specific actions. In the list below, you find a description of frequent Gmail default labels and learn more about their behaviour:

LabelDescriptionAssigned When...Removed When...
InboxMain inbox viewA new email arrivesEmail is archived or moved out of Inbox
UnreadNot technically a label, but a stateEmail is unreadEmail is opened/read
StarredMarks important messagesUser stars the messageUser removes the star
ImportantGmail assigns this label based on user interactions or filtersGmail's algorithm flags it, or the user sets itUser removes importance manually
SentAll sent messagesEmail is sent by the userAlmost never removed
DraftsSaved but unsent messagesUser saves a draftDraft is sent or deleted
SpamDetected as junk mailGmail flags it, or user marks it as spamMessage is moved to Inbox or Trash
TrashDeleted emailsUser deletes the messageEmptied manually or after 30 days
All MailArchive of all emails (except for Trash and Spam)All non-Trash/Spam messages live hereOnly removed if email is permanently deleted
ChatsOld Hangouts/Chat messagesYou chat using classic Google Chat/HangoutsRemoved only by user
CategoriesAuto-classification (e.g. Promotions, Updates)Gmail classifies the email using machine learningOnly changes if reclassified or removed by the user

Gmail Label Migration:
Frequent Questions

What happens to Gmail labels during an email migration?

When mapping Gmail labels to IMAP, every label is converted into an IMAP folder. If an email has multiple labels, it is moved to the folder corresponding to the first label. For the remaining labels, Gmail creates technical duplicates so the email appears in the other folders, too.

How can I avoid duplicates when migrating from Gmail to another provider?

Simply perform your Gmail migration with MailJerry, as MailJerry prevents duplicates as default behaviour.

What is the safest way to get a 1:1 clone of my Gmail inbox?

Enable “Migrate Duplicates” in the advanced settings of your migration. This copies every message for every label, replecating Gmail’s structure exactly, but resulting in a larger mailbox.

What happens to the All Mail label during migration?

“All Mail” acts as Gmail’s master archive. To prevent every email being copied there first, MailJerry processes system folders and custom labels before migrating All Mail. This ensures that your label structure is preserved, without having to create a 1:1 clone of your Mailbox.

Can I exclude certain Gmail labels from migration?

Yes. Go to Gmail and select “Manage Labels” in the sidebar. Disable “Show in IMAP” for any label you don’t want migrated. These labels won’t be included in the migration.

Do Gmail filters or categories migrate too?

No. Gmail filters (rules that automatically label, archive, or forward emails) are not migrated, as they are account-specific settings. Only the messages and their assigned labels are migrated.