Office Support / Office 365 Admin / Setup

Migrate Google Apps mailboxes to Office 365

You can use Internet Message Access Protocol (IMAP) migration to migrate Google Apps Gmail mailboxes to Office 365.

Migrate your IMAP mailboxes to Office 365 gives you an overview of the migration process. When you're comfortable with the contents of that article, use this one to begin migrating mailboxes from Gmail to Office 365.

You must be a global admin in Office 365 to complete these steps.

If you want to see PowerShell commands for general IMAP migrations, see Use PowerShell to perform an IMAP migration to Office 365.

Migration tasks

The following list contains the migration tasks given in the order in which they have to be completed.

  1. Verify you own your domain

  2. Add users to Office 365

  3. Create a list of Gmail mailboxes to migrate

  4. Connect Office 365 to Gmail

  5. Migrate your Gmail mailboxes

  6. Optional: Reduce email delays

  7. Route Gmail directly to Office 365

  8. Stop synchronization with Gmail

Verify you own your domain

In this task, you'll first verify to Office 365 that you own the domain you used for your Google apps accounts.

Notes   Another option is to use the your company domain that is included with your Office 365 subscription instead of using your own custom domain. In that case, you can just add users as described in Create users in Office 365 and omit this task.

Most people, however, prefer to use their own domain.

Domain verification is a task you will go through as you setup Office 365. During the setup Office 365 setup wizard provides you with a TXT record you will add at your domain host provider. See Verify your domain in Office 365 for the steps to complete in Office 365 admin center, and choose a domain registrar from the two following options to see how to complete add the TXT record that your DNS host provider.

  • Your current DNS host provider is Google.    If you purchased your domain from Google and they are the DNS hosting provider, follow these instructions: Create DNS records when your domain is managed by Google.

  • You purchased your domain from another domain registrar.    If you purchased your domain from a different company, we provide instructions for many popular domain hosting providers.

Add users to Office 365

You can add your users either one at a time, or several users at a time. When you add users you also add licenses to them. Each user has to have a mailbox on Office 365 before you can migrate email to it. Each user also needs a license that includes an Exchange Online plan to use his or her mailbox.

Important   At this point you have verified that you own the domain and created your Google Apps users and mailboxes in Office 365 with your custom domain. Close the wizard at this step. Do not proceed to Set up domain, until your Gmail mailboxes are migrated to Office 365. You'll finish the setup steps in task 7, Route Gmail directly to Office 365.

Create a list of Gmail mailboxes to migrate

For this task, you create a migration file that contains a list of Gmail mailboxes to migrate to Office 365. The easiest way to create the migration file is by using Excel, so we use Excel in these instructions. You can use Excel 2013, Excel 2010, or Excel 2007.

When you create the migration file, you need to know the password of each Gmail mailbox that you want to migrate. We’re assuming you don’t know the user passwords, so you’ll probably need to assign temporary passwords (by resetting the passwords) to all mailboxes during the migration. You must be an administrator in Google apps to reset passwords.

You don’t have to migrate all Gmail mailboxes at once. You can do 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.

To create the migration file
  1. Sign in to Google admin console using your administrator username and password.

  2. After you’re signed in, choose Users.

    List of users in the Google admin center.
  3. Hover over each name to identify each user’s email address. Write down the address.

  4. To reset each user’s password, hover over each user name and choose Reset Password. Reset the password and write the new password down next to the related user name.

    Reset Gmail password.
  5. Sign in to the Office 365 admin center, and go to USERS > Active Users. Keep an eye on the USER NAME column. You’ll use this information in a minute. Keep the Office 365 admin center window open, too.

    User Name column in the Office 365 admin center.
  6. Start Excel.

  7. 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:

    • EmailAddress in cell A1.

    • UserName in cell B1.

    • Password in cell C1.

      Cell headings in the Excel migration file.
  8. Next enter the email address, user name, and password for each mailbox you want to migrate. Enter one mailbox per row.

    • Column A is the email address of the Office 365 mailbox. This is what’s shown in the USER NAME column in users and groups in the Office 365 admin center.

    • Column B is the sign-in name for the user’s Gmail mailbox—for example,

    • Column C is the password for the user’s Gmail mailbox.

      A completed sample migration file.
  9. Save the file as a CSV file type, and then close Excel.

    Shows the Save As CSV option in Excel.

Connect Office 365 to Gmail

To migrate Gmail mailboxes successfully, Office 365 needs to connect and communicate with Gmail. To do this, Office 365 uses a migration endpoint. Migration endpoint is a technical term that describes the settings that are used to create the connection so you can migrate the mailboxes. You create the migration endpoint in this task.

To create the connection between Office 365 and Gmail
  1. Go to the Exchange admin center.

  2. In the Exchange admin center, go to Recipients > Migration > More More icon > Migration endpoints.

    Select Migration endpoint.
  3. Choose New New icon to create a new migration endpoint.

  4. On the Select the migration endpoint type page, choose IMAP.

  5. On the IMAP migration configuration page, set IMAP server to and keep the default settings the same.

  6. Choose 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. Choose New to create the migration endpoint.

Migrate your Gmail mailboxes

You 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 task.

Tips   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.

