Guides

Migrate Gmail and Drive to a European suite

The technical walkthrough: copy email without duplicates, change DNS without losing a message, move and convert files, recreate sharing. For the big picture, start with the guide Leave Google Workspace.

1. Prerequisites

  • A Google Workspace super administrator account, with 2-Step Verification turned on.
  • The destination mailboxes already created, with the same addresses.
  • Access to your domain name's DNS, at your registrar.
  • A computer that can stay on for several hours during the copies.
  • In the Google Admin console, IMAP access allowed for users (Gmail settings, POP and IMAP access), and Google Takeout allowed if you plan to use it.

2. Gmail labels and folders

Gmail does not file messages in folders: it attaches labels, and one message can carry several. Other email services use folders, where each message sits in one place only.

When Gmail is read over IMAP, each label shows up as a folder. A message with three labels therefore appears in three folders, and a naive copy copies it three times. On top of that come Gmail's special folders: “All Mail” holds everything, “Important” and “Starred” hold part of it.

To avoid duplicates:

  • copy the inbox, sent messages, drafts and each of your labels;
  • exclude “All Mail”, “Important” and “Starred”;
  • copy archived messages that carry no label separately, or they would be lost: in Gmail, search for has:nouserlabels -in:inbox -in:sent, apply an “Archive” label to them, then copy that label like the others.

3. Copy the email

Recommended method: server-to-server copy

An IMAP sync tool reads the Gmail mailbox and writes to the new one, folder by folder. It can be run again as often as needed: it only copies what is missing. That is what lets you make a big copy in advance, then a quick last copy on switch day.

The reference open source tool is imapsync. On the Google side, it signs in either with an app password (2-Step Verification on and app passwords allowed by the administrator) or with OAuth. A typical command, to adapt:

imapsync \
  --host1 imap.gmail.com --ssl1 --user1 camille@your-company.com \
  --password1 "app-password" \
  --host2 imap.new-provider.eu --ssl2 --user2 camille@your-company.com \
  --password2 "new-mailbox-password" \
  --gmail1 \
  --exclude "\[Gmail\]/(All Mail|Important|Starred|Tous les messages|Suivis)"

The --gmail1 option tunes the tool for Gmail (special folder mapping, rate limits). Run the same command again on switch day.

Google limits how much each account can download per day over IMAP. For a mailbox of several tens of gigabytes, the first copy can take several days: start it early.

Simple method: export then import

For one or two mailboxes of modest size:

  1. In Google Takeout, export Gmail. You get one MBOX file per mailbox, where each message keeps its labels in a header.
  2. In Thunderbird, install the ImportExportTools NG add-on and import the MBOX file into a local folder.
  3. Add the new mailbox to Thunderbird and drag the messages into its folders.

This method cannot easily catch messages that arrive after the export: it suits cases where you change the DNS right after.

4. Change the DNS

  1. 48 hours before: lower the TTL of the MX records to 300 seconds.
  2. On the day: replace Google's MX records with the new provider's.
  3. Right after: in the SPF record, replace include:_spf.google.com with the new provider's, publish its DKIM key and check your DMARC record.
  4. An hour later: run the email copy again to catch messages that reached Google during propagation.
  5. For a week: keep an automatic forward from each Gmail mailbox to the new address, for the rare servers that remember the old MX.

Do not delete Google's verification records (google-site-verification) before the Google account is closed.

5. What Drive does not export

Before exporting, know what will not follow the files:

  • Sharing. No export reproduces it: you have to recreate it at the destination.
  • Version history. Only the latest version is exported.
  • Files shared with you. They belong to their owner: they are in the owner's export, not yours.
  • Forms, sites and scripts. They have no direct equivalent: recreate or archive them (form responses export to a spreadsheet).

Docs, Sheets and Slides files are converted on export. Simple layouts come through well; complex layouts, Google Sheets-specific formulas and Slides animations need checking.

6. Export and convert the files

Export

  • Google Takeout, used by each person: choose Drive, then the export format for each document type. Archives are split into files whose size you choose, up to 50 GB.
  • The Data Export tool in the Admin console exports the whole organisation, shared drives included. It requires a super administrator account at least 30 days old, 2-Step Verification and Google Cloud turned on: archives are placed in a Google Cloud Storage bucket that is deleted 60 days after the export starts. Check the location offered for that bucket. Allow 2 to 14 days.

Convert to OpenDocument

If Takeout gave you Word, Excel or PowerPoint files, most European suites open them directly. To convert them to OpenDocument in one go, LibreOffice does it from the command line:

soffice --headless --convert-to odt *.docx
soffice --headless --convert-to ods *.xlsx
soffice --headless --convert-to odp *.pptx

Keep the originals until you have checked a sample of the converted files.

7. Import and recreate sharing

  1. Reproduce the folder tree. Upload the folders as they are, by drag and drop in the browser or with the new storage's sync client. For large volumes, the sync client recovers better after an interruption.
  2. Create one team space per shared drive. Google shared drives become team folders or spaces, with the same members.
  3. Recreate sharing. For a small team, note the shared folders and who has access before exporting. For a full listing, the Drive API or the open source tool GAM can list the permissions on each file.
  4. Tell your outside contacts. The Google sharing links they received will stop working: send them the new links.

8. Calendars and contacts

  • Calendars: export them from Google Calendar settings or with Takeout, in iCalendar format (.ics), then import each file into the new calendar. Future invitations stay tied to their organiser: let people who often invite you know about the switch.
  • Contacts: export them from Google Contacts in vCard format (.vcf), then import the file into the new address book.
  • Phones: add the new provider's CalDAV and CardDAV accounts, then remove the Google account.

9. Check

  • Similar message counts, folder by folder, between Gmail and the new mailbox
  • Email sent to and received from an outside address
  • Valid SPF, DKIM and DMARC for the new provider
  • Similar file counts between the export and the new storage
  • A sample of documents opened and reviewed, especially complex spreadsheets
  • Sharing recreated and tested with a team member
  • Calendars and contacts visible on computer and phone

Updated on 12 October 2026.