Paginas

12 July 2016

Migrate Exchange 2007-2010 Public Folders to Exchange 2013

 


In this Post I wil show you how to migrate Public folders from an earlier Exchange to Exchange 2013 (The process is the same in Exchange 2007 and 2010). It will not work with Exchange 2003.

First of all, the requirements:
  • The user that will do the migration must belong to Organization Management and Recipient Management groups (Active Directory);
  • All the mailboxes must already be in Exchange 2013 (All Mailboxes migrated). I will not cover in this Post how to migrate Mailboxes;
  • The Public Folders migration must be planned (because there is a downtime);
  • Before the migration, do a Full Backup of the legacy Exchange Server and Public Folders.

 The Migration process:
  1. Download the migration Scripts;
  2. Prepare the Migration;
  3. Generate the CSV files;
  4. Create the Public Folders Mailboxes in Exchange 2013;
  5. Start the Migration;
  6. Lock the Public Folders to Finalize the migration (requires downtime);
  7. Finalize the Migration;
  8. Unlock and Test the Public Folders.

Side Notes:
  • Can not exist Public Folders in Exchange 2013 before the migration;
  • All DNS Records must "point" to Exchange 2013 (like webmail, autodiscover, etc.);
  • For some reason, if there are any Mailbox in Exchange Legacy, the public folder will be pointing to the Exchange Legacy;
  • If there are Public Folders already created in Exchange 2013, all Migrated Mailboxes will automatically be pointing to the Exchange 2013 Public Folder instead of Exchange Legacy.

 
Ok, now that we have all the requirements, let's start!


  • Scripts
