Back to blog Technical

Complete guide: Migrate from Microsoft 365 to Infomaniak step by step

The InfoSwitch Team 20 janvier 2026 25 min read

Migrating from Microsoft 365 to Infomaniak is a strategic decision that more and more businesses are making. Data sovereignty, controlled costs, environmental ethics: there are many reasons. But to succeed in this transition, you need a rigorous methodology. This guide walks you through each step, with the concrete tools and exact commands to use.

Discover Infomaniak Mail offers

Table of contents

  1. Phase 1: Audit and inventory of existing setup
  2. Phase 2: Preparing the Infomaniak environment
  3. Phase 3: DNS preparation (TTL)
  4. Phase 4: Data migration with imapsync
  5. Phase 5: Calendar and contact migration
  6. Phase 6: DNS cutover (D-Day)
  7. Phase 7: Client workstation configuration
  8. Phase 8: Validation and closure

Phase 1: Audit and inventory of existing setup

Before touching anything, you need to accurately map your Microsoft 365 environment. This phase is critical: a poorly prepared migration is a failed migration.

1.1 License and user inventory

Sign in to the Microsoft 365 Admin Center (admin.microsoft.com) and export the complete list of users. You need to identify:

  • Active users – Those who actually use their mailbox
  • Shared mailboxes – Often used for contact@, billing@, etc.
  • Aliases – One person can receive emails at multiple addresses
  • Distribution lists – Groups that redistribute to multiple recipients
  • Resource mailboxes – Meeting rooms, equipment

To export from PowerShell (if you have admin rights):

# Connect to Exchange Online
Connect-ExchangeOnline -UserPrincipalName admin@yourdomain.com

# Export mailboxes with their size
Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName,PrimarySmtpAddress,@{n='Size(GB)';e={(Get-MailboxStatistics $_.Identity).TotalItemSize.Value.ToGB()}} | Export-CSV mailboxes.csv -NoTypeInformation

# Export aliases
Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName,PrimarySmtpAddress,@{n='Aliases';e={$_.EmailAddresses | Where-Object {$_ -like 'smtp:*'}}} | Export-CSV aliases.csv -NoTypeInformation

# Export shared mailboxes
Get-Mailbox -RecipientTypeDetails SharedMailbox | Select-Object DisplayName,PrimarySmtpAddress | Export-CSV shared.csv -NoTypeInformation

1.2 Data volume assessment

Mailbox size directly determines migration time. A 50 GB mailbox does not migrate in 5 minutes. Here are the orders of magnitude to know:

Mailbox size Estimated migration time Required bandwidth
< 2 GB 15-30 minutes Standard
2-10 GB 1-3 hours Standard
10-25 GB 4-8 hours Fiber recommended
25-50 GB 12-24 hours Fiber required
> 50 GB 24-72 hours Dedicated server recommended

These times assume a stable IMAP connection and a properly sized migration server. In practice, allow for a 50% margin.

1.3 Mapping existing flows and rules

Users often have configured elements they forget to mention. Systematically document:

  • Inbox rules – Automatic filtering, folder moves, forwards
  • Outlook signatures – Often customized with logo and contact details
  • Automatic replies – Out-of-office or redirect messages
  • Delegations – Who has access to which mailbox
  • Automatic forwards – Redirects to external mailboxes

These elements do not migrate automatically with emails. They must be recreated manually on the Infomaniak side or in the user's mail client.

1.4 Checking application dependencies

Microsoft 365 is not just a mailbox. Check if you use:

  • SharePoint/OneDrive – File storage to migrate to kDrive
  • Teams – Instant messaging to replace with kChat
  • Complex shared calendars – Resources, delegations
  • Connected third-party applications – CRM, ERP that send emails via 365
  • SSO authentication – Applications using Microsoft identity

Warning about SMTP applications

If you have applications (copiers, servers, CRM) that send emails via a Microsoft 365 SMTP relay, you will need to reconfigure them. Note the IP addresses and credentials used.

Phase 2: Preparing the Infomaniak environment

2.1 Creating the Mail service

Sign in to the Infomaniak Manager (manager.infomaniak.com) and create your Mail service:

  1. Go to "Order a product""Mail Service"
  2. Select the number of mailboxes needed
  3. Choose your domain (existing or to order)
  4. Confirm the order

The service is usually active within 15 minutes of payment.

2.2 Creating mailboxes

Replicate the exact structure of Microsoft 365:

  1. Create each mailbox with the same primary address
  2. Add all aliases associated with each mailbox
  3. Configure storage quotas (minimum equivalent to current size + 20%)
  4. Set strong temporary passwords

