There are many articles in the field about migrating from on-premise Exchange to Office 365, but how about migrating from Google’s Gmail to Office 365?

There are several ways of migrating to Office 365, the most common way I have described in another article on my Blog HERE. Some of these solutions also work for a Google migration. However, in this article I want to present a way, which makes it really easy to handle this migration project:


Exporting Data from Gmail:

Here we need to open the Google Admin console with an Administrator Account. By Navigate to the Users page, we see a List of all Mailboxes in Gmail.

Here we need to export all Users E-Mail addresses, which has to be migrated to Office 365. I recommend you, to write down all E-Mail addresses to a Notepad File for later.


Import Users to O365 – We need to know:

There are different ways, how to create new users, one option is to make that user by user, or in our case, we can choose a bulk upload by CSV File.

NOTE: Before the MX-Records are not set to Office 365, the created mailboxes can only receive E-mails for other Mailboxes in the Office 365 Tennant.


Preparing Target:

Before we can start migrating, we need to be sure, that the target environment is ready for the data. That means we need to create first our Office 365 Mailboxes.

That means, for each User in Gmail, which we want to migrate to Office 365, we need to create a new Mailbox in Office 365.

To perform this I recommend you, to use PowerShell. Here is how the cmdlet could look for that:First, we need to get a CSV File for our small script. This CSV File needs the following information and Header shown as below:

That means as example:
DesmondMiles,Desmond,Miles,[email protected]

As second Step we need to set a variable for entering passwords. This is just one way how we can do that, we also can set an initial password for each user or however you want to do that for your project. To do that we need to run PowerShell and first we connect to our Office 365 Tenant. How to do that you can see HERE.

After the successful connection we need the following command:
$Password=Read-Host “Enter Password” –AsSecureString

Now we start creating all users from our CSV File by using the following command:

Import-CSV | ForEach {New-Mailbox -Name $ -firstname $_.firstname -lastname $_.lastname -userPrincipalName $_.userprincipalname -OrganizationalUnit Users -Password $Password}

After doing that, it is important to add the right License to the users.


Importing Mailbox Data (emails):

Now we need to create migration endpoints. This can be done in the Exchange online Admin center. This can be found in “Recipients” > “Migration”. Here we need to create a new endpoint by using the “+” sign and then “IMAP”. Google needs the following IMAP server information:

IMAP server:
Authentication: Basic
Encryption: SSL
Port: 993

In the next step, we can define some additional information, here my example:

After this step, we click on “new” and as we can see, the migration endpoint is set.

Before we start creating a migration Batch from the Exchange online console, we need to create a second CSV file with the following information:


To show an example again of the CSV file:

[email protected],[email protected],pass@word$

Note: Here the password has to match with the google ones and the one. If needed, we have to reset the passwords in the Google Admincenter for the migration. Here is it important, to inform the user that we have done that for migration reasons…

Now we are ready to migrate to Exchange online by using migration batch…
We click on “+” > “Migrate to Exchange online

Here we choose “IMAP migration

Here we come back now to our second CSV File, we click “Browse” to select the File:

After that we can name the migration Batch and make some further small settings. In the end, we click on “New” and the Batch will be queued for Email migration.


Importing Mailbox Data (contact and calendars)

After the Mail users and Mailboxes are created and migrated to Office 365, we still have some points open. One of them is to migrate E-Mail contacts. To do that the User has to go to his contacts in Gmail, in the List the user can click on “More” and choose “Export…”.

Here the User chooses the following settings:

Now the File can be saved on the User’s computer.

The User needs now to login to his Office 365 Account In the Web App the user can choose the option “People

After that the User go to Settings and clicks on “Import Contacts

Now the exported CSV File can be selected:

Now the Import will start to “My Contacts”.


Import Calendars:

After we have migrated the Mailbox and the users has migrated their personal contacts, we need now to show the user, how he can import the calendar items.

For that, the user has to go to his Gmail calendar, then the user need to click on “Settings” and then again “Settings”.

Now the user moves to “Calendars” and clicks on export. The calendar will now be saved as a ZIP file.

For importing user calendars, the user has to use his Outlook Client.
Here he will navigate to “File” > “Open&Export” > “Import/Export”.

Now it has to be chosen: “Import an iCalendar

Now the File has to be chosen and after the Import will be imported.


Preparing DNS:

After all is migrated, we need to change our MX-Records, how doing that, I have described in another article which you can find HERE.