Cybersecurity Blog

24 min read

Migrate From Gmail to Office 365: Step-By-Step Guide

Jun 18, 2019 1:24:37 PM

Most people that come to us to migrate their email to Office 365 are under the impression that it's a really easy process. You have no idea how many times I've heard, "you're just copying and pasting a bunch of .pst files". So I'm publishing my step-by-step guide for migrating Gmail to Office 365 to show everyone how to do it themselves. 

This article is continuously being updated as steps change. Last updated: June 18, 2019. 


Table of Contents

  1. Preparation
  2. Migrate Gmail to Office 365
  3. Post-migration steps for Gmail

man with sharpie

Preparation

  1. What email service are you currently using?
  2. Who is your DNS provider, who is the admin to the account, and what are the credentials?
  3. How many inboxes are there?
  4. What items do you want to migrate? Just the emails? Contacts? Calendar items?
  5. Do you have any shared inboxes?
  6. How many domains do you have?
  7. How many email aliases are there?
  8. How large (GBs) are each of the mail boxes?

coworkers

Migrate Gmail to Office 365

Using the Internet Message Access Protocol (IMAP), we can migrate the mailboxes from Gmail (G Suite) to Office 365 as Gmail supports IMAP and this type of migration is called IMAP migration.  

Limitations of IMAP migration:

  1. You can only migrate emails from the user mailbox. IMAP migration does not migrate Contacts, Calendar items or tasks from Source (Gmail) to Office 365, although emails and folder structures are migrated as is. Users or admins have to manually export the contacts and calendars from Source and then Import it to Office 365. 
  2. You can only migrate up to a maximum of 500,000 items from a user mailbox from source to Office 365. The emails are always migrated from newest to oldest. 
  3. The largest email that you can migrate is 35 MB.

Before you start, make sure that you:

  1. Have access to the DNS
  2. Have the first name, last name, username, and password for all users in an excel spreadsheet  
  3. Know which one of the users is an admin on Gmail 
  4. Can access the Office 365 tenant admin credentials
  5. Make sure that Google MFA has been turned off for all users 

Let's start! The entire process should take about 60-90 minutes

Step 1 -Validate that Google MFA and "allow access to less secure apps" are turned off

  1. For every user, connect to their Gmail account via https://www.google.com/gmail/ 
  2. Once connected, click on Account (top right corner) and click Google Account 
  3. Click on Securitygmail_portal_security_tab
  4. Make sure that "Use your phone to sign in" and "2-Step Verification" are both turn offturn_off_2_step_verification
  5. Make sure that Less secure app access is turned Off 

 Step 2 - Add users in Office 365

  1. Add users in Office 365  and create user mailboxes for the users by applying Exchange Online licenses from either a standalone plan or through a subscription that contains Exchange Online plan.

    You will need to connect from G Suite mailboxes to these newly created user mailboxes in Office 365 and the data will be transferred to the respective mailboxes in Office 365 

Step 3 - Create a list of Gmail (S Suite) mailboxes to migrate to Office 365 

  1. Create a CSV file in Excel to list all the users to migrate to Office 365.
  2. If the users in Gmail (G Suite) have 2-step verification enabled on their accounts, then you need to know the app password of each Gmail mailbox that you want to migrate. If 2-step verification is turned-off on Gmail accounts, then you need normal user account passwords for the users in Gmail.
  3. It is not mandatory to migrate all Gmail mailboxes at once. You can migrate them in batches at your convenience. You can include up to 50,000 mailboxes (one row for each user) in your migration file. The file can be as large as 10 MB.
  4. Use the following screenshot as a template to create the migration file in Excel. Start with the headings in row 1. Make sure they match the picture exactly and don't contain spaces. The exact heading names are:
    1. EmailAddress in cell A1.
    2. UserName in cell B1.
    3. Password in cell C1.excel_user_names
  5. Next enter the email address, username, and app password (user account password) for each mailbox you want to migrate. Enter one mailbox per row.
    1. Column A is the email address of the Office 365 mailbox. This is what's shown in the username column in Users > Active users in the Office 365 admin center.
    2. Column B is the sign-in name for the user's Gmail mailbox—for example, alberta@contoso.com.
    3. Column C is the app password for the user's Gmail mailbox. Creating the app password is described in Migration from G Suite mailboxes using the Office 365 admin center.user_excel_passwords
  6. Save the file as a CSV file type, and then close Excel. 

gmail_migration_save_as_csv

Step 4 - Connect Office 365 to Gmail (G Suite) by creating Migration Endpoint in Exchange Admin Center 

  1. Login to Exchange Admin Center https://outlook.office365.com/ecp with Global Administrator account  
  2. Go to Recipients > Migration > More… > Migration Endpoints.create_gmail_migration_endpoint
  3. Click New + to create a new migration endpoint.new_migration_endpoint
  4. On the Select the migration endpoint type page, choose IMAP, and click Next. 
  5. On the IMAP migration configuration page, set IMAP server to imap.gmail.com and keep the default settings the same. (Authentication – Basic, Encryption – SSL, Port – 993).imap_migration_configuration page
  6. Click Next. The migration service uses the settings to test the connection to Gmail system. If the connection works, the Enter general information page opens.
  7. On the Enter general information page, type a Migration endpoint name, for example, Test5-endpoint. Leave the other two boxes blank to use the default values.migration_endpoint_name
  8. Click New to create the migration endpoint. 
  9. Click Close on the Migration Endpoint page. 

