If you are in the planning stages for migration from Exchange 2010 to Exchange 2016, 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
Beginning with Exchange 2013–and continued with 2016–public folders underwent a major architectural change.
This new architecture is referred to as Modern Public Folders. The old architecture is now known as Legacy Public Folders. But its much more than a name change. 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!
Works with 2013: This process also works with migrations to Exchange 2013 (from 2007 SP3 RU15 or 2010 SP3 RU8). It requires Exchange 2013 be on Cumulative Update 7 or later. If not, you will need to perform the older serial migration method documented here.
Step 1: The Prerequisites
Caution: 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 have a good working backup of your Public Folder Database.
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 six 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.
Exchange Server 2010 SP3 and SP3 RU8.
Of course, these are only the minimum patch levels. It’s always best practice to get the latest update available. At the time of writing Exchange 2010 SP3 RU12 is the latest release.
In addition, be sure to patch your Exchange 2016 server as well. At the time of writing, there is no cumulative update for Exchange 2016.
Tip: It is important to migrate public folders after you migrate all users to 2016. Users on legacy versions of Exchange will not be able to access the modern public folders of Exchange 2016.
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 .\Export-PublicFolderStatistics.ps1 script. Be sure to include the period and backslash.
You may be prompted to allow the script to run. Pick [R] to run once, or, [A] to always run.
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 EX10.
C:\PFScripts>.\Export-PublicFolderStatistics.ps1 cmdlet Export-PublicFolderStatistics.ps1 at command pipeline position 1 Supply values for the following parameters: (Type !? for Help.) ExportFile: PublicFolderStats.csv PublicFolderServer: EX10 [3/8/2016 11:23:21 AM] Enumerating folders under NON_IPM_SUBTREE... [3/8/2016 11:23:23 AM] Enumerating folders under NON_IPM_SUBTREE completed...6 folders found. [3/8/2016 11:23:25 AM] Retrieving statistics from server EX10 [3/8/2016 11:23:25 AM] Retrieving statistics from server EX10 complete...7 folders found. [3/8/2016 11:23:25 AM] Total unique folders found : 7. [3/8/2016 11:23:25 AM] Exporting statistics for 7 folders [3/8/2016 11:23:25 AM] Exporting folders to a CSV file [PS] C:\PFScripts>
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. In my lab, I only have six folders. All of which are empty. The size column is measured in bytes.

Next, we need to run the PublicFolderToMailboxMapGenerator.ps1 script. To do this run the .\PublicFolderToMailboxMapGenerator.ps1 script. Be sure to include the period and backslash.
This script will input the PublicFolderStats.csv file we just created. It will then determine how many Public Folder Mailboxes need to be created.
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.
C:\PFScripts>.\PublicFolderToMailboxMapGenerator.ps1 cmdlet PublicFolderToMailboxMapGenerator.ps1 at command pipeline position 1 Supply values for the following parameters: (Type !? for Help.) MailboxSize: 21474836480 ImportFile: PublicFolderStats.csv ExportFile: FolderToMailbox.csv [3/8/2016 11:31:57 AM] Reading public folder list... [3/8/2016 11:31:57 AM] Loading folder hierarchy... [3/8/2016 11:31:57 AM] Allocating folders to mailboxes... [3/8/2016 11:31:57 AM] Trying to accomodate folders with their parent... [3/8/2016 11:31:57 AM] Exporting folder mapping... [PS] C:\PFScripts>
As you are sizing the Public Folder mailboxes, keep in mind any quotas you have in place in 2016. Like user mailboxes, public folder mailboxes follow the same quota scheme. That said, if you have a massive public folder deployment, you may want to create a dedicated database that only contains your public folder mailboxes.
This recommendation may seem contradictory to the architecture changes mentioned earlier as the public folders would be once again in a dedicated database. But keep in mind that the database is using Windows Failover Clustering as its shipping mechanism and not public folder replication (Yay!).
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. And will vary based on the size you specified when running the mapping script. 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.

