Monday, May 26, 2014

How to move Public Folders from Exchange 2010 to Exchange 2013

This is my write up on moving public folders from 2010 to 2013.

From the Exchange 2010 server, run the following
     Get-PublicFolder –Recurse | ConvertTo-CSV >C:\Exchange2010-PFStructure.csv
     Get-PublicFolder -Recurse | Get-PublicFolderStatistics | ConvertTo-Csv >C:\Exchange2010-PFStatistics.csv
     Get-PublicFolder -GetChildren | Get-PublicFolderClientPermission | Select-Object Identity,User -ExpandProperty AccessRights | ConvertTo-CSV >C:\Exchange2010-PFPermissions.csv

From the Exchange 2010 server, make sure PublicFoldersLockedForMigration and PublicFolderMigrationComplete is set to False
     Get-OrganizationConfig  | fl *Migration*
If this parameter is set to True , Run the below command to Change it to False
     Set-OrganizationConfig -PublicFoldersLockedforMigration:$false -PublicFolderMigrationComplete:$false

From the Exchange 2013 server, make sure there is no PublicFolderMigrationRequest and PublicFolder Mailbox
     Get-PublicFolderMigrationRequest

     Get-Mailbox -PublicFolder

Copy the following files to from the Exchange 20130 Scripts folder (C:\Program Files\Microsoft\Exchange Server\V15\Scripts) to the Exchange 2010 Scripts Folder (C:\Program Files\Microsoft\Exchange Server\V14\Scripts)
     Export-PublicFolderStatistics.strings
     Export-PublicFolderStatistics
     PublicFolderToMailboxMapGenerator.strings
     PublicFolderToMailboxMapGenerator


On the Exchange 2010 server, open the Exchange Management Shell and navigate to C:\Program Files\Microsoft\Exchange Server\V14\Scripts, create the folder C:\PFMigration and run the following scripts-
     .\PublicFolderToMailboxMapGenerator.ps1 -MailboxSize 5000000000 -ImportFile C:\PFMigration\Exchange2010-PFtoSize.csv -ExportFile C:\PFMigration\Exchange2010-PFtoMailbox.csv

Open file C:\PFMigration\Exchange2010-PFtoMailbox.csv with notepad, change the PF Mailbox name to one you wish (PFMailbox)

Copy the C:\PFMigration folder and the CSV from your Exchange 2010 Server to your Exchange 2013 Server.

On the Exchange 2013 Server, create your Public Folder Migration Request.  If required you can add the parameters -AcceptLargeDataLoss –BadItemLimit 
     New-PublicFolderMigrationRequest -SourceDatabase (Get-PublicFolderDatabase –Server EXCH2010) -CSVData (Get-Content C:\PFMigration\Exchange2010-PFtoMailbox.csv -Encoding Byte)

Check the status of migration request.
     Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics -IncludeRepor

When it fails, use this command to find out why-
     Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics -IncludeReport | FL

You might see this, it means you have mail enabled folders that have a space in the alias field or a space before or after the alias.  Go to the public folder manager, go to the peoperties of the mail enabled public folder listed and change the alias to have no spaces.
"Error: Property expression "B list" isn't valid. Valid values are: Strings formed
with characters from A to Z (uppercase or lowercase), digits from 0 to 9, !, #, $,
%, &, ', *, +, -, /, =, ?, ^, _, `, {, |, } or ~. One or more periods may be
embedded in an alias, but each period should be preceded and followed by at least
one of the other characters. Unicode characters from U+00A1 to U+00FF are also
valid in an alias, but they will be mapped to a best-fit US-ASCII string in the
e-mail address, which is generated from such an alias."

Once you fixed this, resume the migration-
     Get-PublicFolderMigrationRequest | Resume-PubliFolderMigrat

If you forgot to set the baditemlimit or set it too small, you can change it with this command.
     Set-PublicFolderMigrationRequest -Identity \PublicFolderMigration -baditemlimit 200
     Get-PublicFolderMigrationRequest | Resume-PubliFolderMigrat

Once the PublicFolderMigrationRequest shows autosuspended, on the Exchange 2010 server set PublicFoldersLockedForMigration to True.  This may take a couple of hours.

     Set-OrganizationConfig -PublicFoldersLockedForMigration:$true

On the Exchange 2013 server, complete the migration.
     Get-PublicFolderMigrationRequest  -Identity \PublicFolderMigration | Set-PublicFolderMigrationRequest -PreventCompletion:$false

     Get-PublicFolderMigrationRequest  -Identity \PublicFolderMigration | Resume-PublicFolderMigrationRequest

Now Verify PublicFolderMigrationRequest is 100 Percent Complete
     Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics
     Get-PublicFolder –Recurse
Log on to OWA, right Click on Favorites, click Add Public Folder and verify you are able to access the migrated Data