Migrating from Gmail to Office 365

New companies usually start with Gmail as their primary email system which caters to the needs of individuals and organizations of various sizes. With business growth, they migrate to Office 365 after their requirements start getting more complex realizing the suitability of Office 365 for enterprise-level uses.  Especially in the corporate world, Office 365 is a go-to product for business productivity

Migrate From Gmail to Office 365

There are various methods of migration for moving IMAP mailboxes to Office 365. If you have a little number of mailboxes to migrate, you can export the PST file from Gmail (in Outlook) to Office 365 (in Outlook). There are many tools available to perform this, or you can contact the Office 365 migration service provider to do this task for you. There is also another way to migrate using Fastrack Specialists from Microsoft if the environment is big enough. Your Google environment should consist of APIs and Admin SDK which are enabled for extended functionalities.

Also, manual IMAP migrations can be performed by the user, but contacts and calendar information will not be migrated.

Pre-requisites

Here are a few limitations to consider before moving on with the migration.

  • Only items in a user’s inbox or other mail folders will migrate. Contacts, calendar items, or tasks will not be migrated. Although, later on, you can import/export contacts/calendars using Outlook.
  • A maximum number of 500,000 items for a user’s mailbox will be migrated. Do note that emails will be migrated from newest to oldest.
  • The biggest email that can be migrated will be of 35 MB in size.
  • If the connections to your Gmail are limited then increase these connections limits to improve migration performance. Connection limits usually include client/server total connections, IP address connections and per-user connections on the server/firewall.

The Steps Required to Migrate from Gmail to Office 365

The following major steps will be used during the migration process.

Steps for Migration

Step-1: Preparations

The first step would be to sign up for Office 365 if not done already. If you are not sure about which subscription of Office 365 to choose, go with the most basic version if it fulfills your requirements and then, later on, you can add other things on top of it. For details, you can compare Office 365 plans.

Compare Office 365 Plans

Once you sign-up, you’ll create an account which will be an admin account. Later on, if you want, you can change this account to a regular account and make some other account as an administrator. We will need an administrator account of Office 365 to complete the migration operation.

Gmail views Outlook as a less secure app and thus G suite users are required to use a password and 2-step verification to connect the app to Office 365. If you are not going to use users’ mailbox with Outlook till the completion of migration, then there is no need to use password and 2-step verification.

For the migration, users’ mailboxes will be initially created in office 365, and then connected to the corresponding Gmail mailboxes. The emails will be syncing on an on-going basis until you make the final cut-over, which will enable users to send and receive emails via Gmail and the syncing is taking place in the background until the final cut-over is made.

Step-2: Verify Your Domain in Office 365

Firstly, the user must verify to Office 365  that he owns the domain which is used for the Gmail Account. If you can successfully log-in to your domain registrar account, you can create the DNS record for your domain. This is enough for Office 365 that you own the domain name. If you are having issues with logging-in the domain registrar account, then you can opt to use

companyname.onmicrosoft.com

as the domain, which is part of their Office 365 subscription and then add users to Office 365.

If you opted for domain verification, you will be prompted to complete this during the Office 365 setup by adding the TXT record that the setup wizard provides at the company’s domain host provider.

  1. Login to Office 365 portal.
  2. Now click on the “Admin” tile from the home page and you will be redirected to the “Admin Center”.
  3. A message will be showing that “Your office 365 setup is incomplete”. Click on “Go to setup” from here.
  4. In the options select “Add a domain”.
    Add a Domain in Office 365
  5. Then check on the radio button of “I already own a domain” and then type in your domain name and click on next.
  6. Verify domain: Now Office 365 will automatically find out who is the domain provider and following 2 options will be shown:
    • Sign-in to domain provider: In this option, you will be redirected to the domain provider webpage, and you just have to sign-in using your domain provider credentials. This will confirm to Microsoft that you own this domain.
    • Verify TXT record: If you cannot or do not want to use the above option, then manually adding the TXT value given by Microsoft to the domain will verify the domain. You will be given a TXT name, TXT value, and TTL.
    Verify Domain in Office 365
  7. Enter these values in your domain record and then come back to this page and then click on “Verify”. Following is an example TXT record:

TXT name: @
TXT Value: MS=ms1234567
TTL: 3600

Verify Domain Through TXT in Office 365

Step-3: Create User Mailboxes & Assign Office 365 Licenses

