MSExchangeGuru.com

Learn Exchange the Guru way !!!

 

Exchange server 2016 / 2013 public folder – Batch migration

This article details the steps of performing a Public folder migration from legacy version of exchange to Exchange 2013 or Exchange 2016, depending upon the supportability matrix. We are going to use the new Batch migration process and not the old Serial migration process.

Let’s answer some of the questions I’ve been asked:

  1. Is this migration happening in real time and will users be not able to use PF’s during migration?

    No. This is not a real time migration of data. Exchange copies all data from legacy servers to the Exchange 2016 PF database. We will then pick a time and cutover Public folders to Exchange 2016

  2. Our public folders database is 500GB in size. I don’t want my PF database in Exchange 2016 to be that big. Can you help?

    Exchange 2013/2016 do not follow the traditional Public folder database model but data is stored in Public folder mailboxes. However, data is stored in an Exchange database in the backend and “Yes” you do have an option for creating multiple Public folder mailboxes on separate databases. I will address the process in this article

  3. Is there a roll back option available?

    Yes and it will be explained in this article

  4. Do I have to give a heads up to users prior to the migration?

    This is mainly a business decision. The way I like to do is to migrate all the data during the week and perform the cutover during the weekend. Yes, IMHO you do have to give a heads up to the users as depending upon the version of Outlook, it will force them to perform a restart of the Outlook client and their “Shortcuts” to the PF’s will be lost.

Let’s take a look at the steps involved in Public folder migration process:

  1. Pre-requisites for Migrating PF’s to Exchange 2013/2016
  2. Generate CSV files required to serve as input
  3. Create and configure Public folder mailboxes in Exchange 2016
  4. Start migration of Public folders to Exchange 2016
  5. Lock down Public folders on the old Exchange servers – Requires downtime
  6. Complete the Public folder migration process
  7. Unlock the migration and testing process
  8. Roll back migration
  9. Remove Public folder databases from legacy exchange servers

Let’s look at these steps one by one:

Pre-requisites for Migrating PF’s to Exchange 2013/2016

Open Outlook on a client machine and “Control+ Right Click on the Outlook icon on the taskbar” and hit “Connection Status”



As you can see Outlook is connecting to Exchange 2007 for Public folder information. This is for reference ONLY.

Let’s get rid of those whitespaces

If you have several servers hosting Public folders in you legacy exchange organization, please make sure they are all replicating well with each other.

Now, let’s look at one of the issues that could cause your “sync” job to fail while migrating data from legacy to the new Exchange Server 2016 public folders. The problem of “Trailing whitespaces” within Mail enabled Public folders. If this issue isn’t fixed prior to the migration, you will end up having a status message – “Sync with errors” or “Failed” in one of the Public folder mailboxes.

Login to the legacy Exchange server and open the Exchange management Shell:

Get-Publicfolder –ResultSize Unlimited | Measure-Object

Get-MailPublicfolder -ResultSize Unlimited | Measure-Object

The idea here is to make sure we don’t have any syntax errors in the Public folder naming convention. Not just that, the output for these cmdlets should be clean for a smooth transition/migration process

Say you received this message which means you have some Mail enabled PF’s with trailing whitespaces or comma in its Alias field.

To get the exact numbers:

Get-MailPublicFolder -Resultsize Unlimited | Where {$_.Alias -like “* *”} | measure-Object

Get-MailPublicFolder -Resultsize Unlimited | Where {$_.Alias -like “*,*”} | measure-Object

Get-MailPublicFolder -Resultsize Unlimited | Where {$_.Alias -like “*, *”} | measure-Object

To fix this, either do a search for Fix-Alias.ps1 or simply run these cmdlets

Get-Mailpublicfolder | Where {$_.Alias -like “*,*”} | ForEach-Object {Set-mailpublicfolder $_.name -alias:($_.Alias -replace “,”,”_PF”)}

Get-Mailpublicfolder | Where {$_.Alias -like “* *”} | ForEach-Object {Set-mailpublicfolder $_.name -alias:($_.Alias -replace ” “,”_”)}

Get-Mailpublicfolder | Where {$_.Alias -like “*, *”} | ForEach-Object {Set-mailpublicfolder $_.name -alias:($_.Alias -replace “, “,”_”)}


Once the alias problems are fixed, run this cmdlet again

Get-MailPublicfolder -ResultSize Unlimited | measure-Object


That looks cleaner now!!!

Download the Public Folder migration Scripts from the Microsoft website, for the updated script, visit the TechNet link:

https://technet.microsoft.com/en-us/library/dn912663(v=exchg.160).aspx

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


Now, let’s switch to data collection mode. We need a snapshot of 3 key attributes from the existing PF environment:

  1. Public folder hierarchy and Folder structure
  2. Public folder statistics like number of items, Folder and item size, owner details etc
  3. Permissions assigned on Public folder so the migrated PF’s will have the same permissions as legacy PF’s

