GD Bloggers

This is the blog site for Microsoft Global Delivery Communities focused in sharing the technical knowledge about devices, apps and cloud.
Follow Us On Twitter! Subscribe To Our Blog! Contact Us

Part 4: Step-by-Step Exchange 2007 to 2013 Migration

Part 4: Step-by-Step Exchange 2007 to 2013 Migration

  • Comments 42
  • Likes

In part 1 we covered the deployments steps for Exchange 2013, in Part 2 of this series we covered Exchange 2013 configurations and testing, in part 3 started our migration process. In this final post we will walk through the final steps in migration, then remove our legacy server.

Important Update was released by the Exchange Team to enhance the discover of legacy public folders, the details and configurations for this update are well documented in this post, and must be followed before continue with the below steps.

8.Public Folder Migration

This phase is very well documented online, accordingly we will walk through the steps with minimum explanations, to understand the whole processes check this Link.

Before you begin Download all four of the Microsoft Exchange 2013 public folder migration scripts.

Preparation (take a snapshot from current Public Folders)

Open Exchange 2007 Management Shell and run the following commands:

Get-PublicFolder -Recurse | Export-CliXML C:\PFMigration\Legacy_PFStructure.xml


Get-PublicFolderStatistics | Export-CliXML C:\PFMigration\Legacy_PFStatistics.xml


Get-PublicFolder -Recurse | Get-PublicFolderClientPermission | Select-Object Identity,User -ExpandProperty AccessRights | Export-CliXML C:\PFMigration\Legacy_PFPerms.xml


Rename Folders with backslash

If the name of a public folder contains a backslash \, the public folders will be created in the parent public folder when migration occurs. You have to rename any public folders that have a backslash in the name.

To get Public folders with backslash, run the following command:

Get-PublicFolderDatabase | ForEach {Get-PublicFolderStatistics -Server $_.Server | Where {$_.Name -like "*\*"}}


Change the public folder name as shown below:

Set-PublicFolder -Identity 000000001A447390AA6611CD9BC800AA002FC45A0300D13A87259D34A142BB480F3E89AA82BF00004FD5389E0000 -name "MCS TF2"


Make sure there is no previous record of a successful migration

Get-OrganizationConfig | Format-List PublicFoldersLockedforMigration, PublicFolderMigrationComplete


Generate the CSV files

On Exchange 2007 run the below script to create the folder name-to-folder size mapping file, the file will create the folders and its sizes

.\Export-PublicFolderStatistics.ps1 PFStat.csv e12-01



Copy this file to Exchange 2013 and run the below script to create the second CSV, which will let you know how many mailboxes will be required for your folders based on the mailbox you will set as show below:

.\PublicFolderToMailboxMapGenerator.ps1 1GB PFStat.csv FolderToMailbox.csv


As I have a very small PF only one Mailbox is required as below:


Create the required mailbox/s as shown below:

New-Mailbox -PublicFolder Mailbox1 –Database DB01 –HoldForMigration: $true


Start the Migration Request

New-PublicFolderMigrationRequest -SourceDatabase (Get-PublicFolderDatabase -Server e12-01.contoso.local) -CSVData (Get-Content FolderToMailbox.csv -Encoding Byte)


Check the status

Once the migration reached the AutoSuspended state as shown below, proceed to the next steps, otherwise you must wait as this may take some time based on your PF size.

Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics


Lock Down PF for Migration (Down time is required, as during this phase PF will bot be accessible for all users)

Set-OrganizationConfig -PublicFoldersLockedForMigration:$true


Set-PublicFolderMigrationRequest -Identity \PublicFolderMigration -PreventCompletion:$false

Resume-PublicFolderMigrationRequest -Identity \PublicFolderMigration


Test and Unlock the PF Migration

I will configure a test user to use the new PF using the following command:

Set-Mailbox -Identity mohsaeed -DefaultPublicFolderMailbox mailbox1


Open the test user mailbox and run some tests: Create new post, view old posts, check permissions

If all tests passed successful proceed to next step.

Get-Mailbox -PublicFolder | Set-Mailbox -PublicFolder -IsExcludedFromServingHierarchy $false