For shared mailboxes, Infomaniak offers an equivalent feature. Create them as standard mailboxes then configure shared access via delegations.

2.3 Configuring distribution lists

Microsoft 365 distribution lists become group forwards or aliases at Infomaniak:

  • Small lists (< 10 recipients) – Create an alias that forwards to multiple addresses
  • Large lists – Use Infomaniak newsletter features or a dedicated tool

2.4 Retrieving Infomaniak IMAP information

Note the connection settings for migration:

Parameter Infomaniak value
IMAP server mail.infomaniak.com
IMAP port 993 (SSL/TLS)
SMTP server mail.infomaniak.com
SMTP port 465 (SSL) or 587 (STARTTLS)
Authentication Full email address + password

Phase 3: DNS preparation (TTL)

This step is often overlooked but it is crucial for a fast cutover on D-Day.

3.1 Why reduce the TTL?

The TTL (Time To Live) tells DNS servers worldwide how long they can cache your records. A TTL of 86400 (24 hours) means some servers will continue sending emails to Microsoft for 24 hours after your cutover.

7 days before migration, reduce the TTL of all your email records:

# Recommended TTL values before migration
MX      300   (5 minutes instead of 3600 or 86400)
TXT     300   (for SPF)
CNAME   300   (for autodiscover if used)

3.2 Where to modify the TTL?

It depends on who manages your DNS:

  • DNS at the registrar (OVH, Gandi, etc.) – Modify in the registrar interface
  • DNS at Microsoft – Modify in the 365 Admin Center
  • DNS at Cloudflare – Modify in the Cloudflare dashboard

After modification, verify propagation with:

# Check current MX TTL
dig MX yourdomain.com +short

# Or with nslookup (Windows)
nslookup -type=MX yourdomain.com

Phase 4: Data migration with imapsync

This is the core of the migration. We will use imapsync, the reference open source tool for IMAP migration.

4.1 Why imapsync?

imapsync is the most reliable and widely used tool for email migrations. Its advantages:

  • Incremental synchronization – Only transfers new emails on each run
  • Metadata preservation – Dates, read/unread flags, folders intact
  • Resume after interruption – Continues where it left off
  • Detailed logs – Complete traceability of the migration
  • Open source – Free and auditable

4.2 Installing imapsync

On Linux (Debian/Ubuntu):

# Install via apt
sudo apt update
sudo apt install imapsync

# Verify installation
imapsync --version

On Windows, use WSL (Windows Subsystem for Linux) or a Docker container:

# With Docker
docker pull gilleslamiral/imapsync
docker run gilleslamiral/imapsync imapsync --version

On macOS:

# With Homebrew
brew install imapsync

4.3 Configuring IMAP access to Microsoft 365

Microsoft 365 uses modern OAuth2 authentication. To use imapsync, you have two options:

Option A: Enable basic authentication (simpler)

If your Microsoft tenant still allows it, enable basic authentication for IMAP:

  1. Microsoft 365 Admin Center → Settings → Organization settings
  2. Services → Modern authentication
  3. Enable "Allow access to legacy protocols"

Microsoft is gradually disabling basic auth

Since 2023, Microsoft has been disabling basic authentication on many tenants. If you cannot enable it, use Option B with OAuth2.

Option B: Use OAuth2 with imapsync

It's more complex but it's the sustainable method:

  1. Create an Azure AD application with IMAP.AccessAsUser.All permissions
  2. Generate an OAuth2 token
  3. Use this token with imapsync via the --oauthaccesstoken option

Script to generate a token (requires Azure CLI):

# Connect to Azure
az login

# Generate token
az account get-access-token --resource https://outlook.office365.com/ --query accessToken -o tsv

4.4 imapsync migration command

Here is the standard command to migrate a mailbox:

imapsync \
  --host1 outlook.office365.com \
  --port1 993 \
  --ssl1 \
  --user1 "user@yourdomain.com" \
  --password1 "MicrosoftPassword" \
  --host2 mail.infomaniak.com \
  --port2 993 \
  --ssl2 \
  --user2 "user@yourdomain.com" \
  --password2 "InfomaniakPassword" \
  --automap \
  --syncinternaldates \
  --useheader "Message-Id" \
  --useheader "Date" \
  --skipsize \
  --addheader \
  --logfile "/var/log/imapsync/user.log"

Explanation of important options:

  • --automap – Automatically maps folder names between systems
  • --syncinternaldates – Preserves original email dates
  • --useheader – Identifies duplicates by these headers
  • --skipsize – Ignores minor size differences (encoding)
  • --addheader – Adds a header if missing (avoids duplicates)