Let’s create a Folder and call it PFScripts and navigate to that directory in Exchange 2007/2010 server:

Now run these cmdlets,

Get-PublicFolder -Recurse | Export-CliXML C:PFScriptsLegacy_PFStructure.xml

Get-PublicFolderStatistics | Export-CliXML C”PFScriptsLegacy_PFStatistics.xml

Get-PublicFolder -Recurse | Get-PublicFolderClientPermission | Select-Object Identity,User -ExpandProperty AccessRights | Export-CliXML C:PFScriptsLegacy_PFPerms.xml

Now we need to get rid of all PF’s with a in their name:

Get-PublicFolderStatistics -ResultSize Unlimited | Where {$_.Name -like "**"} | Format-List Name, Identity
In the event any PF's are returned, simply run the following cmdlet:
Set-PublicFolder -Identity <PF identity> -Name <New PF Name>
Now let's made sure we don't have any record of a previous migration:
Get-OrganizationConfig | Format-List PublicFoldersLockedforMigration, PublicFolderMigrationComplete
If it is found True, then run:

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

On Exchange 2016, run these cmdlets:

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

The following will discover any existing batch migration requests.
 

$batch = Get-MigrationBatch | ?{$_.MigrationType.ToString() -eq “PublicFolder”}

The following removes any existing public folder batch migration requests.

$batch | Remove-MigrationBatch -Confirm:$false

On Exchange 2016, run these cmdlets to find and remove any PF’s

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

Generate CSV files required to serve as input

We need to navigate to the location where the PF scripts are downloaded and generate CSV files which will be used for the migration process

.Export-PublicFolderStatistics.ps1 "C:PFScriptsPFStats.csv" "LegacyPFServerName"
This is going to create a Folder to Size Stats file. I renamed the target mailbox to PFMailbox1


NOTE: The next step is very important. As mentioned in the Q&A, now we need to make the decision as to how many PF mailboxes you require in your Organization
This depends on the next CMDLet we will be running:
.PublicFolderToMailboxMapGenerator.ps1 9000000000 "C:PFScriptsPFStats.csv" "C:PFScriptsPublicFolderTOMailbox.csv"
If you use 9000000000 as the value, it's going to create an PF mailbox to which all Public folder info is going to get migrated. My client had a specific requirement to split the content in several databases.
So, you need to figure out the right size to be specified in this cmdlet. I am not going to tell you what value to use here but start with a number you think is ideal and keep incrementing it till you have achieved the required number of Public folder mailboxes.
In my case this was the output I was looking for which is 4 PF mailboxes – PFMailbox1, PFMailbox2, PFMailbox3 and PFMailbox4


Create and configure Public folder mailboxes in Exchange 2016

Now that we have the PublicFolderTOMailbox mapping file lets create the Public folder mailboxes:

New-Mailbox -PublicFolder PFMailbox1 -HoldForMigration:$true

New-Mailbox -PublicFolder PFMailbox2 -HoldForMigration:$true

New-Mailbox -PublicFolder PFMailbox3 -HoldForMigration:$true

New-Mailbox -PublicFolder PFMailbox4 -HoldForMigration:$true

Start migration of Public folders to Exchange 2016

On Exchange 2016/2013 Open EMS and navigate to:

“C:Program FilesMicrosoftExchange ServerV15scripts” or $exscripts

Similar to mailbox migration, we need to create a Public folder migration Batch:

New-MigrationBatch -Name PFMigration -SourcePublicFolderDatabase (Get-PublicFolderDatabase -Server LEGACYServerName) -CSVData (Get-Content “C:PFScriptsPublicFolderTOMailbox.csv” -Encoding Byte) -NotificationEmails Ratish@Domain.com

Now, let’s set some value as follows (This is optional and take informed decision since you may have to inspect those Large items yourself and perhaps copy them to a PST file.)

Set-MigrationBatch PFMigration -LargeItemLimit 100 -Baditemlimit 50

Now, Start the migration Batch

Start-MigrationBatch PFMigration

Now – LET’s wait!!!

Keep running the following cmdlets periodically to query the status:

Get-MigrationBatch PFMigration

Get-MigrationUser -BatchId PFMigration


You may also see the progress from Exchange Administration Center:



In my case, I had 2 failures which is already addressed in this tutorial:

Get-MigrationUser -BatchId PFMigration shows the status of “Failed”


Upon troubleshooting this I saw the root cause for the behavior was:

PFMailbox1 – Trailing whitespaces in alias field

PFMailbox2 – 3 items failed with “LargeItem” error. We already dealt how to deal with trailing whitespaces in Alias field in point 1. To mitigate the large item issue, we can set the migration batch to bypass LargeItems and Start the migration again. NOTE – This is a workaround. You may have to inspect those Large items yourself and perhaps copy them to a PST file.

