How to migrate public folders from Exchange Server to Microsoft 365

Migrating public folders from one Exchange Server version to another is not a difficult task if you’re migrating from Exchange 2013 to Exchange 2016/2019. However, if you want to migrate public folders from Exchange 2013, Exchange 2016, or Exchange 2019 to Microsoft 365, you need to ensure that you are on a version that is supported.

Here are the versions/cumulative update (CU) your environment needs to be on:

  • Exchange Server 2013 CU15 or higher
  • Exchange Server 2016 CU4 or higher
  • Exchange Server 2019 does not have any prerequisites when it comes to CU as all versions are supported, according to Microsoft.
Exchange-Server-hack-Shutterstock
Shutterstock

If you are running in coexistence mode (Exchange 2013 coexisting with Exchange 2016 or Exchange 2019), you need to ensure that Exchange 2013 is on CU15 as a minimum.

There are some other prerequisites or requirements you need to take note of for successful migration. These are:

  • Microsoft strongly suggests reviewing this document before attempting any migration.
  • If you have to upgrade Exchange 2013 or 2016 to a supported version, you need to prepare Active Directory. Otherwise, your migration process will fail.
  • You need to ensure that the account performing the upgrade is a member of the Organization Management Role Group in Exchange Online. The same applies to on-premises Exchange Server.
  • Check the size of your public folders. Anything more than 25GB will need to be cleared out. This limit applies only to the public folder.
  • Microsoft 365 allows you to create a maximum of 1,000 public folder mailboxes.
  • MRS proxy needs to be enabled on one of your Exchange 2013, Exchange 2016, or Exchange 2019 Servers.
  • Public folder migration can only be done by using the Exchange Management Shell.
  • You can only use an account that has basic authentication enabled and not an account that has MFA enabled as it is not supported.
  • You can perform the migration using a single batch. You cannot create multiple ones simultaneously in Exchange.

Migration steps (on-premises Exchange Server)

You need first to download all the migration scripts and supporting files from here for Exchange 2013, Exchange 2016, and Exchange 2019.

Note: We’re not providing the Exchange 2010 migration script URL. You can find this on the Microsoft Docs site.

Below is a description of all the scripts:

Note: These scripts are copied directly from the Microsoft Docs site.

  • ps1: Source Side Validation script scans the public folders at source and reports issues found, along with the actions required to fix the issues. You’ll run this script on the Exchange Server on-premises.
  • Sync-ModernMailPublicFolders.ps1: This script synchronizes mail-enabled public folder objects between your Exchange on-premises environment and Microsoft 365 or Office 365. You’ll run this script on an on-premises Exchange Server.
  • strings.psd1:This support file is used by the Sync-ModernMailPublicFolders.ps1 script and should be downloaded at the same location.
  • Export-ModernPublicFolderStatistics.ps1:This script creates the folder name-to-folder size and deleted item size mapping file. You’ll run this script on an on-premises Exchange Server.
  • Export-ModernPublicFolderStatistics.strings.psd1:This support file is used by the Export-ModernPublicFolderStatistics.ps1 script and should be downloaded at the same location.
  • ps1:This script creates the public folder-to-mailbox mapping file by using the output from the Export-ModernPublicFolderStatistics.ps1 script. You’ll run this script on an on-premises Exchange Server.
  • strings.psd1:This support file is used by the ModernPublicFolderToMailboxMapGenerator.ps1 script and should be downloaded at the same location.
  • ps1:This script updates the ExternalEmailAddress of mail-enabled public folders in your on-premises environment to that of their Exchange Online counterparts so that emails addressed to your mail-enabled public folders post-migration are properly routed to Exchange Online. You need to run this script on an on-premises Exchange Server.
  • strings.psd1:This support file is used by the Create-PublicFolderMailboxesForMigration.ps1 script and should be downloaded at the same location.

file systems

The next step is to prepare for the Exchange folders to Microsoft 365 migration. On your Exchange 2013, Exchange 2016, or Exchange 2019 Server, you need to perform the following tasks:

  • Check that migration public folders can receive messages by creating an accepted domain. Here is an example of the script:

New-AcceptedDomain -Name PublicFolderDestination_78c0b207_5ad2_4fee_8cb9_f373175b3f99 -DomainName <target domain> -DomainType InternalRelay

Note: In the above script, <target domain> is your domain.

  • If you want to check if the accepted domain is present, you can run the following command:

Get-AcceptedDomain | Where {$_.DomainName -eq "<target domain>"}

  • To check for any previous migrations and what is the status of these migrations, you can run the following command:

Get-OrganizationConfig | Format-List PublicFolderMailboxesLockedForNewConnections, PublicFolderMailboxesMigrationComplete

Once the migrations are complete, you need to run a few commands to verify that the migrations have completed successfully. Microsoft recommends running these on all your Exchange 2016 and Exchange 2019 Servers.

Note: Scripts and explanations are taken from Microsoft Docs to ensure accuracy and understanding.

Run the following command to take a snapshot of the original source folder structure:

Get-PublicFolder -Recurse -ResultSize Unlimited | Export-CliXML OnPrem_PFStructure.xml

Run the following command to take a snapshot of public folder statistics, such as item count, size, and owner:

Get-PublicFolderStatistics -ResultSize Unlimited | Export-CliXML OnPrem_PFStatistics.xml

Run the following command to take a snapshot of public folder permissions:

Get-PublicFolder -Recurse -ResultSize Unlimited | Get-PublicFolderClientPermission | Select-Object Identity,User,AccessRights -ExpandProperty AccessRights | Export-CliXML OnPrem_PFPerms.xml

Run the following command to take a snapshot of your mail-enabled public folders:

Get-MailPublicFolder -ResultSize Unlimited | Export-CliXML OnPrem_MEPF.xml

Save the files generated from the preceding commands at a safe place to make a comparison at the end of the migration.

Exchange folders to Microsoft 365: Prerequisites for Exchange Online

In Microsoft 365, you need to do a couple of checks, such as:

  • Check for existing migration requests. If you found any requests, you need to remove them.
  • Check if any public folder mailbox exists in Microsoft 365.

The next step is to generate .csv files. This can be used from the scripts you ran in the previous step.

After this, you need to create the public folder mailboxes in Microsoft 365. Once this is complete, you can start your migration request.

Once the above is complete, you need to lock down the public folders on your local Exchange 2013, Exchange 2016, or Exchange 2019 Servers.

When the above is complete, you can finalize your public folder migration. You can do so by running the following command:

Complete-MigrationBatch PublicFolderMigration

After the above step is complete, you can test public folders in Exchange Online.

The final step is to finalize the migration of public folders on your on-premises Exchange Servers.

When all testing is complete and you’re happy with the migration, you can remove the public folder mailboxes from your on-premises Exchange Servers.

Alternatively, you can use Stellar Converter for EDB for migrating public folders from one Exchange Server to another. It supports all Exchange Server versions.

Featured image: Designed by Rawpixel.com / Freepik

Leave a Comment

Your email address will not be published.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top