close_imap_endpoint_migration

Step 5 - Create a migration batch in EAC and start migrating Gmail mailboxes 

Use a migration batch to migrate groups of Gmail mailboxes to Office 365 at the same time. The batch consists of the Gmail mailboxes that you listed in the migration file in the previous Step 3: Connect Office 365 to Gmail. 

It's a good idea to create a test migration batch with a small number of mailboxes to first test the process. Use migration files with the same number of rows, and run the batches at similar times during the day, then compare the total running time for each test batch. This helps you estimate how long it could take to migrate all your mailboxes, how large each migration batch should be, and how many simultaneous connections to the source email system you should use to balance migration speed and Internet bandwidth. 

  1. In the Office 365 admin center, navigate to Admin center > Exchange. https://outlook.office365.com/ecpexchange_admin_center_email_migration
  2. In the Exchange admin center, go to Recipients > Migration.
  3. Click New > Migrate to Exchange Online.migrate_to_exchange_online
  4. Choose IMAP migration > Next.IMAP_email_migration
  5. On the Select the users page, click Choose File to specify the migration CSV file you created. After you select your migration file, Office 365 checks it to make sure: 
    1. It isn't empty. 
    2. It uses comma-separated formatting. 
    3. It doesn't contain more than 50,000 rows.
    4. It includes the required attributes in the header row.
    5. It contains rows with the same number of columns as the header row.
    6. If any one of these checks fails, you'll get an error that describes the reason for the failure. If you get an error, you must fix the migration file and resubmit it to create a migration batch.resubmit_email_migration_batch_office_365
  6. After Office 365 validates the migration file, it displays the number of users listed in the file as the number of Gmail mailboxes to migrate.
  7. Click Next.
  8. On the Set the migration endpoint page, select the migration endpoint that you created for Gmail in the previous step, and click Next.set_migration_endpoint_for_gmail
  9. On the IMAP migration configuration page, accept the default values, and click Next.IMAP_migration_configuration
  10. On the Move configuration page, type the name (no spaces or special characters) of the migration batch in the box—for example, Test5-migration. The default migration batch name that's displayed is the name of the migration file that you specified. The migration batch name is displayed in the list on the migration dashboard after you create the migration batch.You can also enter the names of the folders you want to exclude from migration. For example, Shared, Junk Email, and Deleted. Click Add + to add them to the excluded list. You can also click Edit to change a folder name and Delete to delete the folder name. You can also define the Bad item limit and Large item limit.new_batch_migrationnew_batch_migration_2
  11. Click Next
  12. On the Start the batch page, do the following:
    1. Choose Browse to send a copy of the migration reports to other users. By default, migration reports are emailed to you. You can also access the migration reports from the properties page of the migration batch.
    2. Choose Automatically start the batch > new. The migration starts immediately with the status Syncing.automatically_start_email_migration_batch
  13. If you have large user mailboxes and the status shows Syncing for a long time, you may be experiencing bandwidth limits set by Google. For more information, see Bandwidth limits and Sync limits. You can try to unlock the Gmail user or use alternative method to migrate the users. For more information, see Use network upload to import your organization PST files to Office 365 and Third-party tools for Office 365 migrations. 

Step 6 - Verify that the migration worked 

  1. In the Exchange admin center, go to Recipients > Migration. Verify that the batch is displayed in the migration dashboard. If the migration completed successfully, the status is Synced. 
  2. If this task fails, check the associated Mailbox status reports for specific errors, and double-check that your migration file has the correct Office 365 email address in the EmailAddress column. 


Step 7 - Notify your users via SMS  

  1. Go to https://www.eztexting.com/ 
  2. Click on Log in 
  3. Click in Contacts 
  4. Click Add a Contact (use the phone number given to you by your users)  and Save. Once done, you will see something like below.  (Note: You will have to decide if you will notify only your contact or all the users being migrated. If you need to notify every user, you will need to create a group)eztexting
  5. Click on the 'Blue arrow' under the 'Text' column to send a message  
  6. In the Subject, type your company name
  7. Within the message section, type something like "We want to let you know that your email migration started. We will notify all of you via SMS once you can start following your Post Migration Steps" 

Step 8 - DNS Access  

  1. Validate that you can still connect to the DNS  

Step 9 - Backup Client DNS settings

  1. Log in into client DNS and back up existing DNS 