4.5 Special folder mapping

System folder names differ between Microsoft and Infomaniak:

Microsoft 365 (English) Infomaniak
Sent Items Sent
Deleted Items Trash
Drafts Drafts
Junk Email Junk
Archive Archive

If automap does not work correctly, force the mapping:

imapsync \
  [...other options...] \
  --regextrans2 "s/Sent Items/Sent/" \
  --regextrans2 "s/Deleted Items/Trash/" \
  --regextrans2 "s/Drafts/Drafts/" \
  --regextrans2 "s/Junk Email/Junk/"

4.6 Batch migration script

To migrate multiple mailboxes, create a CSV file and a script:

File users.csv:

email,password_o365,password_infomaniak
john.doe@yourdomain.com,Password1,NewPassword1
jane.smith@yourdomain.com,Password2,NewPassword2
contact@yourdomain.com,Password3,NewPassword3

Script migrate_all.sh:

#!/bin/bash

LOGDIR="/var/log/imapsync"
mkdir -p $LOGDIR

# Read CSV (skip header line)
tail -n +2 users.csv | while IFS=',' read -r email pwd_o365 pwd_infomaniak
do
    echo "=== Migrating $email ==="
    
    imapsync \
        --host1 outlook.office365.com \
        --port1 993 --ssl1 \
        --user1 "$email" --password1 "$pwd_o365" \
        --host2 mail.infomaniak.com \
        --port2 993 --ssl2 \
        --user2 "$email" --password2 "$pwd_infomaniak" \
        --automap --syncinternaldates \
        --useheader "Message-Id" --useheader "Date" \
        --skipsize --addheader \
        --logfile "$LOGDIR/${email}.log"
    
    echo "=== $email completed ==="
done

echo "Migration complete. Logs in $LOGDIR"

4.7 Two-pass migration strategy

To minimize service interruption, perform the migration in two phases:

  1. First pass (D-3 to D-7) – Initial migration of all history while users work normally on Microsoft 365
  2. Second pass (D-Day) – Delta sync of new emails received since the first pass, then DNS cutover

This approach allows you to:

  • Migrate the bulk of the volume without pressure
  • Identify problems in advance
  • Reduce final cutover time to a few minutes per mailbox

4.8 Alternative: OfflineIMAP or mbsync

If imapsync does not suit your situation, two other open source tools are available:

OfflineIMAP

Better suited to backup than migration, but can be used:

# Installation
pip install offlineimap

# Configuration in ~/.offlineimaprc
[general]
accounts = Migration

[Account Migration]
localrepository = Infomaniak
remoterepository = Microsoft365

[Repository Microsoft365]
type = IMAP
remotehost = outlook.office365.com
remoteuser = user@domain.com
remotepass = password
ssl = yes

[Repository Infomaniak]
type = IMAP
remotehost = mail.infomaniak.com
remoteuser = user@domain.com
remotepass = password
ssl = yes

mbsync (isync)

Faster than OfflineIMAP, different architecture:

# Installation (Debian/Ubuntu)
sudo apt install isync

# Configuration in ~/.mbsyncrc
IMAPStore o365-remote
Host outlook.office365.com
User user@domain.com
Pass password
SSLType IMAPS

IMAPStore infomaniak-remote
Host mail.infomaniak.com
User user@domain.com
Pass password
SSLType IMAPS

Channel migration
Far :o365-remote:
Near :infomaniak-remote:
Patterns *
Create Both
SyncState *

# Execution
mbsync migration

Phase 5: Calendar and contact migration

Emails are only one part of the migration. Calendars and contacts require a different approach.

5.1 Export from Microsoft 365

Calendars

Each user can export their calendar in ICS format:

  1. Outlook Web (outlook.office.com) → Calendar
  2. Settings (gear icon) → View all Outlook settings
  3. Calendar → Shared calendars
  4. Publish a calendar → Select the calendar → Create
  5. Download the ICS link

For bulk PowerShell export (Exchange calendars):

# Export calendar events (requires EWS Managed API)
$Service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService
$Service.Credentials = New-Object System.Net.NetworkCredential("admin@domain.com", "password")
$Service.AutodiscoverUrl("admin@domain.com")