Download the Migration Scripts (http://go.microsoft.com/fwlink/?LinkId=299838) and put them in the Exchange 2013 server: C:\Program Files\Microsoft\Exchange Server\V15\Scripts

  • Snapshot the Public Folder Structure (Directories and Permissions) (EXC2010 Shell)
Get-PublicFolder -Recurse | Export-CSV C:\PFMigrationEx2010_PFStructure.csv

Get-PublicFolder -Recurse | Get-PublicFolderStatistics | Export-CSV C:\PFMigrationEx2010_PFStatistics.csv

Get-PublicFolder -GetChildren | Get-PublicFolderClientPermission | Select-Object Identity,User -ExpandProperty AccessRights | Export-CSV C:\PFMigrationEx2010_PFPerms.csv


Example of the PFMigrationEx2010_PFStructure.csv (File not Complete)

#TYPE Microsoft.Exchange.Data.Mapi.PublicFolder
"PSComputerName","RunspaceId","AgeLimit","EformsLocaleId","EntryId","HasSubFolders","HiddenFromAddressListsEnabled","IssueWarningQuota","LocalReplicaAgeLimit","MailEnabled","MaxItemSize","Name","ParentPath","PerUserReadStateEnabled","ProhibitPostQuota","Replicas","ReplicationSchedule","RetainDeletedItemsFor","UseDatabaseAgeDefaults","UseDatabaseQuotaDefaults","UseDatabaseReplicationSchedule","UseDatabaseRetentionDefaults","FolderType","HasRules","HasModerator","Identity","MapiIdentity","OriginatingServer","IsValid"
"exc2010....","bb176de7-6cde-464b-864c-2c3bd159e1da",,,"
...


Example of the PFMigrationEx2010_PFStatistics.csv (File not Complete)

#TYPE Microsoft.Exchange.Data.Mapi.PublicFolderStatistics
"PSComputerName","RunspaceId","AdminDisplayName","AssociatedItemCount","ContactCount","CreationTime","DeletedItemCount","EntryId","ExpiryTime","FolderPath","IsDeletePending","ItemCount","LastAccessTime","LastModificationTime","LastUserModificationTime","LastUserAccessTime","Name","OwnerCount","TotalAssociatedItemSize","TotalDeletedItemSize","TotalItemSize","ServerName","StorageGroupName","DatabaseName","Identity","MapiIdentity","OriginatingServer","IsValid"
"exc2010....","bb176de7-6cde-464b-864c-2c3bd159e1da","AI","0","1","29-04-2004 12:26:32","0","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000410550000",,"AI","False","0","18-11-2014 14:25:10","17-11-2014 10:59:28",,,"AI","1","0 B (0 bytes)","0 B (0 bytes)","0 B (0 bytes)",,,"PublicFolder","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000410550000","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000410550000","exc2010apdl.apdl.pt","True"
"exc2010apdl.apdl.pt","bb176de7-6cde-464b-864c-2c3bd159e1da","2006","0","1","12-01-2007 10:07:26","0","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000B2B830000",,"AI\2006","False","96","18-11-2014 14:25:10","17-11-2014 10:59:29",,"17-11-2014 11:00:14","2006","1","0 B (0 bytes)","0 B (0 bytes)","491 KB (502,733 bytes)",,,"PublicFolder","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000B2B830000","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000B2B830000","exc2010apdl.apdl.pt","True"
"exc2010....","bb176de7-6cde-464b-864c-2c3bd159e1da","NaoConcluidos","0","1","15-01-2007 11:49:02","0","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000B2BC20000",,"AI\2006\NaoConcluidos","False","16","18-11-2014 14:25:10","17-11-2014 10:59:29",,"17-11-2014 14:46:22","NaoConcluidos","1","0 B (0 bytes)","0 B (0 bytes)","267.3 KB (273,759 bytes)",,,"PublicFolder","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000B2BC20000","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000B2BC20000","exc2010apdl.apdl.pt","True"
"exc2010....","bb176de7-6cde-464b-864c-2c3bd159e1da","2007","0","1","24-04-2007 16:36:38","0","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000BD0120000",,"AI\2007","False","6","18-11-2014 14:25:10","17-11-2014 10:59:29",,"17-11-2014 11:00:16","2007","1","0 B (0 bytes)","0 B (0 bytes)","28.02 KB (28,693 bytes)",,,"PublicFolder","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000BD0120000","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000BD0120000","exc2010apdl.apdl.pt","True"
"exc2010....","bb176de7-6cde-464b-864c-2c3bd159e1da","2008_aEliminarQdTerminar","0","1","04-03-2008 10:27:16","0","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000D529E0000",,"AI\2008_aEliminarQdTerminar","False","0","18-11-2014 14:25:10","17-11-2014 10:59:29",,,"2008_aEliminarQdTerminar","1","0 B (0 bytes)","0 B (0 bytes)","0 B (0 bytes)",,,"PublicFolder","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000D529E0000","000000001A447390AA6611CD9BC800AA002FC45A03005F3135D1275278468DED2F8D6A0A560E0000000D529E0000","exc2010apdl.apdl.pt","True"
...

Example of the PFMigrationEx2010_PFPerms.csv (File not Complete)

#TYPE Microsoft.Exchange.Management.MapiTasks.PublicFolderAccessRight
"Identity","User","Permission","IsRole"
"\AI","Default","None","False"
"\AI","teste.com/{Security Boundary}/[ Utilizadores]/DI/{AD Manageability}/DSC/user","ReadItems, CreateItems, EditOwnedItems, DeleteOwnedItems, EditAllItems, DeleteAllItems, CreateSubfolders, FolderVisible","True"
"\AI","teste.com/{Security Boundary}/[ Utilizadores]/AIQ/user2","ReadItems, FolderVisible","True"
"\AI","teste.com/{Security Boundary}/[ Utilizadores]/DI/Utilizadores/user3","ReadItems, FolderVisible","True"
"\AI","teste.com/{Security Boundary}/[ Utilizadores]/AIQ/user4","ReadItems, CreateItems, EditOwnedItems, DeleteOwnedItems, EditAllItems, DeleteAllItems, CreateSubfolders, FolderOwner, FolderContact, FolderVisible","True"
"\AI","Anonymous","None","False"
...

  • Remove from all the Public Folders names that contain "\": (EXC2010 Shell)
Get-PublicFolderStatistics -ResultSize Unlimited | Where {$_.Name -like "*\*"} | Format-List Name, Identity

  • Check that there is no Pendent Migrations: (EXC2010 Shell)
Get-OrganizationConfig | fl PublicFoldersLockedforMigration, PublicFolderMigrationComplete


Is the output is False, then you are good to go. Otherwise you must run the following command (it can take some time to run):

Set-OrganizationConfig -PublicFoldersLockedforMigration:$false -PublicFolderMigrationComplete:$false

  • Check that there are no Public Folders in Exchange 2013 (EXC2013 Shell)
Get-PublicFolderMigrationRequest

Get-Mailbox -PublicFolder

Get-PublicFolder

  • If there are PF in EXchange 2013, we need to remove them all: (EXC2013 Shell)
Get-PublicFolderMigrationRequest | Remove-PublicFolderMigrationRequest -Confirm:$false

Get-MailPublicFolder | where $_.EntryId -ne $null | Disable-MailPublicFolder -Confirm:$false

Get-PublicFolder -GetChildren  | Remove-PublicFolder -Recurse -Confirm:$false

Get-Mailbox -PublicFolder |Remove-Mailbox -PublicFolder -Confirm:$false

  • Run some of the Scripts that you downloaded previously: (EXC2010 Shell)
.\Export-PublicFolderStatistics.ps1 C:\PFSTATS.csv <NAME_SERVER_EXC 2010>

Example of the PFSTATS.csv  (File not Complete)

"FolderName","FolderSize"
"\IPM_SUBTREE","0"
"\IPM_SUBTREE\AI","0"
"\IPM_SUBTREE\AI\2006","502733"
"\IPM_SUBTREE\AI\2006\NaoConcluidos","273759"
"\IPM_SUBTREE\AI\2007","28693"
"\IPM_SUBTREE\AI\2008_aEliminarQdTerminar","0"
"\IPM_SUBTREE\AI\2008_aEliminarQdTerminar\ComProcedNaoConcluído_N_eliminar","75762"
"\IPM_SUBTREE\AI\Contactos AI","74767"
"\IPM_SUBTREE\AI\Form_R","1787803"
"\IPM_SUBTREE\aspnet_client","0"
"\IPM_SUBTREE\aspnet_client\system_web","0"
"\IPM_SUBTREE\aspnet_client\system_web\4_0_30319","0"
"\IPM_SUBTREE\DCFC","0"
"\IPM_SUBTREE\DCFC\Formacao","43146"
...

  • Review the Total size of each directory and decide the size of your Public Folder. For instance, if you have 20GB of data in the Public Folder and you choose a size of 1GB per Mailbox, I will need 20 Mailboxes. In this case I'm going to create a single Mailbox of 10GB. A maximum size of each Mailbox is 25GB. Another example, if we have a 1TB Public Folder in Exchange 2010, we will need 40 Mailboxes of 25GB each, in Exchange 2013;

  • Copy all the CSV Files from Exchange 2010 to Exchange 2013 and Run the following Script that you downloaded previously: (EXC2010 Shell)
.\PublicFolderToMailboxMapGenerator.ps1 10000000 C:\PFSTATS.csv C:\PFMailboxMap.csv
The number 10000000 = 10GB Mailbox
PFSTATS.csv = File generated earlier in Exchange 2010
PFMailboxMap.csv = New File generated in Exchange 2013 with the Number of Mailboxes


Example of the PFSTATS.csv File (File Complete)

FolderPath,"TargetMailbox"
\,"PublicFolderMailbox01"
\IPM_SUBTREE," PublicFolderMailbox02"

  • Create Mailboxes as the previous file (the name of Mailboxes must be equal to the file!)
New-Mailbox -PublicFolder PublicFolderMailbox01 -HoldForMigration:$true –Database "NAME_DB"

New-Mailbox -PublicFolder PublicFolderMailbox02 -HoldForMigration:$true –Database "NAME_DB"


  • To prevent that users have the warning in Outlook "The Microsoft Exchange Administrator has made a change that requires you quit and restart Outlook" you can run the following commands:
Set-Mailbox PublicFolderMailbox01 –PublicFolder –IsExcludedFromServingHierarchy:$True

Set-Mailbox PublicFolderMailbox02 –PublicFolder –IsExcludedFromServingHierarchy:$True

  • Migrate the Public Folders
New-PublicFolderMigrationRequest -SourceDatabase (Get-PublicFolderDatabase -Server <SRV_EXC_2010>) -CSVData (Get-Content C:\PFMailboxMap.csv -Encoding Byte) -AcceptLargeDataLoss -BadItemLimit 1000
PFMailboxMap.csv = Previously generated file
BadItemLimit 1000 = Invalid Items in the Public Folders that you can permit.

  • Migration will start and then it will be in AutoSuspended State (after some minutes, it will depend how big is the Public Folder) and then we can move forward. You can check the migration with the commands:
Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics -IncludeReport | fl

Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics | ft -auto


  • If you have problems in the migration, you can look for more details:
Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics | fl failure*

  • From this point will be Downtime. The following command will Logoff all the Users in Public Folders and denies access till the migration ends: (EXC2010 Shell)
 Set-OrganizationConfig -PublicFoldersLockedForMigration:$true

  • Resume the Migration: (EXC2013 Shell)
Set-PublicFolderMigrationRequest -Identity \PublicFolderMigration -PreventCompletion:$false

Resume-PublicFolderMigrationRequest -Identity \PublicFolderMigration

  • Check the Logs and Errors:
Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics -IncludeReport | fl

Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics | ft -auto

  • If the database is still in Lock state, it is necessary to wait a few minutes or restart the Microsoft Exchange Information Store service

  • When the migration ends:
Set-Mailbox PublicFolderMailbox01 –PublicFolder –IsExcludedFromServingHierarchy:$False
Set-Mailbox PublicFolderMailbox02 –PublicFolder –IsExcludedFromServingHierarchy:$False

  • Check the Exchange 2013 Web Console that all Public Folders Mailboxes and the entire directory structure were created successfully:



  • Complete the Migration:
Set-OrganizationConfig -PublicFolderMigrationComplete:$true

  • Close and Open Outlook and Validate that has access to Public Folders
  • In OWA 2013 the Public Folders do not appear automatically. You must add them to Favorites
  • If you have this error in Outlook when opening the Public Folders: "Can not expand this folder in Outlook Public Folders", check the following
Set-OrganizationConfig -PublicFolderMigrationComplete:$true
(in Exchange 2013 and Exchange 2010)

Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics -IncludeReport | fl

Get-PublicFolderMigrationRequest | Get-PublicFolderMigrationRequestStatistics | ft –auto
 
  • Close and Open Outlook and Validate again the access to Public Folders.
  • Remove Old Public Folders from Exchange 2010 or 2007 (depending of the Exchange Legacy version you are migrating)


If you need to Rollback (hope not!) here are the steps:

  • Remove the Lock: (EXC2010 Shell)
Set-OrganizationConfig -PublicFoldersLockedForMigration:$False

Set-OrganizationConfig -PublicFolderMigrationComplete:$False

  • Remove the Exchange 2013 Public Folders: (EXC2013 Shell)
Get-PublicFolderMigrationRequest | Remove-PublicFolderMigrationRequest -Confirm:$false

Get-MailPublicFolder | Disable-MailPublicFolder -Confirm:$false

Get-PublicFolder -GetChildren  | Remove-PublicFolder -Recurse -Confirm:$false

Get-Mailbox -PublicFolder |Remove-Mailbox -PublicFolder -Confirm:$false

  • Restart Outlook.
Side Note: After the migration, all the changes in Exchange 2013 PF are not replicated to Exchange 2007/2010, so you can lose data in the Rollback.


And that's it! Easy wasn't it?

No comments:

Post a Comment