Unfortunately, the process of migrating Public Folders is complicated. Luckily, if you are migrating from Exchange 2013 or Exchange 2016, then Microsoft has made things a bit easier for you, but it is still going to be a little bit tricker and more complicated to migrate Public Folders to Office 365.
So, here in this blog, we will discuss how to migrate Public folders from Exchange 2013 or Exchange 2016 to Office 365. But before we get onto the migration, we need to ensure that we hit the following migration prerequisites:
The process to migrate Public Folders to Office 365 can be broken down into the following steps:
Download all of the following scripts - https://www.microsoft.com/en-us/download/details.aspx?id=54855
I recommend saving them all in a folder called C:\PFScripts to make following this article easier.
Only the following versions of the Exchange server are supported by these scripts
Get-PublicFolder -Recurse -ResultSize Unlimited | Where {$_.Name -like "*\*" -or $_.Name -like "*/*"} | Format-List Name, Identity, EntryId
Get-OrganizationConfig | Format-List PublicFoldersLockedforMigration,
PublicFolderMigrationComplete,
PublicFolderMailboxesLockedForNewConnections,
PublicFolderMailboxesMigrationComplete
Set-OrganizationConfig -PublicFoldersLockedforMigration:$false -
PublicFolderMigrationComplete:$false -
PublicFolderMailboxesLockedForNewConnections:$false -
PublicFolderMailboxesMigrationComplete:$false
Get-PublicFolder -Recurse -ResultSize Unlimited | Export-CliXML OnPrem_PFStructure.xml
Get-PublicFolderStatistics -ResultSize Unlimited | Export-CliXML OnPrem_PFStatistics.xml
Get-PublicFolder -Recurse -ResultSize Unlimited | Get-PublicFolderClientPermission | Select-Object Identity,User -ExpandProperty AccessRights | Export-CliXML OnPrem_PFPerms.xml
Get-MailPublicFolder -ResultSize Unlimited | Export-CliXML OnPrem_MEPF.xml
Open an Exchange Online Shell, connect to Exchange Online, and then do the following:
Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics
Get-MigrationBatch | ?{$_.MigrationType.ToString() -eq "PublicFolder"}
Open Exchange PowerShell on your local Exchange server, change the directory to C:\PFScripts run the following commands
.\Export-ModernPublicFolderStatistics.ps1 PublicFolderstats.csv
.\ModernPublicFolderToMailboxMapGenerator.ps1 -MailboxSize 25GB -MailboxRecoverableItemSize 1GB -ImportFile .\publicfolderstats.csv -ExportFile C:\PFMigration\map.csv
If you’ve previously done Exchange 2007 or 2010 Public folder migrations, you'll be relieved to learn you only need to generate these two files.
In Exchange Online, mailboxes act as the backbone for the Public Folder storage, and we need to create these mailboxes before we can create public folders. Connect to Exchange Online PowerShell and run this script:
$mappings = Import-Csv C:\PFMigration\map.csv
$primaryMailboxName = ($mappings | Where-Object FolderPath -eq "\" ).TargetMailbox
New-Mailbox -HoldForMigration:$true -PublicFolder -IsExcludedFromServingHierarchy:$false
$primaryMailboxName
($mappings | Where-Object TargetMailbox -ne $primaryMailboxName).TargetMailbox | Sort-
Object -unique | ForEach-Object { New-Mailbox -PublicFolder
-IsExcludedFromServingHierarchy:$false $_ }
It’s time to get the migration started! From your Local Exchange Server, open Exchange Shell, change the directory to C:\PFscripts, and run the following command
.\Sync-ModernMailPublicFolders.ps1 -Credential (Get-Credential) -CsvSummaryFile:sync_summary.csv
When prompted, enter the login details for your Exchange Online admin account.
Now switch to Exchange Online PowerShell and do the following,
$Source_Credential = Get-Credential domain\exchangeadmin
(replacing the domain \ user name with your own)
$Source_RemoteServer = "server.domain.com"
(replacing the server name with the name of your MRS Proxy Server)
PfEndpoint = New-MigrationEndpoint -PublicFolder -Name PublicFolderEndpoint
-RemoteServer $Source_RemoteServer -Credentials $Source_Credential
[byte[]]$bytes = Get-Content -Encoding Byte C:\PFMigration\map.csv
New-MigrationBatch -Name PublicFolderMigration -CSVData $bytes -SourceEndpoint
$PfEndpoint.Identity -NotificationEmails email@domain.com
Start-MigrationBatch PublicFolderMigration
Now, we need to stop people using the existing on-premises public folders from being able to access them. To do this, open Exchange Shell on any of your Exchange servers
Set-OrganizationConfig -PublicFolderMailboxesLockedForNewConnections $true
It can take up to 2 hours to replicate and take effect for all users.
Connect to Exchange Online PowerShell and run this command
Complete-MigrationBatch PublicFolderMigration
Before unlocking the new public folders for all users, I would recommend testing that the migration has been completed successfully. To do this, assign yourself or some test users access to the new public folders
Set-Mailbox -Identity <test user> -DefaultPublicFolderMailbox <public folder mailbox identity>
Once you have confirmed everything looks ok, you can unlock the public folders for all users
Set-OrganizationConfig -RemotePublicFolderMailboxes $Null -PublicFoldersEnabled Local
Finally, run the following two commands on your local Exchange server
.\SetMailPublicFolderExternalAddress.ps1 -ExecutionSummaryFile:mepf_summary.csv
Set-OrganizationConfig -PublicFolderMailboxesMigrationComplete:$true -PublicFoldersEnabled Remote
And that’s it; you are finally done! If you want an easier route to migrate Public Folders to Office 365, consider trying an automated tool which we discussed below:
If you are looking for a quick and hassle-free method to migrate public folders to Office 365, then you must try Exchange Migration tool, which is a perfect choice to migrate public folders to any desired destination. The tool migrates public folders to Office 365 along with all its permissions and limits. Before starting the migration, it lets you run a pre-migration analysis and understand the time required for the migration. It also provides an option to undo the migration process if it is interrupted midway due to any situation.
Within minutes, the migration of Exchange public folders to Office 365 is finished and the migration status is shown.
Thus, you can perform migration of Exchange and Office 365 swiftly using Kernel Migration for Exchange.
As you can see from the above discussion, the manual process is lengthy and complicated. It will take a lot of time to complete and not be 100% error-free. So, as an alternative, you can try an advanced third-party tool named Kernel Migration for Exchange. It can securely migrate Public folders to Office 365 with complete data integrity. The tool supports all versions of Exchange Server, Exchange Online, and Hosted Exchange. You can download its free trial version to learn more about the tool.