Before creating users, make sure that you have purchased the appropriate number of licenses for the users. For example, if you want to add 20 users, first get the license for 20 users. You can also add the users and assign the license later. But for bulk addition, it is a good idea to assign the licenses at this stage, as it will be easier now.

  1. Open the “Admin Center” of office 365, then click on “Billing”.
  2. Now click on “Subscription”.
  3. And then click on “Add/remove licenses”.
    Add/Remove Users in Office 365 Subscription
  4. Now select the total number of licenses you want to purchase.
  5. In the “Admin Center” click on the “Users
  6. Then click on “Active Users”.
  7. Now click on the “More” button
  8. If you just want to add only a few users then add them one-by-one by just clicking on “Add a user” from the screen of the previous step and then manually enter the values.
  9. You will also be given the “Import Multiple Users” option by using a CSV file.
  10. Create a CSV file (an MS Excel file) with the following headings row in the same order:
    1. User Name. Remember the email address of the user in the format xyz@example.com will be entered in the “User Name” column.
    2. First Name
    3. Last Name
    4. Display Name
    5. Job Title
    6. Department
    7. Office Number
    8. Office Phone
    9. Mobile Phone
    10. Fax
    11. Address
    12. City
    13. State or Province
    14. ZIP or Postal Code
    15. Country or Region.
  11. When “Import Multiple Users” is clicked, the user is given the option to download a sample excel file, which can also be used as a reference to add the users.
    Import Multiple Users in Office 365 Admin Center
  12. Now from the 2nd line, start adding users’ details in each line. For example, if you want to add 20 users in Office 365, this excel file will have 21 rows. The 1st row is the header row, and the next 20 lines will be filled with the users’ details.
  13. Now when your CSV file is ready, click on “Create and upload file”.
  14. Now “Browse” to select the CSV file.
  15. Now click on “Verify”, which will confirm that the format in the CSV file is correct or not. After completion of the verification, the message of “File looks good” will appear then click on “Next”.
    Verification of CSV File For Addition of Users in Office 365
  16. Now, for these users, customize the options as per your requirement. It will be better to assign the product licenses for these users at this stage. You can opt to not assign the licenses to the users by selecting the “Create users without product license”. If you opted for this option, then you’ll have to assign the license later manually. Once done with customization, click on “Next” to create these users.
    Users in the Exchange Admin Center

Step-4: Create Migration Endpoints with Gmail IMAP

Office 365 establishes a simplified communication channel with Gmail to complete migration, called migration endpoint. After creating users in office 365, we will create “Migration Endpoints” in 365 to connect point to Gmail and then migrate the emails from Gmail to 365.

  1. In the “Admin Center”, click on “Admin Centers” link at the bottom of the left pane.
  2. Then Click on “Exchange” which will open the Exchange Admin Center.
    Open Exchange Admin Center
  3. Now in the left panel of windows, click on “recipients
  4. Now click on the “migration” located on the top bar (the last option).
  5. Now click on More (the three dots …), and then click on “Migration Endpoints”.
    Add “Migration Endpoint” in Exchange Admin Center
  6. Now in the migration endpoints windows, click on the “+” icon to create new migration endpoints.s
  7. You will be given options of
  • Exchange Remote
  • Outlook Anywhere
  • IMAP (select this)
Select IMAP Migration Endpoint

Select “IMAP

  1. Now enter the following values for Gmail.
  • IMAP server:
    imap.gmail.com
  • Authentication:
    Basic
  • Encryption:
    SSL
  • Port:
    993
Google IMAP Migration Configuration

Then click on Next.

  1. Now the migration service will use these settings to establish a connection to Gmail. If the connection works perfectly, the ‘Enter general information page’ will open.
  2. In the “Enter General Information Page”, enter the name for this “Migration endpoint” for example RN-test-migration and no need to enter any values in the fields of:
  • Maximum concurrent migrations
  • Maximum concurrent incremental sync.

Leave these two fields empty.

Name of Migration Endpoints

Step-5: Create List of Users for Migration Batch

Before starting the migration process, you must first list down every Gmail mailbox that has to be migrated in a CSV (MS Excel) file. The list itself can be migrated in batches or all at once, but only 50,000 mailboxes can be imported in a single batch. Moreover, the CSV file size must be less than or equal to 10 MB and each user’s data must have its row.

While creating migration files, you must know the password for every Gmail ID that will be migrated. It is practically impossible to know every password, then reset the user’s password in Gmail and assign temporary passwords during the migration for every Gmail mailbox. This can only be performed by a G Suite administrator.

Do note that this CSV (MS Excel file) will be different than the one we used for creating new users in Admin Centers of Office 365. This CSV file will be used only for migrating mailboxes from Gmail to Office 365 for the users that we have already added in Office 365. The 1st line of this CSV file will be a header row with the following three column headings :

  • EmailAddress: The Email ID of Office 365
  • UserName: Gmail ID
  • Password: Password of Gmail ID
Explanation of Pattern of CSV File

And from the 2nd row, enter the list of mailboxes that needs to be migrated. The password field will contain a Gmail password for the corresponding mailbox that we are migrating.

  1. Now sign-in to the G Suite admin console and select ‘Users’.
    Select Users in G-Suite Admin Console.
  2. With G Suite console opened, sign-in to the Office 365 Admin Center.
  3. Select ‘Users’ and then “Active users”.
  4. Keep Office 365 Admin Center open and then launch Excel.
  5. In Excel, label
  • A1 as “EmailAddress” Office 365 mailbox ID
  • B1 as “UserName” Gmail mailbox ID,
  • C1 as “Password” Gmail mailbox app password/the reset temporary password.
  1. Now, in the next rows, enter one mailbox per row in the format as discussed in the step above by using the G-Suite Admin Console and Office 365 Admin Center. Both email addresses i.e. of Office 365 and Gmail can be similar as well, but the environment (From G Suite to Office 365) will be different.
  2. Once all the email IDs are entered, save the file in the CSV format. This file will be used in the next step.

