Home > Perform Gmail Migrations > Prepare for Migrations

Export to PDF

Prepare for Migrations

Before performing Gmail Migrations in Fly, follow the instructions below to prepare for the migration:

  1. Gmail Migration requires the availability of Exchange PowerShell when migrating Google groups to distribution groups/mail-enabled security groups, and creating shared mailboxes and resource mailboxes in the destination. Make sure that Exchange PowerShell is available in the destination before the migrations.

  2. Make sure the allowed item size of destination mailboxes is sufficient for the migration.

  3. Fly does not automatically provision new users in Microsoft 365. Make sure the destination users already exist before the migration.

    *Note: When the destination is a Microsoft 365 Multi-Geo tenant, and you want to provision a mailbox for a user in a specific location, you need to set the preferred data location for the user. Then, after the license is assigned to the user, the mailbox will be provisioned in the user’s preferred data location.

    There are different ways to add new Microsoft 365 users:

Synchronize users via Microsoft Entra Cloud Sync

Before synchronizing users, you need to complete the prerequisites for Microsoft Entra cloud synchronization and install the Microsoft Entra Cloud. Refer to and for details.

Then, you can refer to the following sections to synchronize users.

Configure Microsoft Entra Cloud Sync

Refer to to configure Microsoft Entra Cloud Sync for provisioning from Active Directory to Microsoft Entra ID.

Configure Attribute Mapping

Refer to the following steps to map attributes between your on-premises user or group objects and the objects in Microsoft Entra ID:

  1. Log in to Microsoft Entra admin center (or Azure portal) and navigate to Microsoft Entra ID.

  2. Click Microsoft Entra Connect in the left panel. The Get started page appears.

  3. On the Get started page, click Cloud Sync in the left panel. The Configurations page appears.

  4. Click the desired configuration and click Attribute mapping in the left panel.

  5. Search MSExchMailboxGuid under the Users / InetOrgPersons tab.

  6. Click the Edit attribute mapping (Edit attribute mapping button.) button. The Edit attribute mappings page appears.

  7. Select Expression from the Mapping type drop-down list, enter "" in the Expression text box, and click Apply.

  8. Edit attribute mappings page.

  9. Check to make sure the source attribute of MSExchMailboxGuid is empty.

  10. Attribute mapping page.

Configure Scoping Filters

Refer to the following steps to configure a scoping filter to define the synchronization scope:

  1. Log in to Microsoft Entra admin center (or Azure portal) and navigate to Microsoft Entra ID.

  2. Click Microsoft Entra Connect in the left panel. The Get started page appears.

  3. On the Get started page, click Cloud Sync in the left panel. The Configurations page appears.

  4. Click the desired configuration and click Scoping filters in the left panel.

  5. Select the synchronization scope. If you select Selected security groups or Selected organizational units, enter the corresponding distinguished name in the text box. To get the distinguished name of a security group or organizational unit, refer to the Get the Distinguished Name using Windows PowerShell section below.

  6. Click Add to add the distinguished name and click Save to save the scoping filters.

Get Distinguished Names using Windows PowerShell

Refer to the following instructions to get the distinguished name of a security group or organizational unit:

- **Security groups** – Open Windows PowerShell, and enter the following command: `Get- ADGroup -Identity "sync user" | Format-Table Name, DistinguishedName -A` Replace **sync user** with the display name of the group and press **Enter** on the keyboard. ![Distinguished name of a security group.](/en/fly-user-guide/perform-gmail-migrations/images/image515.png "Distinguished name of a security group.") - **Organizational units** – – Open Windows PowerShell, enter the following command window: `Get- ADOrganizationalUnit -Filter 'Name -like "OU1"' | Format-Table Name, DistinguishedName -A` Replace **OU1** with the display name of the organization unit and press **Enter** on the keyboard. ![Distinguished name of an organizational unit.](/en/fly-user-guide/perform-gmail-migrations/images/image516.png "Distinguished name of an organizational unit.")

On-demand Provisioning (Optional)

Refer to to check whether users in the synchronization scope can be correctly synchronized to Microsoft Entra ID.

To get the distinguished name of a user, open Windows PowerShell and enter the following command:

Get- ADUser -Identity "Kuser1" | Format-Table Name, DistinguishedName -A

Replace Kuser1 with the display name of the user and press Enter on the keyboard.

Distinguished name of a user.

Synchronize Users

Refer to to synchronize users. Then, you can check the sync status of users in Microsoft 365 admin center > Users > Active users. After assigning Exchange Online license to the user, the mailbox of the user will be automatically initialized.

Sync status.

Synchronize users via Microsoft Entra Sync or Microsoft Entra Connect

Refer to the following sections to synchronize users from local Active Directory to Microsoft 365 via Microsoft Entra Sync or Microsoft Entra connect:

Synchronize All Users