$CalendarFolder = [Microsoft.Exchange.WebServices.Data.CalendarFolder]::Bind($Service, [Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Calendar)
$Appointments = $CalendarFolder.FindAppointments((Get-Date).AddYears(-2), (Get-Date).AddYears(1))

Contacts

Export in CSV or vCard format:

  1. Outlook Web → Contacts
  2. Manage → Export contacts
  3. Choose CSV or vCard format

5.2 Import to Infomaniak

Via Infomaniak webmail

  1. Sign in to webmail (mail.infomaniak.com)
  2. Calendar → Settings → Import
  3. Select the exported ICS file
  4. Same procedure for contacts with vCard/CSV file

Via CalDAV/CardDAV with a tool

For automated migration, use vdirsyncer:

# Installation
pip install vdirsyncer

# Configuration ~/.config/vdirsyncer/config
[general]
status_path = "~/.vdirsyncer/status/"

[pair calendars]
a = "calendar_o365"
b = "calendar_infomaniak"
collections = ["from a", "from b"]

[storage calendar_o365]
type = "caldav"
url = "https://outlook.office365.com/caldav/"
username = "user@domain.com"
password = "password"

[storage calendar_infomaniak]
type = "caldav"
url = "https://caldav.infomaniak.com/"
username = "user@domain.com"
password = "password"

# Execution
vdirsyncer discover
vdirsyncer sync

5.3 Shared calendars and resources

Microsoft 365 shared calendars (meeting rooms, equipment) cannot be migrated automatically. You must:

  1. Recreate shared calendars in Infomaniak
  2. Export/import existing events
  3. Reconfigure sharing permissions
  4. Update recurring invitations

Phase 6: DNS cutover (D-Day)

This is the critical moment. You will redirect the email flow from Microsoft to Infomaniak.

6.1 Pre-cutover checklist

Before touching DNS, verify that:

  • All mailboxes are created on the Infomaniak side
  • imapsync migration of all mailboxes is complete (first pass)
  • Users have their Infomaniak credentials
  • TTL has been reduced for at least 48 hours
  • You have admin access to domain DNS
  • A maintenance window has been communicated to users

6.2 Order of operations on D-Day

Recommended timing: Friday evening or Saturday morning to have the weekend as a buffer.

  1. T-30 min – Launch delta imapsync sync on all mailboxes
  2. T-0 – Modify DNS records in the following order:
    1. MX record → mta.infomaniak.ch (priority 10)
    2. Remove old Microsoft MX records
    3. Modify SPF → v=spf1 include:spf.infomaniak.ch ~all
    4. Add Infomaniak DKIM record
    5. Update DMARC if necessary
  3. T+15 min – Verify DNS propagation
  4. T+30 min – Send a test email from external
  5. T+1h – Run a final imapsync sync to recover emails that arrived at Microsoft during propagation

6.3 Complete Infomaniak DNS configuration

Here are the records to configure:

Type Name Value TTL
MX @ mta.infomaniak.ch (priority 10) 3600
TXT @ v=spf1 include:spf.infomaniak.ch ~all 3600
TXT infomaniak._domainkey [DKIM key - see Infomaniak Manager] 3600
TXT _dmarc v=DMARC1; p=quarantine; rua=mailto:dmarc@yourdomain.com 3600
CNAME autodiscover autodiscover.infomaniak.com 3600

6.4 Verifying propagation

Use multiple tools to verify that changes have propagated:

# MX verification
dig MX yourdomain.com +short
# Expected: 10 mta.infomaniak.ch.

# SPF verification
dig TXT yourdomain.com +short
# Expected: "v=spf1 include:spf.infomaniak.ch ~all"

# DKIM verification
dig TXT infomaniak._domainkey.yourdomain.com +short

# Verification via different DNS servers
dig @8.8.8.8 MX yourdomain.com +short    # Google DNS
dig @1.1.1.1 MX yourdomain.com +short    # Cloudflare DNS
dig @9.9.9.9 MX yourdomain.com +short    # Quad9 DNS

Useful online tools:

  • MXToolbox (mxtoolbox.com) – Complete MX/SPF/DKIM/DMARC test
  • DNSChecker (dnschecker.org) – Worldwide propagation
  • Mail-tester (mail-tester.com) – Deliverability test

6.5 Managing the transition period

For 24 to 48 hours after the cutover, emails may still arrive at Microsoft (DNS servers not updated). To lose nothing:

  1. Keep Microsoft mailboxes active for a few days
  2. Configure a Microsoft → Infomaniak redirect if possible
  3. Or run imapsync daily for 3 days
# Post-migration sync script (to run via cron)
#!/bin/bash
# sync_remaining.sh - To run D+1, D+2, D+3

for email in $(cat /path/to/email_list.txt); do
    imapsync \
        --host1 outlook.office365.com --port1 993 --ssl1 \
        --user1 "$email" --passfile1 "/secrets/${email}_o365.txt" \
        --host2 mail.infomaniak.com --port2 993 --ssl2 \
        --user2 "$email" --passfile2 "/secrets/${email}_infomaniak.txt" \
        --maxage 7 \
        --logfile "/var/log/imapsync/post_${email}_$(date +%Y%m%d).log"
done

Phase 7: Client workstation configuration

Each user must reconfigure their devices. Prepare guides adapted to each platform.

7.1 Outlook (Windows)

Two possible approaches:

Approach A: New profile (recommended)

  1. Control Panel → Mail → Show profiles
  2. Add a new "Infomaniak" profile
  3. Manual IMAP configuration:
    • Incoming server: mail.infomaniak.com (993, SSL)
    • Outgoing server: mail.infomaniak.com (465, SSL)
    • Username: full email address
  4. Set this profile as default
  5. Keep the old profile for a few days (read-only)

Approach B: Modify existing account

  1. File → Account settings → Account settings
  2. Double-click the Microsoft account
  3. Modify servers
  4. Outlook will resync (may take a long time)

7.2 Apple Mail (macOS / iOS)

On macOS:

  1. System Preferences → Internet Accounts
  2. Add account → Other Mail account
  3. Enter Infomaniak email and password
  4. Automatic configuration via autodiscover

On iOS:

  1. Settings → Mail → Accounts → Add account
  2. Other → Add Mail account
  3. Enter Infomaniak details

7.3 Android

With Gmail (default app):

  1. Gmail → Menu → Settings → Add account
  2. Other
  3. Enter email and password
  4. Select IMAP
  5. Configure manually if detection fails

For calendars and contacts, install DAVx⁵ (open source):

  1. Install DAVx⁵ from F-Droid or Play Store
  2. Add an account with URL: https://sync.infomaniak.com
  3. Authenticate with your Infomaniak credentials
  4. Select calendars and address books to sync

7.4 Thunderbird

Thunderbird usually detects settings automatically:

  1. Menu → New → Existing mail account
  2. Enter name, email and password
  3. Thunderbird configures automatically via autodiscover
  4. Verify IMAP is selected (not POP3)

Phase 8: Validation and closure

8.1 Validation tests

Perform these tests for each user:

  • Receiving an email from an external address (Gmail, etc.)
  • Sending an email externally
  • Verifying email history is present
  • Test sending between colleagues (internal)
  • Mobile sync
  • Access to calendars and contacts

8.2 Deliverability test

Send an email to mail-tester.com and aim for a score of at least 9/10. Verify:

  • SPF: PASS
  • DKIM: PASS
  • DMARC: PASS
  • No blacklist
  • Non-spam content

8.3 Documentation and closure

After validation:

  1. Document the new settings for internal support
  2. Archive imapsync migration logs
  3. Schedule Microsoft 365 cancellation (note the notice period)
  4. Raise DNS TTL back to 3600 or higher
  5. Delete temporary passwords and sensitive files

8.4 Microsoft 365 cancellation

Do not cancel immediately. Keep Microsoft 365 active for 30 days to:

  • Recover any delayed emails
  • Allow users to recover forgotten items
  • Have a fallback plan in case of major issues

Then, in the Microsoft 365 Admin Center:

  1. Billing → Your products
  2. Select the subscription
  3. Cancel subscription

Summary: Typical migration timeline

Day Actions
D-14 Microsoft 365 audit and inventory
D-10 Create Infomaniak accounts
D-7 Reduce DNS TTL + start imapsync migration
D-3 Complete first imapsync pass + tests
D-1 User communication
D-Day Delta sync + DNS cutover + workstation configuration
D+1 to D+3 Residual sync + user support
D+7 Final validation + TTL restoration
D+30 Microsoft 365 cancellation

Conclusion

Migrating from Microsoft 365 to Infomaniak is a technical project that requires rigor, but it is perfectly achievable with the right tools and method. Key takeaways:

  • Prepare thoroughly – The initial audit prevents 90% of problems
  • Use imapsync – It's the reference tool, reliable and proven
  • Migrate in two passes – To minimize interruption
  • Reduce TTL in advance – For a fast cutover
  • Don't rush cancellation – Keep Microsoft active for 30 days

If you prefer to entrust this migration to experts, InfoSwitch accompanies businesses through this transition. We handle the entire technical process so you can focus on your business.

Create my Infomaniak Mail Service

Ready to migrate to Infomaniak?

Contact us for a free 15-minute audit. We will analyze your situation and provide you with a personalized quote.

Request a free audit
Share this article:

Also read