Now we need to switch gears and log onto our Exchange 2016 server. Once logged on, copy the entire contents of the C:\PFScripts folder from the old Exchange server to the same location on the 2016 server.
Open PowerShell and change to the C:\PFScripts directory. Run the .\Create-PublicFolderMailboxesForMigration.ps1 script. Be sure to include the preceding period and backslash.
You may be prompted to allow the script to run. Pick [R] to run once, or, [A] to always run.
You will then be prompted to enter the name of our mapping file we created on the old server. This should have come across when you copied the PFScripts folder. We had called this FolderToMailbox.csv.
You will then be asked for an estimate of your concurrent users who access public folders. Microsoft states this is less than your actual user count. Microsoft’s recommended limit for concurrent connections to a single public folder mailbox is 2,000. So, for an environment with less than 2,000 users, it really doesn’t matter what you enter here. For a large environment with more than 2,000 users, you want to make sure that you have one public folder mailbox for every 2,000 concurrent connections. You may wish to correct your map file, if you have too few mailboxes, before proceeding.
The script will validate the contents of the CSV map file and ask if you wish to proceed. Hit enter to accept the default of [Y] Yes.
C:\PFScripts>.\Create-PublicFolderMailboxesForMigration.ps1 Do you want to run software from this untrusted publisher? File C:\PFScripts\Create-PublicFolderMailboxesForMigration.ps1 is published by CN=Microsoft Corporation, OU=MOPR, O=Microsoft Corporation, L=Redmond, S=Washington, C=US and is not trusted on your system. Only run scripts from trusted publishers. [V] Never run [D] Do not run [R] Run once [A] Always run [?] Help (default is "D"): a cmdlet Create-PublicFolderMailboxesForMigration.ps1 at command pipeline position 1 Supply values for the following parameters: (Type !? for Help.) FolderMappingCsv: FolderToMailbox.csv EstimatedNumberOfConcurrentUsers: 100 Public Folder mailbox updates. Creating 1 Public Folder mailbox(es) and updating 0. Total mailboxes to serve hierarchy will be 1. Would you like to proceed? [Y] Yes [N] No [?] Help (default is "Y"): Total mailboxes created: 1. Total mailboxes updated: 0. Total serving hierarchy: 1. Here is a list of Public Folder mailboxes created: Name IsServingHierarchy IsMigrationTarget ---- ------------------ ----------------- Public Folder Mailbox 1 True True [PS] C:\PFScripts>
The script then lists all the public folder mailboxes it created. It should be every mailbox you had in your map file. In our case, it was just the one which we had renamed Public Folder Mailbox 1.
Next Steps
That’s it for part one of our public folder migration series to Exchange 2016. Check out part two where we migrate our public folder data and finalize the migration.
This is all good and dandy but how about a thorough step by step instructions for Migrating Modern Public Folders to Exchange Online?
Hi Gareth,
I have a particular situation where my company is using the 2010 proxy mailbox for users on exchange 2016. I was wondering if that mailbox can be used for the migration since we have split permissions and it does not permit me to create a mailbox even though I have organisation rights access. We would need to have an AD user object created and edit the New-mailbox section of the script to enable-mailbox, then set-mailbox so it would be made available for use.
Just a note to say thanks for a great article that makes a complex process easy to do. I used it on a recent Exchange 2010 to 2016 migration project. Public folders are certainly a “feature” that look like sticking around for a while!
Im currentyl in the process of migration onle lage Legacy PF to the new modern PF The public folder in question is currently 167 GB (everything included). One of the folders within this PF is 164 GB in size ….)
I know MS only supports 100GB database size … but here i am with 167 GB….
Wow do i split that up in the correct way.
If i generate the FolderToMailboxMap.csv qith a databank size of 36 GB i get 6 Mailboxes out. If i Issue the same with 100 GB DB size ill get two
What happens with the data?
What happens if a user decides to upload something that resides in an already filled up DB?
Will Ex16 issue a new database or do i have to do that manually?
Thank you
I asked this question in MS Forum but they are dancing arround the busch with no clear answer in sight….
Hi,
I am planning migrate from Exchange 2010 SP3 RU29 to Exchange 2016. I dont have any user / admin created Public Folders. The way I checked this is MMC-> Add/Remove Snap-in-> Select “Public Folder Management Console Snap-in”, Click on Add -> Right Click on the Public folders Icon in the MMC and Click on Connect to Server ->
I have no content / list in the “Default Public Folders”
The “System Public Folders” has listing of : “EFORMS REGISTRY” , “OFFLINE ADDRESS BOOK” and “SCHEDULE+ FREE BUSY”
Should these be migrated OR not?
Gareth,
Is there a way to tell these scripts which database to create the new Public Folder mailbox? I’m not seeing it anywhere and no one ever mentions this. I have a two node DAG with 12 databases that hold our archive mailboxes and one database for public folders. Want to make sure it goes where I want it.
Does not look like the scripts have that as a parameter. Looking at the New-Mailbox cmdlet in the script it is just having Exchange load balance the mailbox to the least used database.
You could modify the New-Mailbox line in the .\Create-PublicFolderMailboxesForMigration.ps1 script to include a -Database parameter. Be sure to test first.
Another option is to move the public folder mailbox to the desired database after creation.
One last option could be to disabling allow provisioning of mailboxes on all databases and then run the script. Then enabling provisioning back again.
Thank you so very much! I believe we will go with disabling provisioning option. Sounds like a no fail option. Thanks again for the prompt reply as we start this migration tomorrow.
Cheers,
Alan
One step that is missing in this is going through public folders and disabling mail flow on the folders. Microsoft knowledge base article:
https://support.microsoft.com/en-us/help/3050726/public-folder-foldername-couldn-t-be-mail-enabled-error-when-you-try-t
Thanks for the tip Zach.
I think this paragraph need editing, presumably the 2 script names should be the same?
Next, we need to run the PublicFolderToMailboxMapGenerator.ps1 script. To do this run the .\Export-PublicFolderStatistics.ps1 script.
Nice catch Matt. Article updated.
Hi Gareth,
Yours is probably the easiest to follow of all iterations of this process on the Internet
I’m a bit of a noob so naturally I’m still running into some unexpected issues
I just ran the Create-PublicFolderMailboxesForMigration.ps1 script as instructed but I’m getting a somewhat ambiguous result
***
Active Directory operation failed on D1PAD1.lan.creditcorp.com.au. This error is not retriable. Additional
information: Access is denied.
Active directory response: 00000005: SecErr: DSID-03152612, problem 4003 (INSUFF_ACCESS_RIGHTS), data 0
+ CategoryInfo : NotSpecified: (:) [New-Mailbox], ADOperationException
+ FullyQualifiedErrorId : [Server=D1PEXCH01,RequestId=b9e42408-4861-4191-a40d-7b27b748a63f,TimeStamp=15/02/2018 5:
25:49 AM] [FailureCategory=Cmdlet-ADOperationException] 70316221,Microsoft.Exchange.Management.RecipientTasks.NewM
ailbox
+ PSComputerName : d1pexch01.lan.creditcorp.com.au
Total mailboxes created: 1. Total mailboxes updated: 0. Total serving hierarchy: 1.
Here is a list of Public Folder mailboxes created:
Name IsServingHierarchy IsMigrationTarget
—- —————— —————–
Mailbox1 True True
***
And when I ring the Get-OrganizationConfig cmdlet I get the result below
***
Name IsServingHierarchy IsMigrationTarget
—- —————— —————–
Mailbox1 True True
IsValid : False
CanUpdate : True
HierarchyMailboxGuid : 00000000-0000-0000-0000-000000000000
LockedForMigration : False
***
I can’t see the new Public Folder mailbox in EAC showing IsValid:False
Does that look right or have I screwed something up along the way?
Good afternoon Alfred,
It looks like this is the key. “Access is denied.”
When you ran that script did you open PowerShell as an administrator? Right click on the PowerShell icon and select “Run As Administrator” from the context menu. Also, you may want to verify the account you are attempting this from is a member of the Organization Management group.
Thanks Gareth! Got it in one.
Couple of gotchas for me:
1. Having never done this before I found the result a bit ambiguous
2. I thought I re-ran an EMS instance as administrator but didn’t :-\
Rookie mistakes. Thanks again!
I’m a rookie and tasked with migrating public folders from Exch 2010 to 2013. So confused about the .csv for creating those mailboxes. The current 2010 tree has 4 top level public folders below the All Public Folders folder. There are a total of 3918 folders holding about about 700GB of data. And oh BTW, one of the folders is 27GB. I want to make sure the resultant migration looks identical. Running the PublicFolderToMailboxMapGenerator.ps1 script returns that 31 mailboxes are needed. The names look like:
“\IPM_SUBTREE\TopLevel\14018 – COC_PCM_Small_Proj”,”Mailbox15″
“\IPM_SUBTREE\TopLevel\OH14021_FCCFA_GT_Work”,”Mailbox15″
How do I modify the output of the map generator script to make sure that when I run the Create-PublicFolderMailboxesForMigration.ps1 script, my existing 2010 public folder tree.
Hey Harold,
Despite requiring 31 mailboxes, it will maintain a single hierarchy like you have now. The user will be unaware which public folder mailbox is serving which public folder. To them they just see a single hierarchy like they did before. The IPM_SUBTREE top-most folder will be invisible. To the user they will just see “Public Folders” and below that the 4 top level folders and all their subfolders. Should not need to modify the map generator. Hope that helps.
Great article Gareth! I recently used this to migrate Public Folders from Exchange 2007 to Exchange 2013. Keep up the good work and lets have a beer soon 🙂
Hello,
we have an hybrid scenario, where the mailbox are on Exchange 2016 and the PF on 2010.
Should i run the cmd “Set-OrganizationConfig -PublicFoldersEnabled Local” before create PF on 2016?
Thanks
Is it possible to access Modern Public Folders on windows XP with outlook 2010 sp2 ?
This article states Outlook 2010 will work with modern public folders. Although I would get Office 2010 fully patched with the latest service packs and Windows Updates before you try. https://technet.microsoft.com/en-us/library/jj552408(v=exchg.160).aspx
Not aware of Windows XP causing any issues. But Windows XP went end of life 2.5 years ago. Might be difficult to find documentation on this setup as Microsoft has likely not tested this scenario.
Does this work if migrating from Exchange 2007 as well?
Also, what are the advantages of doing this versus just exporting the existing Public Folders to PST (using PowerShell or Outlook) creating the Public Folders in Exchange 2013 from scratch then importing the data from PST?
Hey Klip,
This will work with a 2007 to 2013 migration as long as the 2013 server is at CU7 or greater and 2007 is at SP3 RU15 or greater. More info on that here.
https://technet.microsoft.com/en-us/library/dn912663(v=exchg.150).aspx
The problem with exporting/importing with a PST is that you lose all folder permissions and mail-enabled settings. All you get is the folder structure and data.
Is it possible to access Modern Public Folders on windows XP with outlook 2010 sp2 ?
Hey Alex,
Outlook 2010 will work. Although I recommend getting it fully patched. Not 100% sure if Windows XP will cause any issues. It is out of support so it is unlikely Microsoft have tested this scenario.
Just came across this article today, hoping to get the next part soon any ETA on that? Your article has been the best so far to follow for this!
Was hoping to have it out this morning. Life happens right? 🙂 Should be this weekend sometime. Sorry for the delay.
Part 2 is now live. Sorry for the delay.
http://supertekboy.com/2016/03/11/exchange-2016-public-folder-migration-part-2/