Steps to Migrate Email from Gmail to M365 using MS Outlook

Video Guide on Migrate Emails Using Outlook Client on Windows

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: Create a Temporary Outlook Profile
Step 3: Add Gmail Account to Outlook Client (IMAP)
Step 4: Export emails from Gmail account to local .pst file
Step 5: Connect M365 account to Outlook client
Step 6: Import .pst file to M365 account
Troubleshooting

Turn on IMAP on Gmail

  1. Logout from all Google accounts and open an Incognito/InPrivate browser.
  2. Go to https://webmail.hku.hk and click the button CONNECT.HKU.HK (Google, read-only)

    Go to https://webmail.hku.hk and click the button CONNECT.HKU.HK (Google, read-only)

  3. Login with your UID and password.

    Login with your UID and password

  4. At the top right, click Settings and See all settings.

    At the top right, click Settings and See all settings

     

  5. Click the Forwarding and POP/IMAP

    Click the Forwarding and POP/IMAP

     

  6. In the “IMAP access” section, select Enable IMAP. Click Save Changes.

    In the “IMAP access” section, select Enable IMAP. Click Save Changes

  7. Under your account icon, click Manage your Google Account.

    Under your account icon, click Manage your Google Account

  8. Under Security, in the Less secure app access section, set “Allow less secure apps:” to ON.

    Under Security, in the Less secure app access section

    set “Allow less secure apps:” to ON

  9. Please check all the labels in Gmail, to make sure all label doesn’t contain special character.

    Rename any label with special character: ~ ` ! @ # $ % ^ & * ( ) _ + = { } | [ ] \ : ” ; ‘ < > , . ? /

    check the labels in Gmail

Create a Temporary Outlook Profile

  1. Go to Control Panel, look up Mail (Microsoft Outlook).

    Go to Control Panel, look up Mail (Microsoft Outlook)

  2. Under Show Profiles, click Add. Under Profile Name, enter Migration and click OK.

    Under Show Profiles

    click Add

    . Under Profile Name, enter Migration and click OK

  3. Click Cancel under the Add Account page.

    Click Cancel under the Add Account page

  4. Click OK when you see the alert on create a profile with no email account.

    Click OK when you see the alert on create a profile with no email account

  5. Choose Prompt for a profile to be used, Click Apply and OK.

    Click Apply and OK

Add Gmail Account to Outlook Client (IMAP)

  1. Open Outlook.  Select the new Profile Name: Migration and click OK.

    Open Outlook.  Select the new Profile Name: Migration and click OK

  2. Enter your HKU Connect email address.  Click Advanced options and click Let me set up my account manually.

    click advanced options

    Enter your HKU Connect email address.  Click Advanced options and click Let me set up my account manually

  3. Select Google.

    Select Google

  4. Enter imap.gmail.com under Server of Incoming mail; enter 993 under Port; select SSL/TLS under Encryption method.
  5. Enter smtp.gmail.com under Server of Outgoing mail; enter 587 under Port; select STARTLS under Encryption method.
  6. Click Next.

    Click Next

  7. Enter your HKU Portal PIN/Graduate Email Account Password.  Click Connect.

    Enter your HKU Portal PIN/Graduate Email Account Password.  Click Connect

  8. Enter yourUID@connect.hku.hk and HKU Portal PIN/Graduate Email Account Password again.

    Login with your UID and password

  9. The Google account permissions window may appear. Click Allow.

    authorize MS to access google

  10. Once Outlook finishes adding your Gmail account, click OK.

    Once Outlook finishes adding your Gmail account, click OK

  11. Outlook may take hours to synchronize all mails to local computer. Please keep it online and wait until the Send/Receive status complete.  You can click the Send/Receive bar at the bottom to check the progress and this bar will be gone after synchronization is completed.

Export emails from Gmail account to local .pst file

  1. Open Outlook.  Select File, Open & Export and Import/Export.

    Open Outlook.  Select File, Open & Export and Import/Export

    Open Outlook.  Select File, Open & Export and Import/Export

  2. Select Export to a file and click Next.

    Select Export to a file and click Next

  3. Select Outlook Data File (.pst) > Next.

    Select Outlook Data File (.pst) > Next

  4. Select the email account (@connect.hku.hk using Gmail) and Next.

    Select the email account (@connect.hku.hk using Gmail) and Next

  5. Choose the preferred file destination, name the file and click OK.  Then click Finish.

    Choose the preferred file destination, name the file and click OK.  Then click Finish

  6. You can set a password to protect the exported .pst file, or you can leave it blank. Click OK.

    You can set a password to protect the exported .pst file, or you can leave it blank. Click OK

  7. After the export is completed, close Outlook.

 

Connect M365 account to Outlook client

  1. After the export is completed, close Outlook.
  2. Open Control Panel, look up Mail (Microsoft Outlook).  Click Show Profiles and select the profile Migration.  Click Properties, E-mail Accounts and New.

    Open Control Panel, look up Mail (Microsoft Outlook).  Click Show Profiles and select the profile Migration. 

    Click Properties, E-mail Accounts and New

    Click Properties, E-mail Accounts and New

  3. Type Your NameEmail address and Password and click Next.  Click Finish.

    Type Your Name, Email address and Password and click Next.  Click Finish

    Type Your Name, Email address and Password and click Next.  Click Finish

  4. Open Outlook and it shows both the Microsoft account (the upper one) and Google account (the lower one).

    Open Outlook and it shows both the Microsoft account (the upper one) and Google account (the lower one)

Import .pst file to M365 account

  1. Right click the M365 account and select New Folder.

    Right click the M365 account and select New Folder.

  2. Add a name for the folder.

    Add a name for the folder

  3. Select the newly created folder. Then select File, Open & Export and Import/Export.

    Select the newly created folder. Then select File, Open & Export and Import/Export

  4. Select Import from another program of file and click Next.

    Select Import from another program of file and click Next

  5. Select Outlook Data File (.pst)and click Next.

    Select Outlook Data File (.pst)and click Next

  6. Choose the location of the imported .pst fileand click Next.

    Choose the location of the imported .pst fileand click Next

  7. Select Import items into the current folder and click Finish. All emails from your Gmail account will be imported into the destination folder of your Microsoft account.

    Select Import items into the current folder and click Finish.

  8. After importing the mails to your Microsoft account, if you find the imported folders are empty, click View, Change View and IMAP Messages for each imported folder and all emails will be shown.

    After importing the mails to your Microsoft account, if you find the imported folders are empty, click View, Change View and IMAP Messages and all emails will be shown

  9. Go to https://webmail.hku.hk and select the button CONNECT.HKU.HK (Microsoft 365). Double check if all the migrated emails can be read on webmail.
  10. You can remove the temporary profile created if you don’t want to keep it.  Close Outlook.  Go to Control Panel and look for Mail (Microsoft Outlook). Click Show Profiles and select Migration.  Click Remove and OK to confirm the deletion.

    Click Show Profiles and select Migration.  Click Remove and OK to confirm the deletion. 

Troubleshooting

Please run the following script which could help to convert the imported mail folder(s) to Outlook native format.

  1. Open the MS Outlook 365 Client
  2. Download script file here (filename: fiximportedimapfolders.zip)

    Download script file here (filename: fiximportedimapfolders.zip)

  3. Extract the zip file. Open the extracted folder and double click the FixImportedIMAPFolders.vbs file

    Extract the zip file. Open the extracted folder and double click the FixImportedIMAPFolders.vbs file

  4. Click OK to run the file

    Click OK to run the file

  5. Select the Outlook icon on task bar

    Select the Outlook icon on task bar

  6. You will see the follow windows. Select the Import from Gmail folder and click OK.

    You will see the follow windows. Select the Import from Gmail folder and click OK.

  7. Select the following icon on Task bar

    Select the following icon on Task bar

  8. Click Yes, to include subfolders

    Click Yes, to include subfolders

  9. Click OK to complete

    Click OK to complete

  10. The imported mails will show up on mobile Outlook/Mail app.

 

Credit: Solution was provided by howto-outlook.com .

12
76