Thursday, May 16, 2013

Exchange 2010 - migration from 2007 - Public Folders - PART 1

In Exchange 2013, Public Folders are now part of mailbox databases. I think that's a good thing. I've practiced migrating Public Folders several times, most often manually, using the EMC (create a public folder database on the target server, create replicas, allow replication to take place, remove public folder items on the source server to be decommissioned). In this post, I'll relate my experiences using some of the scripts meant to facilitate Public Folder migration... to an extent.
 
 
Here is the procedure followed. And here are the problems encountered.


Preliminary Steps: creating a Public Folder database on the Exchange 2010 server
 

1. Create a folder (or "directory") for the Public Folder database and log files.

New-Item -type directory -path C:\EXPFDB10

In production, it may be preferable to store the database file and the log files on separate disk arrays. However, improvements in IOPS (disk performance) in Exchange 2010 may make this unnecessary, especially if Public Folders are not heavily used.
 

2. Create a new Public Folder database

New-PublicFolderDatabase "EXPFDB10" -Server EX10C -EdbFilePath "C:\EXPFDB10\EXPFDB10.edb" -LogFolderPath "C:\EXPFDB10"

 
3. Mount the Public Folder database

The Public Folder database is not mounted by default at the time of its creation:

Get-PublicFolderDatabase EXPFDB10 -status | fl *mounted*
Mounted         : False

So we need to run the following command:

Mount-Database EXPFDB10

This mounts the Public Folder database:

Get-PublicFolderDatabase EXPFDB10 -status | fl *mounted*
Mounted         : True

 
Note that in the EMC, it is not necessary to mount the Public Folder database separately provided that you leave the "Mount this database" box checked (it is by default).
 
 
 
 
At this point, we can see the existing Public Folders by running the following commands on either server (EX1 - E2K7 or EX10C - E2K10). However, only EX1 has a replica of each of the public folders at this time. If we want to migrate to EX10C, we need replicas on both servers for the duration of the migration process.

 
Get-PublicFolder -Recurse | fl name,replicas


Name : IPM_SUBTREE
Replicas : {}

Name : PF1-Mail
Replicas : {ex1\SG1\PFDB1}

Name : PF-Contacts
Replicas : {ex1\SG1\PFDB1}




Get-PublicFolder \Non_IPM_Subtree -Recurse | fl name,replicas

Name : NON_IPM_SUBTREE
Replicas : {}

Name : EFORMS REGISTRY
Replicas : {}
Name : Events Root
Replicas : {ex1\SG1\PFDB1}

Name : OFFLINE ADDRESS BOOK
Replicas : {}

Name : /o=MYNET/cn=addrlists/cn=oabs/cn=Default Offline Address Book
Replicas : {ex1\SG1\PFDB1}

Name : OAB Version 2
Replicas : {ex1\SG1\PFDB1}

Name : OAB Version 3a
Replicas : {ex1\SG1\PFDB1}

Name : OAB Version 4
Replicas : {ex1\SG1\PFDB1}

Name : EX:/o=MYNET/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)
Replicas : {ex1\SG1\PFDB1}

Name : OWAScratchPad{D8D68C82-417C-4E72-8222-E10945235D4A}
Replicas : {ex1\SG1\PFDB1}

Name : SCHEDULE+ FREE BUSY
Replicas : {}

Name : EX:/o=MYNET/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)
Replicas : {ex1\SG1\PFDB1}

Name : schema-root
Replicas : {ex1\SG1\PFDB1}

Name : microsoft
Replicas : {ex1\SG1\PFDB1}

Name : StoreEvents{D8D68C82-417C-4E72-8222-E10945235D4A}
Replicas : {ex1\SG1\PFDB1}

Name : globalevents
Replicas : {ex1\SG1\PFDB1}

Name : internal
Replicas : {ex1\SG1\PFDB1}


One comment: I created two test Public Folders, PF1-Mail (mail-enabled) and PF-Contacts. These are Public Folders with content for use by company staff. They are located in the "IPM_SUBTREE". In the Public Folder Management Console (EMC), they are located under the "Default Public Folders" parent folder. The other Public Folders are system folders and are located in the "NON_IPM_SUBTREE". In the PFMC, there are the "System Public Folders".
 
 
 

Most of these folders do not need to be migrated to the Exchange 2010 server. Even if your OAB is distributed by Public Folders, only these folders need to be migrated:


That is, in addition to the public folders that you've created and that contain your data.
 
Of course, if you do not use Public Folders for OAB distribution, these folders may not even exist (before I selected the Public Folder option for OAB, the "OAB version x" folders did not exist).
 
Therefore, when showing Powershell output, I will not reproduce the entire System Public Folder structure from now on.
 
 
 
Moving Public Folders with the MoveAllReplicas.ps1 script
 
 
This is where I encountered problems.
 
 
4. Execute the MoveAllReplicas.ps1 script - to move replicas from EX1 to EX10C 
 
 
I executed the following scripts after browsing to the "Scripts" subfolders here:
 
C:\Program Files\Microsoft\Exchange Server\V14\Scripts>.\MoveAllReplicas.ps1 -Server EX1 -NewServer EX10C
 
 
5. Change mailbox database settings so the EX10C public folder database is selected:
 

Set-MailboxDatabase -PublicFolderDatabase 'EXPFDB10' -Identity 'MBDB1'

This associates the new public folder database on the Exchange 2010 server - EX10C - with the mailbox database used by migrated users.
 
 
 Surprise:

  • A copy of the Public Folder structure is created on EX10C.
  • On each server (EX1 and EX10c), in the properties of each public folder, only the server in question appears to have a replica (EX1 on EX1 and EX10C on EX10C). Note: this is under the replication tab.
  • The content is not moved (mail and contacts in public folders created for this operation).

 
On EX1:

Get-PublicFolder -Recurse | fl name,replicas


Name : IPM_SUBTREE
Replicas : {}

Name : PF1-Mail
Replicas : {PFDB1}


Name : PF-Contacts
Replicas : {PFDB1}


On EX10C:


Get-PublicFolder -Recurse | fl name,replicas


Name : IPM_SUBTREE
Replicas : {}

Name : PF1-Mail
Replicas : {EXPFDB10}

Name : PF-Contacts
Replicas : {EXPFDB10}

 
This is also the case for the NON_IPM_SUBTREE folders. For concision, I will not reproduce the rather lengthy output here.

But in case you prefer the EMC/GUI, here is what you would see:





There is no replica for EX10C (Exchange 2010) on the EX1 server (Exchange 2007). Therefore, it appears that replication cannot take place. Indeed, as far as I could see, replication was not taking place. Likewise, on the Exchange 2010 server, there was no replica for EX1.

I updated hierarchies, refreshed, waited... nothing seemed to work.

---------

6. Add the Exchange 2010 server as a replica

After a number of attempts with other scripts and cmdlets, I end up adding replicas manually in the EMC on the E2K7 server. Like this:







That worked (and allowed replication to take place).
 

Get-PublicFolder -Recurse | fl name,replicas

Name : IPM_SUBTREE
Replicas : {}

Name : PF1-Mail
Replicas : {EXPFDB10, PFDB1}

Name : PF-Contacts
Replicas : {EXPFDB10, PFDB1}
 
It also worked for the NON_IPM_SUBTREE folders as well.
 
 
 
7. Remove the Exchange 2007 as a Public Folder replica
 
 
So now we can remove EX1 as a Public Folder replica for the IPM_SUBTREE folders with this script:
 
 
[PS] C:\Program Files\Microsoft\Exchange Server\Scripts>.\RemoveReplicaFromPFRecursive.ps1 -TopPublicFolder "\" -ServerToRemove "EX1"

 
Note: this script only removes EX1 from the default folders, not the System Folders...
 
 
After more problems with scripts and cmdlets, I finally removed those manually in the EMC as well.





Repeat as needed to remove the EX1\SG1\PFDB1 replica on the other public folders.
 
Now we are ready to remove the Public Folder database on the Exchange 2007 server - EX1 in our example.



At this point, the Public Folder database could not be removed because the "Events Root" subfolder of "System Public Folders" could not be deleted.

The problem is similar to the one discussed here:

http://social.technet.microsoft.com/Forums/en-US/exchange2010/thread/a7840873-69bd-46b3-b26e-38644fa931b2/#5bdd825a-29b0-4ed9-938e-89b5022c46e1

I am considering the best way to proceed. Deleting the public folder database in ADSIEdit may resolve the issue in the short term but can also leave traces in Active Directory, something that should be avoided if possible according to others (including an Exchange MVP).

 





2 comments:

  1. Really great information, it explain that how to migrate public folder from exchange 2007 to exchange 2013. I found the proficient exchange server migration tool from http://www.lepide.com/exchange-manager/ which provides the facilitate to migrate public folder data from exchange 2010 server to another live exchange server. This tool easily fix all kinds of exchange server corruption issues without any hassle.

    ReplyDelete
  2. Thanks David for writing this article.
    I have a little shop in which I have recently installed new Exchange 2010. Therefore I was searching for a way to migrate from Exchange 2007 to 2010, and this article helped me to do this.
    I am not a deep diving technical person therefore I was unable to follow each and every step during migration. Actually, one of my friend helped me to do this and he suggested me to purchase a tool which could export exchange server mailboxes into PST in a good way. After exporting I imported all PST files into newly Installed Exchange server 2010 and then configured all other services.

    ReplyDelete