MIGRATE EXCHANGE SERVICES TO 2016 PART 7 – PUBLIC FOLDER #EXCHANGE #WINDOWSSERVER #STEP BY STEP

There is no more legacy public folder database, public folder mailboxes also knows as modern public folders, if you still need public folders, migrate them to Exchange 2016.

Public folder migration is a one-way process, if something goes wrong, you can roll back but any changes made since the migration will be lost.

  1. Login Exchange 2010 Server
  2. Download all scripts and supporting files from following link and save to c:\post-install\pfscripts.

    https://www.microsoft.com/en-us/download/details.aspx?id=38407

  3. Open Exchange Management Shell.
  4. Run the following command to take a snapshot of the original source public folder structure.
    
    
    Get-PublicFolder -Recurse | Export-CliXML C:\Post-Install\PFMigration\Legacy_PFStructure.xml
    
    
    

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


Get-PublicFolderStatistics | Export-CliXML C:\Post-Install\PFMigration\Legacy_PFStatistics.xml


6. Run the following command to take a snapshot of the permissions.


Get-PublicFolder -Recurse | Get-PublicFolderClientPermission | Select-Object Identity,User -ExpandProperty AccessRights | Export-CliXML C:\Post-Install\PFMigration\Legacy_PFPerms.xml


7. If the name of a public folder contains a backslash \, the public folders will be created in the parent public folder when migration occurs. Before you migrate, we recommend that you rename any public folders that have a backslash in the name.
Run the following command to locate public folders that have a backslash in the name.



Get-PublicFolderStatistics -ResultSize Unlimited | Where {$_.Name -like "*\*"}  | Format-List Name, Identity


8. If any public folders are returned, you can rename them by running the following command.


Set-PublicFolder -Identity <public folder identity> -Name <new public folder name>


9. To make sure there isn’t a previous record of a successful migration, run following cmdlet to check the public folder migration status.


Get-OrganizationConfig | Format-List PublicFoldersLockedforMigration, PublicFolderMigrationComplete


10. If the status of the PublicFoldersLockedforMigration or PublicFolderMigrationComplete properties is $true, run the following command to set the value to $false.


Set-OrganizationConfig -PublicFoldersLockedforMigration:$false -PublicFolderMigrationComplete:$false


11. Login to Exchange 2016 server.

12. Open Exchange Management Shell.

13. Run the following command to discover any existing serial migration requests.


Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics -IncludeReport | Format-List


14. Run the following command to removes any existing public folder serial migration requests.


Get-PublicFolderMigrationRequest | Remove-PublicFolderMigrationRequest


15. Run the following command to discover any existing batch migration requests.


Get-MigrationBatch | where {$_.MigrationType.ToString() -eq "PublicFolder"}


16. Run the following command to remove any existing batch migration requests.


$batch = Get-MigrationBatch | where {$_.MigrationType.ToString() -eq "PublicFolder"}


$batch | Remove-MigrationBatch -Confirm:$false


17. Run the following command to make sure no public folder mailboxes exist on the exchange 2016 server.


Get-Mailbox -PublicFolder


18. If the command returned any public folders, run the following command to see if any public folders exist


Get-PublicFolder


19. If you have any public folders, run the following commands to remove them. Make sure you’ve saved any information that was in the public folders.


Get-Mailbox -PublicFolder | Where{$_.IsRootPublicFolderMailbox -eq $false} | Remove-Mailbox -PublicFolder -Force -Confirm:$false


Get-Mailbox -PublicFolder | Remove-Mailbox -PublicFolder -Force -Confirm:$false


20. Login to Exchange 2010 Server.

21. Open Exchange Management Shell as local administrator

22. Run the Export-PublicFolderStatistics.ps1 script to create the folder name-to-folder size mapping csv file.


.\Export-PublicFolderStatistics.ps1 C:\Post-Install\PFMigration\PFSizeMap.csv GDMEX01.gooddealmart.ca


23. Run the PublicFolderToMailboxMapGenerator.ps1 script to create the public folder-to-mailbox mapping file. This file is used to calculate the correct number of public folder mailboxes on the Exchange 2016 Mailbox server.


.\PublicFolderToMailboxMapGenerator.ps1 20000000000 C:\Post-Install\PFMigration\PFSizeMap.csv C:\Post-Install\PFMigration\PFMailboxMap.csv


Note:

Maximum mailbox size in bytes = 20000000000, the value 20000000000 is used to represent 20 GB

Folder to size map path = C:\Post-Install\PFMigration\PFSizeMap.csv

Folder to mailbox map path = C:\Post-Install\PFMigration\PFMailboxMap.csv

24. Open PFMailboxMap.csv file and change “Mailbox1” to “PFMailbox1” and then save.

25. Copy C:\Post-Install\pfscripts and C:\Post-Install\PFMigration folders from exchange 2010 server to exchange 2016 server.

26. Login to Exchange 2016 server.

27. Copy PFMailboxMap.csv and PFSizeMap.csv files from C:\Post-Install\PFMigration to C:\Post-Install\pfscripts folder.

28. Open Exchange Management Shell.

29. Run the following command to create the target public folder mailboxes.


<a name="OLE_LINK39"></a>.\Create-PublicFolderMailboxesForMigration.ps1 -FolderMappingCsv PFMailboxMap.csv -EstimatedNumberOfConcurrentUsers:200


30.

Run the following command to create the migration batch.


<a name="OLE_LINK51"></a>New-MigrationBatch -Name PFMigration -SourcePublicFolderDatabase (Get-PublicFolderDatabase -Server GDMEX01) -CSVData (Get-Content C:\Post-Install\PFMigration\PFMailboxMAP.csv -Encoding Byte) -NotificationEmails <a href="mailto:csun@gooddealmart.ca"><span style="font-family: Cambria; font-size: 12pt;">csun@gooddealmart.ca</span></a>
			

31. Run the following command to start the migration.


<a name="OLE_LINK55"></a>Start-MigrationBatch PFMigration


32. Open Exchange Admin Center and click recipients and then select migration, you will see the PFMigration batch status change to Syncing now.

 

33. Once InitialSync is complete, the status will show Synced.

 

34. We are going to lock and complete the public folder for migration (downtime required)

35. Login to Exchange 2010 Server.

36. Open Exchange Management Shell as local administrator

37. Run the following command to lock the legacy public folders for finalization.

 

Set-OrganizationConfig -PublicFoldersLockedForMigration:$true


38. Login to Exchange 2016 Server.

39. Open the Exchange Management Shell on your Exchange 2016 server.

40. Run the following command to change the Exchange 2016 deployment type to Remote.


Set-OrganizationConfig -PublicFoldersEnabled Remote



41. Run the following command to complete the public folder migration.


Complete-MigrationBatch PFMigration



42. If the final synchronization is successful, the public folders on the Exchange 2016 server will be unlocked and the status of the migration batch will change to Completing, and then Completed.

43. Run the following command to assign some test mailboxes to use any newly migrated public folder mailbox as the default public folder mailbox.


Set-Mailbox -Identity GDMUSER2 -DefaultPublicFolderMailbox PFMailbox1


44. If everything looks okay, run the following command to unlock the public folders for all other users.


Get-Mailbox -PublicFolder | Set-Mailbox -PublicFolder -IsExcludedFromServingHierarchy $false



45. Login to Exchange 2010 Server.

46. Open Exchange Management Shell as local administrator.

47. Run the following command to indicate that the public folder migration is complete.


Set-OrganizationConfig -PublicFolderMigrationComplete:$true



48. Login to Exchange 2016 Server.

49. Open the Exchange Management Shell on your Exchange 2016 server.

50. Run the following command on the Exchange 2016 server.


Set-OrganizationConfig -PublicFoldersEnabled Local



51. Run following command on the Exchange 2016 and compare files contents with previously files and verify success.

 

Get-PublicFolder -Recurse | Export-CliXML C:\Post-Install\PFMigration\EX2016_PFStructure.xml
Get-PublicFolderStatistics -ResultSize Unlimited | Export-CliXML C:\Post-Install\PFMigration\Ex2016_PFStatistics.xml
Get-PublicFolder -Recurse | Get-PublicFolderClientPermission | Select-Object Identity,User -ExpandProperty AccessRights | Export-CliXML  C:\Post-Install\PFMigration\Ex2016_PFPerms.xml


Hope you enjoy this post.

Cary Sun

Twitter: @SifuSun

About Post Author

Leave a Reply