Migrate public folders from Exchange 2010 to Exchange 2016

 

Estimated time to complete: varies depending on the number of public folders to migrate

Before you decommission your Exchange 2010 servers, you need to migrate your public folders to your Exchange 2016 servers. There are several steps involved in migrating public folders. Before you start, make sure that you understand the process explained below in its entirety.

You can migrate up to 500,000 public folders at a time. If you have more than this, you'll need to create migration batches of less than 500,000 public folders per batch. There are other public folder limits that you should consider, such as a maximum number of public folder mailboxes, a maximum number of public folders per public folder mailbox, and so on. Check out Limits for public folders before you start your migration.

  1. Download all scripts and supporting files from Public Folders Migration Scripts.

  2. Save the scripts to the local computer on which you’ll be running PowerShell. For example, C:\PFScripts. Make sure all scripts are saved in the same location.

Perform all steps in this section in the Exchange Management Shell on your Exchange 2010 server.

  1. Open the Exchange Management Shell on your Exchange 2010 server.

  2. For verification purposes at the end of migration, run the following commands to take snapshots of your current public folder deployment:

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

      Get-PublicFolder -Recurse | Export-CliXML C:\PFMigration\Legacy_PFStructure.xml
      
    • Run the following command to take a snapshot of public folder statistics such as item count, size, and owner.

      Get-PublicFolderStatistics | Export-CliXML C:\PFMigration\Legacy_PFStatistics.xml
      
    • 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:\PFMigration\Legacy_PFPerms.xml
      

    Save the information from the preceding commands for comparison purposes after your migration is complete.

  3. 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, you need to rename any public folders that have a backslash in the name if you don't want this to happen.

    1. To locate public folders that have a backslash in the name, run the following command.

      Get-PublicFolderStatistics -ResultSize Unlimited | Where {$_.Name -like "*\*"} | Format-List Name, Identity
      
      
    2. 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>
      

  1. Open the Exchange Management Shell on your Exchange 2010 server.

  2. Run the following command to create a file that maps the folder name to the folder size for each public folder you want to migrate. You'll need to specify an accessible network share where the CSV file created by the following command is run, and you'll need to specify the FQDN of your Exchange 2010 server.

    This command needs to be run by a local administrator and will create a CSV file that contains two columns: FolderName and FolderSize. The values for the FolderSize column will be displayed in bytes. For example, \PublicFolder01,10000.

    C:\PFScripts\Export-PublicFolderStatistics.ps1  "\\FileServer\Share\FolderSize.csv" "EX2010.corp.contoso.com"
    
  3. Run the following command 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. You'll need to specify the following parameters:

    • Maximum mailbox size in bytes This is the maximum size you want to set for the new public folder mailboxes. When specifying this setting, be sure to allow for expansion so the public folder mailbox has room to grow. In the command below, the value 20000000000 is used to represent 20 GB.

    • Folder to size map path This is the file path of the CSV file you created when running the previous command. For example, \\FileServer\Share\FolderSize.csv.

    • Folder to mailbox map path This is the file name and path of the folder-to-mailbox CSV file that you’ll create with this step. If you specify only the file name, the file will be generated in the current Windows PowerShell directory on the local computer.

    C:\PFScripts\PublicFolderToMailboxMapGenerator.ps1 20000000000 "\\FileServer\Share\FolderSize.csv" "\\FileServer\Share\PFMailboxes.csv"
    

  1. Run the following command to create the target public folder mailboxes. The script will create a target mailbox for each mailbox in the .csv file that you generated previously in Step 3, by running the PublicFoldertoMailboxMapGenerator.ps1 script.

    .\Create-PublicFolderMailboxesForMigration.ps1 -FolderMappingCsv Mapping.csv -EstimatedNumberOfConcurrentUsers:<estimate>
    

    Mapping.csv is the file generated by the PublicFoldertoMailboxMapGenerator.ps1 script in Step 3. The estimated number of simultaneous user connections browsing a public folder hierarchy is usually less than the total number of users in an organization.

At this point, you're ready to start the public folder migration. The steps below will create and start the migration batch. Depending on the amount of data in your public folders and the speed of your network connections, this could take a few hours or several days. During this stage of the migration, users will still be able to access their public folders and content on your Exchange 2010 server. In "Part 6: Complete the public folder migration (downtime required)", you'll run another sync to catch up with any changes made in your public folders, and then finalize the migration.

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

  2. Run the following command to create the new public folder migration batch. Be sure to change the path to your public folder-to-mailbox mapping file.

    New-MigrationBatch -Name PFMigration -SourcePublicFolderDatabase (Get-PublicFolderDatabase -Server EX2010) -CSVData (Get-Content "\\FileServer\Share\PFMailboxes.csv" -Encoding Byte) 
    
  3. Start the migration by using the following command.

    Start-MigrationBatch PublicFolderMigration
    
    

