Update: If you are migrating to the modern public folders in Exchange 2013 you may want to check out this article instead. This is the new and improved method for migrating public folders. However, it requires Exchange 2013 CU7 or later. As of CU11 the method below still works if you prefer to use it. But it will eventually be deprecated.
If you are in the planning stages for migration to Exchange 2013, then you have probably seen this TechNet article.
At first, it may seem daunting.
So many scripts. So many PowerShell commands.
If you are not comfortable with PowerShell it may seem a bit overwhelming.
Plus, it is vastly different than any previous migration process.
Why the change?
Architecture
Public Folders underwent a major architectural change in Exchange 2013.
Gone is the Public Folder database. And hello are the new Public Folder Mailboxes.
The benefit?
No more Public Folder Replication. Boy, did that used to be a pain!
With Public Folders stored as a mailbox, that mailbox can now be part of a Database Availability Group (DAG). And with that, all the benefits of Windows Failover Clustering.
This makes the migration process vastly different.
On a high level, it is the process of moving all data out of a database and into a special mailbox. That is where the scripts come in. I’ll explain along the way.
Let’s get started!
Note: Before you get started with any migration process it’s always good to do a backup. For Exchange, it is imperative to use a solution that is Exchange-aware. Whichever solution you use, be sure to back up that Public Folder Database.
Step 1: The Prerequisites
Before we get started we need to download the migration scripts. These can be downloaded from here. Save these to your old server. Be sure to get all four files.
Save them to an easily accessible directory. Such as C:\PFScripts. The end result should look like this.

Next, we need to make sure our source servers are fully patched. At a minimum, we need to be at the following levels.
Of course, these are only the minimum patch levels. It’s always best practice to get the latest update available.
In addition, be sure to patch your Exchange 2013 server as well. At the time of writing Cumulative Update 6, was the latest release for 2013.
Note: If running Exchange 2007, be sure you have PowerShell 2.0 and WinRM 2.0 installed. Download here.
Step 2: Running the scripts
The first script we need to run is the Export-PublicFolderStatistics.ps1 script. To do this open the Exchange Management Shell on your 2010 server. Change to your scripts directory. Run the following command. Be sure to include the period and backslash.
C:\> .\Export-PublicFolderStatistics.ps1
You will then be prompted to enter an output file name. I called this PublicFolderStats.csv.
You are then prompted for a source server that contains your Public Folder database. In my lab, the 2010 server is called EXCHANGE.

This will create the file called PublicFolderStats.csv in the scripts folder. If we open the file, we can see all the folders it discovered and their sizes in bytes.

Next, we need to run the PublicFolderToMailboxMapGenerator.ps1 script.
This script will input the PublicFolderStats.csv file we just created. It will then determine how many Public Folder Mailboxes need to be created.
C:\> .\PublicFolderToMailboxMapGenerator.ps1
The script will prompt for the desired size of each Public Folder Mailbox. Remember, this is entered as bytes.
For a 20GB mailbox, this would be 21474836480 bytes. There are a lot of calculators out there. I recommend this one from whatsabyte.com.
We are then asked for the file we created with the previous script. We had called this PublicFolderStats.csv.
Next enter the name of the map file we want to create. I made this FolderToMailbox.csv.

As you are sizing the Public Folder mailboxes, keep in mind any quotas you have in place in 2013. Like user mailboxes, public folder mailboxes follow the same quota scheme.
Let’s open the FolderToMailbox.csv file and see what it recommends.

In my case, the script determines I only need one Public Folder Mailbox. In my lab, I have very little data. Your result could be quite different. The Map Generator script may determine you need several Public Folder Mailboxes.
The Map Generator names these Public Folder Mailboxes generic names of Mailbox1, Mailbox2 and so on. If you want to utilize a different naming convention then change the name here and save the file.
In my case, I will change this to “Public Folder Mailbox 1” and save the file. If I had a requirement for a second mailbox I would call it “Public Folder Mailbox 2” and so on.

Step 3: Data Migration
We are done on the 2010 side at this point. Time to switch gears and log into our 2013 server.
Copy the FolderToMailbox.csv file over to the 2013 server. Be sure to put the file in an easily accessible directory. Such as C:\PFMigration.
We need to create the Public Folder mailboxes using the Exchange Management Shell. Their names must match the names saved in the FolderToMailbox.csv file.
Open the Exchange Management Shell and issue the following command.
Change the -Database switch to match the name of one of your 2013 databases. In my case, my database is called “Time Travel Research”.
C:\> New-Mailbox -PublicFolder "Public Folder Mailbox 1" -HoldForMigration:$true -Database "Time Travel Research"
Repeat this command for any other mailboxes.