To create a migration batch and start migrating Gmail mailboxes
  1. In the Office 365 admin center, choose Admin > Exchange.

    Go to Exchange admin center.
  2. In the Exchange admin center, go to Recipients > Migration.

  3. Choose New New icon > Migrate to Exchange Online.

    Select Migrate to Exchange Online
  4. Choose IMAP migration > Next.

  5. On the Select the users page, choose Browse to specify the migration file you created. After you select your migration file, Office 365 checks it to make sure:

    • It isn't empty.

    • It uses comma-separated formatting.

    • It doesn't contain more than 50,000 rows.

    • It includes the required attributes in the header row.

    • It contains rows with the same number of columns as the header row.

    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.

  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.

    New migration batch with CSV file
  7. Choose Next.

  8. On the Set the migration endpoint page, select the migration endpoint that you created in the previous step, and then choose Next.

  9. On the IMAP migration configuration page, accept the default values, and then choose Next.

  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. Choose Add Add icon to add them to the excluded list. You can also use the edit icon Add icon to change a folder name and the remove icon Remove icon to delete the folder name.

    Move configuration dialog
  11. Choose Next

  12. On the Start the batch page, do the following:

    • 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.

    • Choose Automatically start the batch > new. The migration starts immediately with the status Syncing.

      Micgration batch is syncing

Note   If the status shows Syncing for a long time, you may be experiencing bandwidth limits set by Google. For more information, see Bandwidth limits.

To verify that the migration worked
  • 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.

  • 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.

To verify a successful mailbox migration to Office 365
  • Ask your migrated users to complete the following tasks:

    • Go to the Office 365 sign-in page, and sign in with your user name and temporary password.

    • Update your password, and set your time zone. It’s important that you select the correct time zone to make sure your calendar and email settings are correct.

    • When Outlook Web App opens, send an email message to another Office 365 user to verify that you can send email.

    • Choose Outlook, and check that your email messages and folders are all there.

Optional: Reduce email delays

Although this task is optional, doing it can help avoid delays in the receiving email in the new Office 365 mailboxes.

When people outside of your organization send you email, their email systems don’t double-check where to send that email every time. Instead, their systems save the location of your email system based on a setting in your DNS server known as a time-to-live (TTL). If you change the location of your email system before the TTL expires, the sender's email system tries to send email to the old location before figuring out that the location changed. This can result in a mail delivery delay. One way to avoid this is to lower the TTL that your DNS server gives to servers outside of your organization. This will make the other organizations refresh the location of your email system more often.

Most email systems ask for an update each hour if a short interval such as 3,600 seconds (one hour) is set. We recommend that you set the interval at least this low before you start the email migration. This setting allows all the systems that send you email enough time to process the change. Then, when you make the final switch over to Office 365, you can change the TTL back to a longer interval.

The place to change the TTL setting is on your email system’s mail exchanger record, also called an MX record. This lives in your public facing DNS. If you have more than one MX record, you need to change the value on each record to 3,600 seconds or less.

Don’t worry if you skip this task. It might take longer for email to start showing up in your new Office 365 mailboxes, but it will get there.

If you need some help configuring your DNS settings, see Create DNS records for Office 365 when you manage your DNS records.

Route Gmail directly to Office 365

Email systems use a DNS record called an MX record to figure out where to deliver email. During the email migration process, your MX record was pointing to your Gmail system. Now that you've completed your email migration to Office 365, it’s time to point your MX record to Office 365. After you change your MX record following these steps, email sent to users at your custom domain is delivered to Office 365 mailboxes

For many DNS providers, there are specific instructions to change your MX record, see Create DNS records for Office 365 when you manage your DNS records for instructions. If your DNS provider isn’t included, or if you want to get a sense of the general directions, general MX record instructions are provided as well. See Create DNS records at any DNS hosting provider for Office 365 for instructions.

To update your DNS records
  1. Sign in to Office 365 with your work or school account.

  2. Go to the Manage domains page.

  3. Select your domain and then choose Fix issues.

    The status shows Fix issues because you stopped the wizard partway through so you could migrate your Gmail email to Office 365 before switching your MX record.

    Domain that needs to be fixed.
  4. For each DNS record type that you need to add, choose What do I fix?, and follow the instructions to add the records for Office 365 services.

  5. After you've added all the records, you'll see a message that your domain is set up correctly: is set up correctly. No action is required.

It can take up to 72 hours for the email systems of your customers and partners to recognize the changed MX record. Wait at least 72 hours before you proceed to stopping synchronization with Gmail.

Stop synchronization with Gmail

During the last task, you updated the MX record for your domain. Now it’s time to verify that all email is being routed to Office 365. After verification, you can delete the migration batch and stop the synchronization between Gmail and Office 365. Before you take this step:

  • Make sure that your users are using Office 365 exclusively for email. After you delete the migration batch, email that is sent to Gmail mailboxes isn’t copied to Office 365 This means your users can’t get that email, so make sure that all users are on the new system.

  • Let the migration batch run for at least 72 hours before you delete it. This makes the following two things more likely:

    • Your Gmail mailboxes and Office 365 mailboxes have synchronized at least once (they synchronize once a day).

    • 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.

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.

To delete a migration batch
  1. In the Exchange admin center, go to Recipients > Migration.

  2. On the migration dashboard, select the batch, and then click Delete.

To confirm that the deletion worked
  • In the Exchange admin center, navigate to Recipients > Migration. Verify that the migration batch no longer is listed on the migration dashboard.

See Also

Migrate your IMAP mailboxes to Office 365

Ways to migrate email to Office 365

IMAP Migration Troubleshooter

Tips for optimizing IMAP migrations

Applies To: Office 365 Admin, Office 365 Small Business Admin

Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Change language