In part one of public folder migration, we prepared our environment. Then we ran all the necessary scripts to size and create the new public folder mailbox hierarchy.
In this second and final part of our series, we will copy the data from the legacy public folder databases into our newly created modern public folders. We will also finalize the migration process.
Step 3: Data Migration
Let’s start moving our data. First, let’s create the migration batch. From the Exchange 2016 server issue the following command.
C:\> New-MigrationBatch -Name PFMigration -SourcePublicFolderDatabase (Get-PublicFolderDatabase -Server EX10) -CSVData (Get-Content C:\PFScripts\FolderToMailbox.csv -Encoding Byte) -NotificationEmails firstname.lastname@example.org
In our example:
-Name specifies a display name to help identify the batch.
-SourcePublicFolderDatabase (-Server) specifies the 2010 server hosting the public folder database. In my lab, this is called EX10.
-CSVData specifies the path to our map file we created in part one of our series. We had called this FolderToMailbox.csv and saved it to C:\PFScripts.
-NotificationEmails specifies where to email the batch migration report. This is optional.
C:\> New-MigrationBatch -Name PFMigration -SourcePublicFolderDatabase (Get-PublicFolderDatabase -Server EX10) -CSVData (Get-Content C:\PFScripts\FolderToMailbox.csv -Encoding Byte) -NotificationEmails email@example.com Identity Status Type TotalCount -------- ------ ---- ---------- PFMigration Created PublicFolder 1 [PS] C:\>
This only creates the job. To start the actual data copy run the following command. If you named your job anything other than PFMigration you will need to change that here.
C:\> Start-MigrationBatch PFMigration
We can check the progress of the batch by logging into the Exchange Admin Center. Once logged in, navigate to Recipients >> Migration tab.
From here we will see our PFMigration job and its current status. Before issuing the previous command it would have shown a status of “Created”. Once we started the batch it switches to “Syncing”.
Selecting the batch and clicking the View Details link, will give us a deeper insight into what is happening with the batch.
From here we can see greater detail into the progress of our PFMigration batch. We can see that 5 items have synced, nothing has been skipped and, so far no errors are reported. The real magic is the Download the report for this user link. This link is a detailed play by play of everything the migration is doing. Including any additional information on errors. It’s great for troubleshooting purposes.
If you are interested in what my detailed migration report looked like check this link.
You can also see the same report in PowerShell by issuing the following command. You will need to replace PFMigration with the name of your batch if different.
C:\> Get-MigrationUser -Batch PFMigration | Get-MigrationUserStatistics -IncludeReport | fl
Eventually, your migration will show a status of Synced. In addition, the report will list a percentage of 95 and indicate it was automatically suspended. This means the initial seed of data has been completed. However, your new public folder mailbox it is not yet live. If you take no action the migration job will perform an incremental copy every 24 hours until you complete the batch. Keep in mind completing the batch will force downtime for your public folders. It may be best to perform these next tasks under a maintenance window.
Step 4: Completing the Migration
Now that the data is seeded its time to flip the switch.
Okay, let’s switch back to the 2010 server.
From the Exchange Management Shell run this command. Users will be blocked from accessing Public Folders.
C:\> Set-OrganizationConfig –PublicFoldersLockedForMigration:$true
Let’s switch back to the 2016 server again.
From the Exchange Management Shell run the following.
C:\> Set-OrganizationConfig -PublicFoldersEnabled Remote
Now let’s complete the batch. Be sure to rename PFMigration to the name of your batch, if different. Hit enter to accept the default action of Yes.
C:\> Complete-MigrationBatch PFMigration Confirm Are you sure you want to perform this action? Complete migration batch "PFMigration"? [Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "Y"):
The batch status will switch to Completing. During this time a final incremental sync is performed. Once finished the status column will display Completed. How long this takes depends on how many changes have been made in public folders since the initial seed, or, last incremental sync. Cleanup and replication are also performed in the environment.
If you are curious what the final report contains check out this link.
Now we need to test. Issue this command against one of your test users. In this command, I am assigning the public folder mailbox that contains the new hierarchy to user Rory Williams.
C:\> Set-Mailbox -Identity rwilliams -DefaultPublicFolderMailbox "Public Folder Mailbox 1"
You can access Public Folders with either Outlook 2010 or greater or Outlook Web App. From either of these programs check the hierarchy, check content, check permissions and check mail settings. If it doesn’t look right Microsoft recommends using their rollback method documented here.
If everything looks great then run the following command on 2016 to deploy to all other users.
C:\> Get-Mailbox -PublicFolder | Set-Mailbox -PublicFolder -IsExcludedFromServingHierarchy $false
Now, switch gears back to 2010 and run this command.
C:\> Set-OrganizationConfig -PublicFolderMigrationComplete:$true
And finally one last command back on the 2016 server.
C:\> Set-OrganizationConfig -PublicFoldersEnabled Local
You are done!
Once you are ready to remove the old Public Folder Databases check this article.
Here are some articles I thought you might like.
- Import & Export SSL Certificates in Exchange Server 2016
- Install Exchange 2016 in your lab (7-part series)
- Configure Kemp Load Balancer for Exchange 2016
- Create an IP-less DAG
- What Ignite taught us about Exchange 2016
Join the conversation on Twitter @SuperTekBoy.