Now we need to create a migration request.
From the Exchange Management Shell issue the following command.
Change the -Server switch to the name of your 2010 server. In my case this is EXCHANGE.
C:\> New-PublicFolderMigrationRequest -SourceDatabase (Get-PublicFolderDatabase -Server EXCHANGE) -CSVData (Get-Content C:\PFMigration\FolderToMailbox.csv -Encoding Byte) -AcceptLargeDataLoss -BadItemLimit 100
The -AcceptLargeDataLoss and -BadItemLimit switches allow for the migration process to skip any corrupted items.
These switches are required if your source is 2007. Exchange 2013 will determine the 2007 OWAScratchPad and SchemaRoot folders to be bad (more info here from Microsoft).

To check the progress of the move issue the following command.
C:\> Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics -IncludeReport | fl
The progress may report Queued. That is fine. We need to wait for the progress to report AutoSuspended. Then we can proceed.
Depending on how much data you have this process could take a very long time.

Step 4: Completing the Migration
Now that the data is copied we need to flip the switch.
Please note: This will take your Public Folders offline. Users will not be able to access Public Folders. You may wish to schedule this outside of business hours.
Also note: Prior to completing these last steps I would recommend all your users are moved to Exchange 2013.
Ready?
Awesome!
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
All set? Okay. Let’s switch back to the 2013 server again.
From the Exchange Management Shell run the following two commands.
C:\> Set-PublicFolderMigrationRequest –Identity \PublicFolderMigration -PreventCompletion:$false
C:\> Resume-PublicFolderMigrationRequest –Identity \PublicFolderMigration
These two commands will not produce any output. They only return you to a prompt.
It can take quite some time for the PublicFoldersLockedForMigration and PreventCompletion flags to trigger.
So…
Grab a cup of tea.
Check your fantasy football team.
Watch an episode of Doctor Who.
And then check back.
Let’s reissue the Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics | fl cmdlet and check our progress.
We should see a status of Completed.

We also need to make sure we reroute any messages destined for mail-enabled Public Folders to the new server.
Issue the following command from the 2010 Exchange Management Shell.
C:\> Set-OrganizationConfig -PublicFolderMigrationComplete:$true
Now we need to test.
You can access Public Folders with either Outlook or Outlook Web App.
To access with Outlook Web App, right-click on Favorites in the left pane. Select Add Public Folder from the context menu. Pick your Public Folder and click the Add button.