[PS] C:Program FilesMicrosoftExchange ServerV15scripts>Set-MigrationBatch PFMigration -LargeItemLimit 100 -Baditemlimit 50

[PS] C:Program FilesMicrosoftExchange ServerV15scripts>Start-MigrationBatch PFMigration

[PS] C:Program FilesMicrosoftExchange ServerV15scripts>Get-MigrationUser -BatchId PFMigration


Get-MigrationUser -BatchId PFMigration is now in Queued State


Get-MigrationUser -BatchId PFMigration


All Public folders are now showing up as Synced.

Lock down Public folders on the old Exchange servers – Requires downtime

NOTE: This steps REQUIRES DOWNTIME so please PLAN accordingly via Change management team

On the legacy Exchange server, run the cmdlet:

Set-OrganizationConfig –PublicFoldersLockedForMigration:$true

Complete the Public folder migration process

Set-OrganizationConfig -PublicFoldersEnabled Remote
Complete-MigrationBatch PFMigration
The second cmdlet might show an error since it might take a while for replication to complete from legacy server
Once the PFMigration batch is completed, let's proceed with testing

Unlock the migration and testing process

I’m going to cutover my mailbox:

Set-Mailbox ratish -DefaultPublicFolderMailbox PFMailbox1

Restart Outlook and try accessing the PF’s. Additionally, check Outlook Connection Status and ensure it is not pointing to the Legacy Server:



Once you are convinced that PF access works for at least 5 users, proceed with the cutover for all users:

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

This will cutover all users to the 4 newly created Public folder mailboxes

Now run the cmdlet from Legacy Server to complete Migration:

Set-OrganizationConfig -PublicFolderMigrationComplete:$true

Run this cmdlet from Exchange 2013/2016 to complete the migration

Set-OrganizationConfig -PublicFoldersEnabled Local

Now setup Limits on the PF mailboxes to a value of your choice:

Get-Mailbox -Publicfolder | Set-Mailbox -PublicFolder -ProhibitSendReceiveQuota Unlimited

Get-Mailbox -Publicfolder | Set-Mailbox -PublicFolder -ProhibitSendQuota Unlimited

Get-Mailbox -Publicfolder | Set-Mailbox -PublicFolder -IssueWarningQuota Unlimited

Roll back migration

On the legacy Exchange server, run the following command to unlock the legacy Exchange public folders

Set-OrganizationConfig -PublicFoldersLockedForMigration:$False

On the Exchange 2016 server, run the following commands to remove the public folder mailboxes]

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

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

On the legacy Exchange server, run the following command to set the PublicFolderMigrationComplete flag to $false.

Set-OrganizationConfig -PublicFolderMigrationComplete:$False

Remove Public folder databases from legacy exchange servers

If the migration was successful and it was the last step in decommissioning the Legacy server, I recommend that you shutdown the server for a week and then proceed with gracefully uninstalling Exchange 2007/2010.

Ratish Nair

Microsoft MVP | Exchange Server

Team @MSExchangeGuru.com

6 Responses to “Exchange server 2016 / 2013 public folder – Batch migration”

  1. Alexander Says:

    Hello!
    I cannot find a recipe how to migrate public folders from 2010 to 2016 in case that public folder contents located in many databases on multiple servers that resides in multiple AD sites.. Microsoft’s technet article (https://technet.microsoft.com/en-us/library/mt463355(v=exchg.150).aspx) assumes that all public folders located in single database… They suggest to enter cmdlet new-migrationbatch and use parameter -sourcepublicfolderdatabase. Is somebody tried to migrate PFs from multiple databases? I’m absolutely confused and any help will be appreciated.

  2. Prabhat Nigam Says:

    Did you test our Public Folden migration blog and videos on youtube channel?

  3. Phuong, nguyen Van Says:

    Dear Ratish Nair

    My organization does not have to use public folders. So I can remove public folder exchange 2010 instead of having to migrate. So what effect does exchange 2016 ?
    Many Thanks

  4. Prabhat Nigam Says:

    Yes, remove it. No issues

  5. Dale Meyer Says:

    I have attempted this migration several times from an exchange 2010 to a 2016 and all migrations succeed but I cannot access the public folders from the outlook client. Also the public folders don’t show up in the 2016 EMC. Outlook says “The set of folders cannot be opened. Network problems are preventing connection to Microsoft Exchange.”

    Not when I set the 2010 server back to the way it was before, the non-test accounts don’t see the old public folders. Does it take a while for this to change back?

  6. Prabhat Nigam Says:

    I would highly recommend to use Golden Five Consulting to help you out.

Leave a Reply

Categories

Archives

MSExchangeGuru.com