Step-6: Create Migration Batch to Migrate Mailboxes

It is time now to migrate a batch of Gmail mailboxes to Office 365. To ensure the process goes smoothly, first migrate a small number of mailboxes as a test batch. If everything goes fine, you will have an idea of how much time the migration process will take. You can then start the migration process all at once or in many migration batches at the same time (recommended). The factors which impact migrations are the batch size, internet bandwidth, speed, number of simultaneous connections allowed to Gmail.

  1. In “Exchange Admin Center” click on Recipients
  2. Then click the last option of top row “Migration“, click on the “+” icon and then click on “Migrate to Exchange Online”.
    Migrate to Exchange Online
  3. Now create a new “Migration Batch”. The following 4 options will be displayed.
  • Remote move migration
  • Staged migration
  • Cutover migration
  • IMAP migration (Select This)
IMAP in New Migration Batch

Now select the “IMAP Migration”.

  1. Now in the “Select the Users” window, click on “browse” and select the CVS file created in the last step (which has the username and password for Gmail accounts to be migrated). Then click on “Next”.
  2. After validation, Office 365 displays the Gmail mailboxes. Make sure that the number of users Office 365 is showing is the correct number that you want to migrate. Then Click Next.
  3. The IMAP migration configuration values that we already entered will be displayed. Following values will be displayed:
  • IMAP server:
    imap.gmail.com
  • Authentication:
    Basic
  • Encryption:
    SSL
  • Port:
    993
  1. Click on “Next” and enter the Migration Batch name (no spaces or special characters) and then click on “New”, which will create the migration batch. Also, provide the names of the folders to excluded (i.e. Junk Email, Deleted, etc.). Click Add (+) icon to add them to the excluded list.
    Exclude Folders in Migration Batch Configuration
  2. Then start migrating the emails automatically.
    Automatically Start the Migration Batch
  3. Status of this migration batch will be initially shown as “Queued”, which will, later on, change to “Syncing”. And once the migration is complete, it will change to “Synced”. In the migration process, you can click on “View details” to check how many emails have been migrated so far for each mailbox.
    Migration Batch is Syncing
  4. If an error occurs, the specific information will be under the associated Mailbox status reports
  5. If everything worked fine, then users should be able to log in with their username and temporary password. They should create a new password and set the correct time zone. Finally, they should send a test email to ensure that their mailbox contains the right emails and folders.
  6. Remember to lower the time-to-live setting in the DNS server to ensure that there are no mail delivery delays. You can do this in the email system’s mail exchanger records/MX records within the company’s public-facing DNS. It should be set at 3,600 seconds or lower. This should be reset back to a higher time when the synchronization is complete.

Step-7: Update DNS & Repoint MX Records to Office 365

Email systems deploy a DNS record (MX record) to find out the exact address for the email delivery. Still, the MX record is pointing to Gmail. Now is the point to change MX record to refer to Office 365. After you change your MX record, the email sent to your Gmail Account is delivered to Office 365 mailboxes.

The DNS records need to verify that your domain has been changed from Google to Office 365. There are many instructions to change the MX record for different DNS systems. Before you stop synchronization with Gmail, you need to wait a minimum of 72 hours as it takes that much for other email systems to recognize the MX record change. After 72 hours, you can stop synchronization with Gmail.

  1. In the “Admin Center”, click on “Settings”.
  2. Then Click on “Domains”.
    Open Domains in Settings
  3. Now click on your domain name. This will say “Setup in progress”. You might also see another line here, which will say “Setup completed”. For example, if your domain name is example.com
  • example.com (Default) – Setup in progress
  • onmicrosoft.com – Setup completed
Open the Default Site

Now Click on the default example.com

  1. You will see “Setup your online services” screen with the following two options:
  • Add records for me: This option will be used to connect to the DNS domain (For example, GoDaddy) & automatically update the MX records.
  • I’ll manage my DNS records:  This option will give you a list of DNS entries (MX record values) that you’ll need to add manually in your domain registrar account.
  1. Select the 2nd option, to see the MX records you would be required to add on your DNS. The following is an example of the records: MX, TXT, and CNAME. Remember that for your domain, the MX record values will be different.
    Required DNS Settings of Office 365
  2. Once you update your DNS with the above values, you’ll start receiving the new emails to our Office 365.
  3. Before deleting the migration batch and stop syncing, make sure that all emails are being routed to Office 365. To delete the migration batch, go to the Exchange admin center and select ‘Recipients’ and then click on ‘Migration.
  4. Choose the batch and select ‘Delete’. You need to check that the migration batch is not displayed on the migration dashboard, which means that migration has worked.

Step-8: Import Contacts and Calendar

Once migration is completed, you can independently import your Google Contacts and Calendar to Office 365. If you have an Outlook desktop version installed, then you can create a CSV file of the Gmail contacts and then import it to the Outlook with the import/export wizard. Also, Outlook offers a wizard to import the Google calendar.

Import Calendar in Outlook

Hopefully, you have migrated from Gmail to Office 365 successfully.

ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.