Verify access. Verify permissions. Verify mail flow.
All good?
You are done!
Once you are ready to remove the old Public Folder Databases check this article.
Did this post help you? Let us know how we are doing by leaving us a comment. Your feedback is always important to us!
Hi there i am kavin, its my first occasion to commenting anyplace, when i read this paragraph i thought i could
also make comment due to this good post.
Admiring the hard work you put into your site and detailed information you present.
It’s great to come across a blog every once in a while that isn’t the same outdated rehashed material.
Wonderful read! I’ve bookmarked your site
and I’m including your RSS feeds to my Google account.
Hi
Database migration completed successfully
But in Outlook I can not open the public folders
“No public folders are available. Check that a public folders deployment exists in this Exchange organization. If so, please try again later.”
What I should need to do?
Thank you very much. It helped me a lot.
I just had my Migration job at the end that remained in “StalledDueToMailboxLock” and it was not moving. After restarting the information store on Exchange 2010, I suspended the job and restarted it and the migration continued without problems.
Ive spent nearly the last year migrating from exchange 2010 to 2013
Public Folers was my last stage
This was an excellent article
Although I had lot of mailbox aliases that I had to edit the article gave me good guidance
Many Thanks
Nick
Hi Justin, ive done the migration steps above migrating from 07 to 13 as you suggested and I have the status of migration completed, but when i do “Get-MailboxDatabase | ft Name,PublicFolderDatabase” command it still says my old Echange 07 server?
do I have to do the following command Set-MailboxDatabase -Identity “Mailbox Database” -PublicFolderDatabase “PublicFolderDB1”
Hey pdelpaggio,
To your first comment, the old public folder database on 2007 will be present until you remove it. So, once you have confirmed all public folder data has been successfully copied over and everything looks good at the target then you can remove the original public folder database.
To the second comment, no, you do not need to run that command. With the new architecture, public folders are now stored in a public folder mailboxes and not databases. Those public folder mailboxes are stored in standard mailbox databases that can be made highly available via a DAG (so no more public folder replication to contend with)
I’m not sure if the current scripts are borked in the download from MS – but I had to do this to the export statistics script to get it to run at all (this was on 2007) btw.
Edit text in powershell file (Export-PublicFolderStatistics.ps1) – seach for “$_.MapiIdentity” and replace it with “$_.Identity” (basically remove the “mapi” text).
Thanks for the heads up Flinty. Looks like the Microsoft scripts were just updated in December. Unfortunately, I don’t have 2007 in my lab any more to test. Will see what I can find out on this issue. Thanks for the workaround.
Another satisfied customer! Thanks for the article. We ran into one issue that did was not detailed above. After running the command: Set-OrganizationConfig –PublicFoldersLockedForMigration:$true on our Exchange 2007 server, we had to restart the Information Store service. Then the lock went through. Otherwise, the public folders would not lock, and we kept getting the message below when trying to resume the migration on the 2013 server:
relinquishing job because the mailbox is locked.
Glad to help Dave. Yea, I need to make that more clear in the article. It can take at least 1 hour for the lock to be realized. Restarting the store will push that along faster.
Danke, super Erklärung. Hat alles funktioniert 😉
Danke dir! Hat funktioniert, voll geil!
This article looks exactly what I was trying to work out from the Microsoft version that you mentioned in the top of your article. Can’t wait to try this out! You took the cryptic elements away from the often confusing world of public folder migrations. Especially as MS have moved away from public folder databases to mailboxes. I reckon your the man to explain the MovePublicFolderBranch.ps1 script can you provide an example so we can also have content in the folders.
Hey Justin. Glad you like the article. I’d recommend checking out the new version of the migration process documented here. This also works for 2013, as long as you have CU7 or later. http://supertekboy.com/2016/03/09/exchange-2016-public-folder-migration-made-easy/
I will have to add the MovePublicFolderBranch.ps1 script to the article list.
Great Article! I looked at the official one at microsoft and it filled me with dread. breezed through it with the help of this one
Glad to be of service! Please share will your colleagues.
After a little research I found a solution for such a configuration: All Admin accounts (members of the Organization Management Exchange Security Group) mailboxes and the arbitraton mailboxes are moved to Exchange 2016 as described in http://blogs.technet.com/b/exchange/archive/2015/12/15/exchange-management-shell-and-mailbox-anchoring.aspx. This means that Powershell 2016 is used, even on the Exchange 2013 Servers.
You have to use “New-MigrationBatch -Name PFMigration …” with the same parameters instead of “New-PublicFolderMigrationRequest”
Regards
Bernd
That’s correct. In fact in the next 2013 CU and 2016 CU1 Microsoft will be reversing the mailbox anchoring feature so PowerShell does not follow where your arbitration or admin mailbox resides, but instead the version of PowerShell that is on the server you are logged into.
Interessting issue!!! I have a mixed Exchange Organization in my lab: One Exchange 2010 with Public Folders, two Exchange 2013, PF Database and PF Mailbox successfully created with the PS commands from your tutorial on one of the Exchange 2013, two Exchange 2016. All Admin accounts (members of the Organization Management Exchange Security Group) mailboxes and the arbitraton mailboxes are moved to Exchange 2016 as described in http://blogs.technet.com/b/exchange/archive/2015/12/15/exchange-management-shell-and-mailbox-anchoring.aspx.
When I try to run the command
New-PublicFolderMigrationRequest -SourceDatabase (Get-PublicFolderDatabase -Server T-EX2010) -CSVData (Get-Content C:\PF-Migration\FolderToMailbox.csv -Encoding Byte) -AcceptLargeDataLoss -BadItemLimit 100
I get the following error:
**********************
Windows PowerShell transcript start
Start time: 20160305122014
Username: SUB\administrator
RunAs User: SUB\administrator
Machine: T-EX2 (Microsoft Windows NT 6.3.9600.0)
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command . ‘C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1’; Connect-ExchangeServer -auto -ClientApplication:ManagementShell
Process ID: 11944
**********************
Transcript started, output file is C:\Users\administrator.SUB\Documents\PowerShell_transcript.T-EX2.XceOIIDL.20160305122014.txt
C:\Windows\system32>
PS>New-PublicFolderMigrationRequest -SourceDatabase (Get-PublicFolderDatabase -Server T-EX2010) -CSVData (Get-Content C:\PF-Migration\FolderToMailbox.csv -Encoding Byte) -AcceptLargeDataLoss -BadItemLimit 100
New-PublicFolderMigrationRequest is no longer a supported cmdlet to migrate legacy public folders. Please use the batch migration process detailed at https://technet.microsoft.com/en-us/library/dn874017(v=exchg.150).aspx to migrate your legacy public folders to Exchange Online.
+ CategoryInfo : NotSpecified: (:) [New-PublicFolderMigrationRequest], RecipientTaskException
+ FullyQualifiedErrorId : [Server=T-EX2-16,RequestId=f2d1c987-1f85-418f-b178-4442dd684b3c,TimeStamp=05.03.2016 11:20:18] [FailureCategory=Cmdlet-RecipientTaskException] A43A2708,Microsoft.Exchange.Management.RecipientTasks.NewPublicFolderMigrationRequest
+ PSComputerName : t-ex2.sub.root.loc
Machine T-EX2 is a Exchange 2013 Server, Server=T-EX2-16 is a Exchange 2016 Server
Any Ideas?
Regards
Bernd
Hey Bernd,
The process changed slightly with Exchange 2016 and also with later CUs of Exchange 2013. The new process is documented here
https://technet.microsoft.com/en-us/library/dn912663(v=exchg.160).aspx
I will be writing a follow up to this article for 2016 soon.
Hi,
Get-PublicFolder -Identity “\Folder\Folder\Folder\…” | Set-PublicFolder -Alias “SomethingWithoutInvalidCharacters”
Can you tell me briefly about this command.In the above command 3 times mentioned about the Folder\folder\folder.
How to apply this command exactly,please let me know.
PFB public folders in my Outlook.
Thanks,
Hari.
Hey Hari,
Looks like this example is changing the alias of a known Public Folder with an invalid character. The Folder\Folder\Folder reference appears to just be an example of the location of the folder in the hierarchy you are looking to reconfigure the alias on.
If you are looking to locate all Public Folders with a space in the alias you could use a command like this. Spaces are probably the most common invalid character in an alias.
Get-MailPublicFolder | where {$_.alias -like ‘* *’}
In your example it looks like “IT Ops – Service Requests” has both spaces and hyphens. So to locate more like that you could issue.
Get-MailPublicFolder | where {$_.alias -like ‘* *’ or $_.alias -like ‘*-*’}
There is really no catch all command, considering A to Z, 0 to 9, !, #, $, % are the only valid characters. With all the characters from all the alphabets across the globe there are potentially hundreds of characters considered invalid.
I recommend locating and removing the spaces and hyphens first. Then rerun your migration script to see if it passes or if any other invalid characters crop up in the migration report. Alternatively, how many public folders do you have? If just a handful it is easier to review all and correct by hand.
Greeitngs Gareth,
I understood your comments clearly. Now i have to remove the Spaces,Hyphens form all the Public folder’s Alias.
Please share the exact command to clear the Spaces,Hyphens.
I googled & applied some commands to remove the Spaces,Hyphens. still the same issue persists.I will not google for this issue. I will follow your instructions.
Plz assist me to clear the Spaces,Hyphens.
Thanks & Respectfully,
Hari.
Greetings Gareth Gudger,
Very nice article.Easily can understand.
Concern: C:\> New-PublicFolderMigrationRequest -SourceDatabase (Get-PublicFolderDatabase -Server EXCHANGE) -CSVData (Get-Content C:\PFMigration\FolderToMailbox.csv -Encoding Byte) -AcceptLargeDataLoss -BadItemLimit 100
Concern:Shall i apply the above command for Exchange 2010 server also?
I have migrated all the users mailboxes,Arbitration,Discoverysearch mailboxes to Exchange 2013 server from Exchange 2010 server successfully without any errors.
Now i have tried to migrate the PUBLICFOLDER DATABASE to Exchange 2013 from Exchange 2010.But the migration failed@10%.
PFB error. Fatal error DataValidationException has occurred
PFB the complete error.
[PS] C:\Windows\system32>Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics -IncludeReport | fl
RunspaceId : 1ea52b81-b47b-43ea-99e0-c049157394bf
Name : PublicFolderMigration
Status : Failed
StatusDetail : FailedOther
SyncStage : CreatingFolderHierarchy
FailureType : DataValidationException
FailureSide : Target
Message : Error: Property expression “IT Ops – Service Requests” isn’t valid. Valid values are: Strings formed with characters from A to Z (uppercase or lowercase), digits from 0 to 9, !, #, $, %
mapped to a best-fit US-ASCII string in the e-mail address, which is generated from such an alias.
FailureTimestamp : 15-01-2016 02:27:13
IsValid : True
ValidationMessage :
OrganizationId :
RequestGuid : bb8c6c6e-ce67-4ca3-bc33-86a5e4a4d6d0
RequestQueue : NSINUsers
ExchangeGuid : a65a8998-2b9c-4118-9af6-18844a23dc2d
Identity : dd05e3fe-68f9-449c-9c87-de45d33940db\bb8c6c6e-ce67-4ca3-bc33-86a5e4a4d6d0
DiagnosticInfo :
Report : 15-01-2016 02:16:57 [] Hari Haran’ created request.
15-01-2016 02:26:24 [] The Microsoft Exchange Mailbox Replication service ‘NextIndexdag01.NextSphere.com’ (15.0.1076.6 caps:1FFF) is examining the request.
15-01-2016 02:26:24 [] Connected to target mailbox ‘a65a8998-2b9c-4118-9af6-18844a23dc2d’, database ‘Users’, Mailbox server ‘NextIndexdag01.NextSphere.com’ Version 15.
15-01-2016 02:26:29 [] Connected to source mailbox ”, database ‘Public Folder Database 0076043831’, Mailbox server ‘NEXTEMAIL01.NextSphere.com’ Version 14.3 (Build 248.0)
15-01-2016 02:26:29 [] Request processing started.
15-01-2016 02:26:29 [] Cleared sync state for request 00000000-0000-0000-0000-000000000000 due to ‘CleanupOrphanedMailbox’.
15-01-2016 02:26:49 [] Stage: CreatingFolderHierarchy. Percent complete: 10.
15-01-2016 02:26:54 [] Initializing folder hierarchy from mailbox ”: 53 folders total.
15-01-2016 02:26:54 [] Folder creation progress: 0 folders created in mailbox ‘a65a8998-2b9c-4118-9af6-18844a23dc2d’.
15-01-2016 02:27:13 [] Fatal error DataValidationException has occurred.
Thanks,
Hari.
Hey Hari,
Here is the problem.
Message : Error: Property expression “IT Ops – Service Requests” isn’t valid. Valid values are: Strings formed with characters from A to Z (uppercase or lowercase), digits from 0 to 9, !, #, $, %
This is likely a mail enabled public folder that has invalid characters in the alias. My guess is there is a hyphen or a space in the alias. If you rename the alias it should go through. You may need to do a spot check of all public folder aliases to make sure they don’t have invalid characters.
great article, exactly what I needed, it worked great for our exchange 2007 to 2013 public folder migration.
I am now ready to decommission our old exchange 2007 server.
big thanks
Jimbo
Gareth you have made the process really easy and simple to follow. Thank you
Glad I was able to help!
Well written article Gareth. You’re article simplifies MS’s over complicated and (outdated) article which I was following (which you referenced at the top of this article).
Glad to be of assistance!
Worked perfect for my CU8 migration from 2010, thats for the article.
Glad to help Brian.
This process has actually changed slightly. It depends on what Cumulative Update you are on. This article addresses the original process released up through Cumulative Update 6.
This process does still work on CU7 and beyond but there are some new cmdlets starting with CU7 that make the move faster.
I’ll get a revision posted up soon.
Any update on when we can see that new Public Folder batch migration method as a simplified tutorial like this one?
Hi Gareth, Thanks for sharing fantastic information shared that can be a good help further who are still stuck with the problem with Exchange public folder migration.
In my scenario, I took help from this automated solution available at (http://www.lepide.com/exchangemigrator/public-folder-migration.html). It was an awesome tool that made my migration task much easier and finished the entire migration process in one go without any interruption.
Thanks for the tip Walter.
Following this process can you migrate only specific Public Folders at a time? For example if we have 10 departments with 10 different sets of Public Folders, can we migrate them 10 at a time respectively instead of all at once?
Thank you in advanced.
Hey John,
I am not aware of any way to cut public folders in batches. Technically you could modify the CSV file to only contain the folders you want moved. But that is only seeding the data. The users aren’t cut over to 2013 until the last step and that is at the organization level not a user level.
Excellent article. Helped me out enormously when Microsoft’s official TechNet article failed me. For a start they tell us to use ‘New-MigrationRequest’ as opposed to ‘NewPublicFolderMigrationRequest’ and the former doesn’t support Public Folders. Unbelievable.
Thanks Gareth!
Awesome. Glad to help!
This process has actually changed slightly. It depends on what Cumulative Update you are on. This article addresses the original process released up through Cumulative Update 6.
This process does still work on CU7 and beyond but there are some new cmdlets starting with CU7 that make the move faster.