"ErrorFoldersRestoredDuringMigrationPermanentException" error in a public folder migration batch
Symptoms
When you run a public folder migration batch job, you receive the following error message:
ErrorFoldersRestoredDuringMigrationPermanentException
Cause
This problem occurs because the public folder restore operation isn't supported during migrations that begin with the ExcludeDumpster parameter. The problem occurs if the following conditions are met:
- The public folder migration batch was created by using the
ExcludeDumpster
parameter. - You recovered deleted public folders from the dumpster in the source while you ran the migration batch job.
Resolution
To resolve this problem, use one of the following methods, as appropriate for your situation.
Method 1: Remove the recovered public folders
Identify the entry IDs of the recovered folders. Here's how to check the report and identify the entry IDs.
Method 1: Use Exchange admin center
In Exchange admin center, select Recipients > Migration.
Select the migration batch, and then select View details under Mailbox status.
Select the failed migration mailbox, and then select Download the report for this user.
Note the identity of the failed migration mailbox. In the following example, the identity is Mailbox1.
In the report, search for the keyword "recovered" to find the entry IDs of the recovered folders. The entry ID is the first data value of the recovered folder entry, as shown in the following example.
Method 2: Use PowerShell
Connect to Exchange Online PowerShell.
Retrieve the failed public folder mailbox migration request by running the following cmdlet:
$failed_req = Get-PublicFolderMailboxMigrationRequest -Status Failed $failed_req
Note the identity of the failed migration mailbox.
Export the statistics of the failed public folder mailbox migration request to an xml file by running the following cmdlet:
$failed_req | foreach { Get-PublicFolderMailboxMigrationRequestStatistics $_.Identity -IncludeReport -DiagnosticInfo verbose | Export-Clixml "PF_failed_$($_.TargetMailbox)_$($_.RequestGuid).xml" }
The .xml file is created on your computer, as shown in the following example.
Import the xml file by running the following cmdlet:
$failedreport=Import-Clixml "<Path of the xml file>"
Note:
$failedreport
is a variable that you can customize. <Path of the xml file> represents the actual path.Retrieve the entry IDs of the recovered folders from
$failedreport
by running the following cmdlet:$failedreport.Report.Entries|where {[string]$_ -like "*recovered*"}|%{[string]$_}
The entry ID is the first data value of the recovered folder entry, as shown in the following example.
Remove the recovered public folder by running the following cmdlet:
Remove-PublicFolder -Identity "<EntryID>"
Replace the <EntryID> placeholder with the entry ID that you found in step 1. For more information about this cmdlet, see the "Examples" section of Remove-PublicFolder.
Start the migration of the failed mailbox by running the following cmdlet:
Start-MigrationUser "<FailedMailbox>"
Replace the <FailedMailbox> placeholder with the identity of the failed migration mailbox that you noted in step 1. For more information about this cmdlet, see Start-MigrationUser.
Method 2: Don't specify the ExcludeDumpster parameter
If you don't want to remove the recovered public folders, restart the migration without specifying the ExcludeDumpster
parameter.
More information
Still need help? Go to Microsoft Community.