Legend:
Gmail account = Current @connect.hku.hk account on Google
M365 account = New @connect.hku.hk account on Microsoft
Step 1: Turn on IMAP on Gmail
Step 2: Adjust Power Setting of Mac
Step 3: Create a Temporary Outlook Profile
Step 4: Add Gmail Account to Outlook Client (IMAP)
Step 5: Export emails from Gmail account to local .olm file
Step 6: Connect M365 account to Outlook client
Step 7: Import .olm file to M365 account
Step 8: Move the imported mails to M365 account
Step 9: Verify the Migration Results in Webmail
Step 10: Remove the Temporary Profile
Troubleshooting
Turn on IMAP on Gmail
- Logout from all Google accounts and open an Incognito/InPrivate browser.
- Go to https://webmail.hku.hk and click the button CONNECT.HKU.HK (Google, read-only)
- Login with your UID and password.
- At the top right, click Settings and See all settings.
- Click the Forwarding and POP/IMAP
- In the “IMAP access” section, select Enable IMAP. Click Save Changes.
- Under your account icon, click Manage your Google Account.
- Under Security, in the Less secure app access section, set “Allow less secure apps:” to ON.
Please check all the labels in Gmail, to make sure all label doesn’t contain special character.
Rename any label with special character: ~ ` ! @ # $ % ^ & * ( ) _ + = { } | [ ] \ : ” ; ‘ < > , . ? /
Adjust Power Setting of Mac
- Since the mail migration process may take a long period of time, please connect your Mac to the power adapter.
- To prevent Mac from sleeping when idle, go to Menu > System Preferences > Energy Saver or Battery > Power Adapter > check Prevent your Mac from automatically sleeping when the display is off
OR
Older macOS 10.x can follow this setting:
Create a Temporary Outlook Profile
- Ensure the Outlook app has been quit.
- Open Finder
- Choose Right click Microsoft Outlook > Show Package Contents.
- Select Contents > SharedSupport > Outlook Profile Manager.
- Press +.
- Name the new profile. (e.g., Migration)
- Right click the new profile and choose Set Default. Close the Outlook Profile Manager.




Add Gmail Account to Outlook Client (IMAP)
- Open Outlook and enter your HKU connect email address. Click Continue.
- Click Not Office 365?.
- Select IMAP/POP.
- Enter your HKU connect email address and password. Input the Incoming Server and Outgoing Server accordingly.
- Click Allow in the pop-up window.
- The Google account is added successfully.
- If the Outlook app automatically added the Microsoft 365 account, select the Microsoft account, and delete it by pressing –. Then, select Sign Out. It prevents exporting new mails from the Microsoft account in later steps.
If the Outlook app does not add the Microsoft 365 account automatically, please ignore this step.
Please make sure Gmail account is the only one account on Outlook before you proceed to the next step. - Check the synchronisation of mails
Choose Tools > Sync Status. - Please keep your computer online and wait until all the mails are synchronised to the Outlook app. When all mails are synced, items in Sync Status should be cleared.
Export emails from Gmail account to local .olm file
- If your Outlook is using “New Outlook” user interface as below, please Revert to Legacy Outlook interface, before proceed.
- Choose Tools > Export.
- Select Items of these types: > Emails > Continue.
- Name the file (e.g., ‘Imported from Gmail’) and click Save.




Connect M365 account to Outlook client
- Choose Outlook > Preferences.
- Select Accounts.
- Update the Account description, change from uid@connect.hku.hk to Gmail uid@connect.hku.hk.
- Press + > New Account.
- Input your HKU connect email address. Wait for Outlook to connect to Office 365.
- Input your password in the pop-up window.
- Select the Microsoft account. Update the Account description, change from uid@connect.hku.hk to M365 uid@connect.hku.hk.
- You will see both Google account and Microsoft 365 account appear in the Outlook app.
Import .olm file to M365 account
- Choose Tools > Import.
- Choose Outlook for Mac archive file (.olm) > Continue.
- Choose the exported file and click Import.
- The imported file should appear under On my Computer.
Move the imported mails to M365 account
- Long press the imported file. Drag and drop it to your M365 account.
- Choose Tools and check Sync Status.
Verify the Migration Results in Webmail
- After all the tasks are cleared in Sync Status, go to https://outlook.office.com/mail/
- Log in Microsoft 365 HKU connect account.
- Choose
> View all Outlook settings
- Go to General > Storage. Check the number of messages in all the folders imported from Google mail.
Remove the Temporary Profile
- After migrating all the mails, you may remove the temporary profile.
- Ensure the Outlook app has been quit.
- Open Finder
- ChooseRight click Microsoft Outlook > Show Package Contents.
- Select Contents > SharedSupport > Outlook Profile Manager.
- Select the temporary profile. Click –.
- Choose Delete.
Troubleshooting
The Outlook Import/Export function on Mac is grey out like this:
Revert Outlook to Legacy version
It is a problem of the new Outlook interface. Please change “New Outlook” to “Legacy Outlook” using the following steps:
- Under Menu > Outlook > deselect New Outlook. Click Revert to confirm this change.
- Click Revert to confirm this change.
- Restart your Mac and the interface will be changed to Legacy Outlook and the Import and Export options will be available.