Monday, August 5, 2013

Move Public Folder Content from One Public Folder Database to Another Public Folder Database

Use the MoveAllReplicas.ps1 script to move all public folder content from one server to another server
 

To move all public folders in a public folder database on one server to a public folder database on another server, use the MoveAllReplicas.ps1 script. This script replaces a server with a new server in the replication list for all public folders, including system folders. For more information about using public folder scripts, see Scripts for Managing Public Folders in the Exchange Management Shell.

This example moves all public folder content from Server01 to Server02.

cd $EXscripts

.\MoveAllReplicas.ps1 -Server Server01 -NewServer Server02
 
If you are move from Exchange 2007 to Exchange 2010, you had better run the scripts from Exchange 2010 servers.
 
However, I would prefer you run the following script first, and make sure all public folders including system folders are replicated to new server first,
 
1. run Get-PublicFolder -Server OldPFServername -Recurse | FL Name,Replicas
 
If there is any issue, fix it first, say, some of old PF folders may contain leading or trialing whitespace that no longer support in new Exchange server.
 

WARNING: The Name property
contains leading or trailing whitespace, which must be removed.
 

2. use AddReplicaToPFRecursive.ps1 to replicate all Folders to new server
 
[PS] C:\Program Files\Microsoft\Exchange Server\V14\Scripts>.\AddReplicaToPFRecursive.ps1
 

AddReplicaToPFRecursive.ps1 -Server "MyEx2007Server" -TopPublicFolder "\" -ServerToAdd "MyEx2010Server"
 
3.\AddReplicaToPFRecursive.ps1 -Server "MyEx2007Server" -TopPublicFolder "\NON_IPM_Subtree" -ServerToAdd "MyEx2010Server"
 
The above command will add replica of all public folders to exchange 2010 public folder database.
Once the replica is added you can move the replica from Exchange 2007 to Exchange 2010. To do this execute the below EMS command:

4. .\MoveAllReplicas.ps1 -Server "MyEx2007Server" -NewServer "MyEx2010Server"
 
 

OfflineAddressBook, PublicFolderDatabase still points to old Exchange server

 
After migrating your Exchange server   (I've seen this in transition  from Exchange 2003 to Exchange 2007 and from Exchange 2007 to 2010) the PublicFolderDatabase for your OfflineAddressBook is still pointing to the old servers public folder store.
 
When you run the get-OfflineAddressBook | fl command or Get-OfflineAddressbook | FL Server, *public* |FL in an exchange management shell on your new server, you get a result like this:
 
At Server you see the new servername and the PublicFolderDatabase is still pointing to your old server. Public folder replica's and offline address book generation server are already moved to the new server.
 
Solutions: I found if you do the following steps you can change the PublicFolderDatabase.
 
1. Start adsiedit and browse to CN=Configuration, CN=Services, CN=Microsoft Exchange, CN=First Organization, CN=Address Lists Container, CN=Offline Address Lists and open the properties of CN=Default Offline Address List Look for the siteFolderServer attribute, here you will see the old public folder store.
 
2. Choose clear and close with ok, now you may close adsiedit.
 
3. Go to the exchange management console, Organization Configuration, Mailbox, Offline Address Book open the properties of the Default Offline Address List and go to the tab distribution. Uncheck "Outlook version 2 and 3″ at client support and "Enable public folder distribution". Make sure "Web-based distribution" is enabled. Choose apply and ok, then right click on Default Offline Address List and choose update.
4. Go back to properties and distribution and recheck "Outlook client support version 2 and 3″ and "Enable public folder distibution". Again choose apply and ok and right click and choose update. When you go back to the exchange management shell and repeat Get-OfflineAddressbook | FL Server, *public* |FL  now you now will see the PublicFolderDatabase is  pointing to your new public folder server now.