Refer to the following steps to synchronize all users:

  1. Install Microsoft Entra Sync or Microsoft Entra Connect (if you need support for federation).

    *Note: Make sure msExchMailboxGuid is set to Null before the synchronization. Only after you change the msExchMailboxGuid attribute value can a user mailbox be created when an Exchange license is assigned.

    To set the msExchMailboxGuid to Null, complete the following steps. Note that the following steps will synchronize all users from the local Active Directory to Microsoft 365. If you only want to synchronize a part of the users to Microsoft 365, refer to Set a Filter Rule and Synchronize Included Users below to set a filter rule and only synchronize the users included in the filter rule.

    1. Run the Synchronization Rules Editor as an administrator.

    2. Select In from AD – User Exchange and click Edit.

      The Synchronization Rules Editor window

    3. In the pop-up window, click Yes to edit the current rule.

      The pop-up window

    4. In the Edit Inbound Synchronization Rule window, change the Precedence value to 1.

      The Precedence value in the Description group

    5. Select Transformations in the left pane, and find the msExchMailboxGuid attribute.

      The msExchMailboxGuid attribute

    6. Complete the following settings for the msExchMailboxGuid attribute:

      • Select Expression for the FlowType column.

      • Enter NULL for the Source column.

      • Select the Apply Once checkbox.

      • Select Update.

    7. Click Save to save the settings. The In from AD – User Exchange Cloned rule is automatically created, and the original In from AD – User Exchange rule is automatically disabled.

  2. Run Microsoft Entra Sync or Microsoft Entra Connect to synchronize users from the local Active Directory to Microsoft 365.

  3. After the synchronization, re-enable the original In from AD – User Exchange rule using the Synchronization Rules Editor. Refer to the following steps to re-enable the original In from AD – User Exchange rule:

    1. Run the Synchronization Rules Editor as an administrator.

    2. Select In from AD – User Exchange – Cloned and click Delete.

    3. In the pop-up window, click Yes to delete the current rule.

      The In from AD – User Exchange - Cloned rule

    4. Select the original In from AD – User Exchange rule and click Enable.

      The original In from AD – User Exchange rule

    5. Assign Exchange Online licenses to the users.

Set a Filter Rule and Synchronize Included Users

Refer to the following steps to set the filter rule and only synchronize the users included in the filter rule:

  1. In the Exchange Admin center, edit the mailbox whose user you want to synchronize, choose a custom attribute for the mailbox and specify a tag for the mailbox. For example, choose attribute 5 and enter FLYMigration as the tag.

    Enter FLYMigration.

    Repeat this step to add the custom attribute for more mailboxes.

    To add the custom attribute for mailboxes in bulk, you can also run PowerShell as an administrator, and configure the Set-Mailbox <email address> -customAttribute “attributevalue” command for each mailbox by defining the mailbox email address, custom attribute number, and custom attribute value. Refer to the screenshot below, for example:

    Example for configuring custom attribute

  2. Run the Synchronization Rules Editor as an administrator.

  3. Select In from AD – User Exchange and click Export to export the rule to a .txt file. Edit the file extension to change the .txt file to a .ps1 file.

    The Synchronization Rules Editor window

  4. Open the exported .ps1 file, customize the Name attribute, change the Precedence attribute value to equal or less than 100, and delete the identifier and ImmutableTag attributes.

  5. Run the exported .ps1 file with Windows PowerShell to create the rule in Synchronization Rules Editor.

  6. Select the newly created rule and click Edit.

  7. Select Scoping filter and click Add clause to add the filter condition. Choose the extensionAttribute5 under Attribute. Select EQUAL under Operator and enter FLYMigration as the attribute value.

    filter condition

    Repeat this step to add more filter conditions according to step a.

  8. Select Transformations in the left pane, and find the msExchMailboxGuid attribute.

    The msExchMailboxGuid attribute

  9. Complete the following settings for the msExchMailboxGuid attribute:

    • Select Expression for the FlowType column.

    • Enter NULL for the Source column.

    • Select the Apply Once checkbox.

    • Select Update.

  10. Click Save to save the settings.

  11. Select the original In from AD – User Exchange synchronization rule, and click Edit to edit the rule.

  12. In the pop-up window, click Yes to edit the rule.

    The pop-up window

    The In from AD – User Exchange Cloned rule is automatically created, and the original In from AD – User Exchange rule is automatically disabled.

  13. Select Scoping filter and click Add clause to add the filter condition. Choose the extensionAttribute5 under Attribute. Select NOTEQUAL under Operator and enter FLYMigration as the attribute value.

    filter condition

    Repeat this step to add more filter conditions according to step a.

  14. Click Save to save the settings.

  15. Run Microsoft Entra Sync or Microsoft Entra Connect to synchronize users from the local Active Directory to Microsoft 365. Only the mailbox users included in filter conditions are synchronized.

  16. After the synchronization, re-enable the original In from AD – User Exchange rule using the Synchronization Rules Editor. Refer to the following steps to re-enable the original In from AD – User Exchange rule:

    1. Run the Synchronization Rules Editor as an administrator.

    2. Select In from AD – User Exchange – Cloned and click Delete.

    3. In the pop-up window, click Yes to delete the current rule.

      The In from AD – User Exchange - Cloned rule

    4. Select the original In from AD – User Exchange rule and click Enable.

      The original In from AD – User Exchange rule

    5. Assign Exchange Online licenses to the users.