Step 10 - Add vanity domain and update DNS on new Office 365 tenant 

  1. Log to Office 365 with Admin credentials
  2. Go to Admin -> Setup -> Domains
  3. Click on Add Domain
  4. Enter your domain
  5. You will be prompted by the Verify Domain page. Select Add a TXT record instead
  6. On a separate browser, open the DNS from the client and add the TXT record
  7. Once done, wait one minute and then click on Verify
  8. You will now be prompted by the Update DNS settings page. Select I'll add the DNS records myself
  9. Update the DNS accordingly and remove any GoDaddy email server references
  10. Once done, click the Refresh button until you get the message "All DNS records are correct, no error found"

Step 11 - Update Primary email addresses to new vanity domain

  1. On Office 365 Portal, click on Users -> Active users 
  2. Select one user, and click Edit within the Username / Email section  
  3. Create a new alias using the new vanity domain name and click Add  
  4. Click Set as primary 
  5. A big Warning yellow box will be displayed. Click Save  
  6. Click Close  
  7. Now ready Steps b -f for all the other users
  8. If you get a warning Red box saying that you need to wait up to 4 hrs, do the following steps: 
    1. Open Windows PowerShell as Administrator and run the following commands:  

update_vanity_domain_gmail

Step 12 - Email Testing 

  1. On Office 365 Portal, click on Users -> Active users 
  2. Select one of the user and reset his password (uncheck Make this user change their password when they first sign in)  
  3. Now, send a test email to this user  
  4. In a separate window, open Office 365 portal, use the credential of this user, and confirm that your email was received.  
  5. Delete the test email from their inbox as well as their deleted email folder

Consider this step completed only when both send  and  receive tests have been successful.  

Step 13 - Password Reset 

  1. Now, reset the passwords for all users and check make the users change their password when they first sign in 
  2. All passwords should now have been reset 

Step 14 - Set SSPR on new domain  

  1. Within Office 365, click on Admin -> Admin centers ->Azure Active Directory
  2. Click on Azure Active Directory
  3. Click on Password Reset
  4. Under Self-service password reset enabled, select All
  5. Click Save  


Step 15 - Stop Email synchronization from Gmail by Deleting the Synced migration batches 

  1. Let the migration batch run for at least 72 hours before you delete it. This makes the following two things more likely:
    1. Your Gmail mailboxes and Office 365 mailboxes have synchronized at least once in 24 hours (they synchronize once a day).
    2. The email systems of your customers and partners have recognized the changes to your MX records and are now properly sending email to your Office 365 mailboxes.
  2. One you verified that all emails are being routed to Office 365 after switching the MX records, you can Delete the Migration batch. After you delete the migration batch, the synchronization between Gmail and Office 365 will stop.
  3. When you delete the migration batch, the migration service cleans up any records related to the migration batch and removes it from the migration dashboard.
  4. To Delete a migration batch, use the below steps:
    1. Go to Exchange admin center > Recipients > Migration.
    2. On the migration dashboard, select the batch, and then click Delete.
    3. How do you know this worked?
      1. In the Exchange admin center, navigate to Recipients > Migration. Verify that the migration batch no longer is listed on the migration dashboard.

two people

Post-Migration Steps from Gmail to Office 365

 

Step 1 - Reset your password

To connect to your new email:

  1. Go to https://www.office.com
  2. Click on Log in
  3. Use your credentials
    1. Username: <your email address> (i.e.: johndoe@contoso.com)
    2. Temporary password: NewPassw0rd! (<-just an example)
    3. Follow the wizard to reset and create your own password.
    4. Once done, you will be able to check your email on your smartphone (iOS or Android) using the Outlook app and/or via Office 365 Outlook Web (as shown below)

office_365_portal_2

Step 2 - Install Office 365 on your PC or Mac

    1. Go to https://portal.office.com/OLS/MySoftware.aspx
    2. Click on Log in
    3. Use your new credentials as created in “Step 1 - Reset your password.”
    4. Your screen should look similar to the followingdownload_office_365
 
  1. Click the Install button to download and install Office 365 on your computer

Step 3 - Update Office 365 to the latest version

  1. Open Microsoft Word
  2. Click on Files
  3. Click on Office Account
  4. Click the button Update Options -> Update Now
    1. Microsoft Office will install an update or you will get a message such as "You're up to date! The latest version of Office is installed on your computer"

Step 4 - Install Outlook to check your email

  1. If you're on a Mac then follow these instructions, where you will find information on how to:
    1. Add email accounts
    2. Welcome to your inbox
    3. Create and send email
    4. Organize your inbox
    5. Create an email signature
    6. Welcome to your calendar
    7. Schedule a meeting or appointment on a Mac
  2. If you use a PC, then follow these instructions, where you will find information on how to:
    1. Add an email account
    2. Create and send email
    3. Manage calendar and contacts
    4. Collaborate
    5. Set up your mobile apps
    6. Learn more

woman lost in meeting

There you go, that's everything you need to know about migrating your email from Gmail to Office 365. If you have any questions feel free to shoot us an email, give us a call, or use the chat box in the bottom right-hand corner.

Don't want to do it yourself? Schedule a meeting and we'll do it for you.

Schedule a meeting

Brandon Lecoq
Written by Brandon Lecoq

Cybersecurity Manager

Post a Comment