The progress and completion of the migration can be viewed and managed in the EAC. Because the New-MigrationBatch cmdlet initiates a mailbox migration request for each public folder mailbox, you can view the status of these requests by using the mailbox migration page. You can get to the mailbox migration page and create migration reports that can be emailed to you by doing the following:

  1. Open the EAC by browsing to the URL of your Exchange 2016 Mailbox server. For example, https://Ex2016/ECP.

  2. Navigate to Mailbox > Migration.

  3. Select the migration request that was just created, and then click View Details in the Details pane.

The Status column will show the initial batch status as Created. The status changes to Syncing during migration. When the migration request is complete, the status will be Synced. You can double-click a batch to view the status of individual mailboxes within the batch. Mailbox jobs begin with a status of Queued. When the job begins the status is Syncing, and once InitialSync is complete, the status will show Synced.

Until this point in the migration, users have been able to access public folders. The next steps will log off users from the Exchange 2010 public folders and will lock the folders while the migration completes its final synchronization. Users won’t be able to access public folders during this process. Also, any mail sent to mail-enabled public folders will be queued and won’t be delivered until the public folder migration is complete.

Before you can finalize the migration, you need to lock the public folders on the Exchange 2010 server to prevent any additional changes by doing the following:

  1. Open the Exchange Management Shell on your Exchange 2010 server.

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

    Set-OrganizationConfig -PublicFoldersLockedForMigration:$true
    

If your organization has multiple public folder databases, you’ll need to wait until public folder replication is complete to confirm that all public folder databases have picked up the PublicFoldersLockedForMigration flag and any pending changes users recently made to folders have replicated across the organization. This may take several hours.

Once the public folders on the Exchange 2010 server have been locked, you can finalize the migration by doing the following:

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

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

    Set-OrganizationConfig -PublicFoldersEnabled Remote
    
  • Run the following command to complete the public folder migration.

    Complete-MigrationBatch PublicFolderMigration
    
    

    Or, in EAC, you can complete the migration by clicking Complete this migration batch.

When you do these steps, Exchange will perform a final synchronization between the Exchange 2010 server and Exchange 2016 server. 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 first to Completing, and then to Completed.

When you complete the migration, Exchange will perform a final synchronization between the Exchange 2010 server and Exchange 2016. 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.

After you finalize the public folder migration, you should run the following test to make sure that the migration was successful. This allows you to test the migrated public folder hierarchy before you switch to using Exchange 2016 public folders.

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

  2. 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 <Test User> -DefaultPublicFolderMailbox <Public Folder Mailbox Identity>
    
  3. Open Outlook 2010 or later using the test user identified in the previous step, and then perform the following public folder tests:

    • View the hierarchy

    • Check permissions

    • Create and delete public folders

    • Post content to and delete content from a public folder

  4. 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
    
  5. On the Exchange 2010 server, run the following command to indicate that the public folder migration is complete.

    Set-OrganizationConfig -PublicFolderMigrationComplete:$true
    
  6. After you've verified that the migration is complete, run the following command on the Exchange 2016 server.

    Set-OrganizationConfig -PublicFoldersEnabled Local
    

In "Part 2: Prepare for the migration," you took snapshots of the public folder structure, statistics, and permissions before the migration began. The following steps will help verify that your public folder migration was successful by taking the same snapshots after the migration is complete. You then can compare the data in both files to verify success.

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

  2. Run the following command to take a snapshot of the new folder structure.

    Get-PublicFolder -Recurse | Export-CliXML C:\PFMigration\Cloud_PFStructure.xml
    
  3. 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 C:\PFMigration\Cloud_PFStatistics.xml
    
  4. 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:\PFMigration\Cloud_PFPerms.xml
    

If you run into any problems with your migration, you can revert to your Exchange 2010 public folders. For more information, see the Roll back the migration section in Use batch migration to migrate public folders to Exchange 2013 from previous versions.

Having problems? Ask for help in the Exchange forums. Visit the forums at Exchange Server, Exchange Online, or Exchange Online Protection.

 
Show: