"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

Screenshot of the error message when you run a public folder migration batch job.

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

  1. 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

    1. In Exchange admin center, select Recipients > Migration.

    2. Select the migration batch, and then select View details under Mailbox status.

    3. 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.

      Screenshot of the downloading the report for failed mailbox.

    4. 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.

      Screenshot of the entry ID of recovered folder.

    Method 2: Use PowerShell

    1. Connect to Exchange Online PowerShell.

    2. 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.

    3. 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" }
      

      Screenshot of the cmdlet to export statistics.

      The .xml file is created on your computer, as shown in the following example.

      Screenshot of downloaded .xml file path.

    4. 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.

    5. 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.

      Screenshot of the entry ID that is the first data value of the recovered folder entry.

  2. 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.

  3. 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.