Set-OrganizationConfig -PublicFolderMigrationComplete:$true



Decommissioning Exchange 2007

Remove Mailbox Databases, open Exchange 2007 management shell, and run the following command:

Get-MailboxDatabase | Remove-MailboxDatabase


Remove your PF Databse using guidelines in this link.

Open cmd, navigate to bin directory and run the below command: /mode:uninstall




  • Does one uninstall the exchange 2007 edge server as well ?

  • What about PF migration if I have more than one PF database on Exchange 2007? Should I wait for copying all PF in each database then lock them, and repeat this for each PF database?

  • Great and useful Article tx for your time sharing it with us !!!!

  • Hey Tom.  Techs do things in the command line.  His process was right on.  

  • @Mihail Stacanov

    Right, you should wait for copying all PF DB then lock them and repeat all steps. PF Migration step is painful, finally don't forget latest CU2 update! There is a bug in Exchange Server 2013 CU2 about PF permissions. You should install all Exchange Server 2013 with the latest updates.

    Check this out;

  • Great article, spot on made my migration so much easy. thanks for sharing

  • We have many Distribution Group (that were created in Exchange 2007)... how do we go about migrating with these groups? Thank you

  • In previous version migrations, I'm used to having the need to move arbitration or system mailboxes from the old server prior to deleting the legacy MB DB. I can't find any good info anywhere else to know if this is required and what steps are needed - Ex2007 -->Ex 2013

  • Hello Mohammad, thank you for your quick guide. It is essential and useful. I found an issue during a migration. The http redirect to the exchane 2007 always prompt for double credential. One on the EX2013 owa and then to the Ex2007. At the end I was able to pass through the credential between 2k13 and 2k7 configuring the owa vtrutal directory on 2k7: Set-OwaVirtualDirectory -Identity "CAS_Server_Name\OWA (Default Web Site)" –ExternalURL $Null –formsAuthentication $true –WindowsAuthentication $true. Sincerely, it works, but it seems a bit strange to me I have to activate the FBA

  • Can you verify that this command Set-OrganizationConfig -PublicFoldersLockedForMigration:$true is run on the new Exchange server and not the old? The screendump doesn't say wich server it's run on.

  • First of all, THANK YOU for writing up this post. I'm sure it is useful for "some" folks is not for all. I did well all the way until this page. I get all the to "Start the Migration Request" and things fall apart there. This is what I get.... [PS] C:\PFScripts>New-PublicFolderMigrationRequest -SourceDatabase (Get-PublicFolderDatabase -Server SRVMAIL1.intermedia -CSVData (Get-Content FolderToMailbox.csv -Encoding Byte) Couldn't connect to the source mailbox. + CategoryInfo : NotSpecified: (:) [New-PublicFolderMigrationRequest], RemoteTransientException + FullyQualifiedErrorId : [Server=SRVMAIL2,RequestId=3c0b298c-9742-41b4-afbe-0db8389bacef,TimeStamp=2/10/2014 8:51 :21 PM] B2D33BC1,Microsoft.Exchange.Management.RecipientTasks.NewPublicFolderMigrationRequest + PSComputerName : Any help is very much appreciated.

  • [PS] C:\PFScripts>New-PublicFolderMigrationRequest -SourceDatabase (Get-PublicFolderDatabase -Server SRVMAIL1.intermedia -CSVData (Get-Content FolderToMailbox.csv -Encoding Byte) Couldn't connect to the source mailbox. + CategoryInfo : NotSpecified: (:) [New-PublicFolderMigrationRequest], RemoteTransientException + FullyQualifiedErrorId : [Server=SRVMAIL2,RequestId=3c0b298c-9742-41b4-afbe-0db8389bacef,TimeStamp=2/10/2014 8:51 :21 PM] B2D33BC1,Microsoft.Exchange.Management.RecipientTasks.NewPublicFolderMigrationRequest + PSComputerName :

  • Sorry about the duplicate.

  • Thanks a lot :)

  • Great article, provides exactly whats needed and links to external sources if you need more explanation of the commands.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment