Thursday, September 8, 2011

Exchange 2007 to Exchange 2010 Public Folder Migration

This Episode

This episode of UTM comes from a recent experience when migrating a customers HUGE public folder database during an Exchange 2007 to 2010 migration.  Doing it manual wasn’t a solution and how I pulled if off, way to easy.

The Delima

This customer had WAY too many public folders to go in and manually create the boring task of manually tying the replication together.  So I thought back to this great PS1 script that had so much promise.  I went in, ran the script, it ran w/o issue.  Waited several hours, no such luck.  So I sat down this morning and said to myself, there has to be a way to do this and I put my mind to sitting down and working on it.

The Stage

You must have a working Exchange 2010 and built a Public Folder Database on the new server. 
EXCHMB01 = Exchange 2007 Mailbox Server (Old)
EX-MB-01 = Exchange 2010 Mailbox Server (New)
Moving from Exchange 2007 to Exchange 2010.  If you didn’t read above!

The Solution

My PowerShell skills are a 7 out of 10, so there may be a few steps that are easier that I make them, but this is how I did it and it worked, so here we go.

Setting the stage

To make life easier and to make sure that I named things correctly, I used a bit of manual configuration for the first step.
  1. Open EMC (Exchange Management Console)
  2. Open toolbox then open “Public Folder Management Console”
    1. image
  3. We are going to quickly add a manual entry to one of the Public Folders to make it easy to copy and paste DB names and Paths.
  4. Rt. Click a folder on the Right Pane, Click Properties
    1. image
  5. Click the “Add” to add all of your Replicas.  For this instance I have an old server EXCHMB01 (Ex07) and a new Mailbox Server EX-MB-01 (EX10)
    1. image
  6. Now for the fun part.  Like I said these steps might be easier from a CLI, but this way, I can know for sure, just in case not all my Mailbox Servers are Public Folder Replicas.

Setting up the Replicas

  1. Open the ESM
  2. Run the following:
    1. get-publicfolder -recurse |fl Name, Replicas
  3. You will get a full list of all your public folders, find the one you edited in “Set the Stage”
    1. image
  4. Copy the “Replicas data to your clipboard, we will use this for 2 steps.

Making all folders a replica to the new and old server both (For Migration)

When migrating, you temporarily want all data on both Public Folder Databases, so that users in both environments work, using replication to replicate the changes.  So I always setup replicas so that can start replicating as we complete mailbox and other migration tasks.
  1. Open ESM
  2. Run the following:
    1. get-publicfolder -recurse | set-publicfolder -replicas "EX10_PublicDB1","EXCHMB01\Public\Public Folder Database"
  3. It is VERY important to notice 2 things here.  From the copy and paste, you will get {} and will need to put quotes between the databses.
    1. So make sure to edit the part after “Replicas” to Quote and Separate with a comma, each Replica has to be comma separated with quotes around the db
  4. Wait, this will take awhile to run, pending on many things.
  5. You will get some error about “/” can’t be set, that’s fine.
  6. Run the next step to replicate the System Folders
    1. get-publicfolder "\NON_IPM_SUBTREE" -recurse | set-publicfolder -replicas "EX10_PublicDB1","EXCHMB01\Public\Public Folder Database"
  7. It is VERY important to notice 2 things here. From the copy and paste, you will get {} and will need to put quotes between the databses.
    1. So make sure to edit the part after “Replicas” to Quote and Separate with a comma, each Replica has to be comma separated with quotes around the db

Checking your work

  1. Simply run the following:
    1. get-publicfolder –recurse |ft Name, Replicas –auto –wrap
    2. get-publicfolder “\Non_IPM_Subtree” –recurse |ft Name, Replicas –auto –wrap

Removing the Replicas

Once you are done with the Old server and ready to Decommission the old server, you need to remove the old server from the replica list.  To do this you just modify the above syntax how you added them to remove the old server
  1. Open ESM
  2. Run the following:
    1. get-publicfolder -recurse | set-publicfolder -replicas "EX10_PublicDB1"
  3. Notice the missing old server!
  4. It is VERY important to notice 2 things here. From the copy and paste, you will get {} and will need to put quotes between the databses.
    1. So make sure to edit the part after “Replicas” to Quote and Separate with a comma, each Replica has to be comma separated with quotes around the db
  5. Wait, this will take awhile to run, pending on many things.
  6. You will get some error about “/” can’t be set, that’s fine.
  7. Run the next step to replicate the System Folders
    1. get-publicfolder "\NON_IPM_SUBTREE" -recurse | set-publicfolder -replicas "EX10_PublicDB1
  8. Notice the missing old Server!
  9. It is VERY important to notice 2 things here. From the copy and paste, you will get {} and will need to put quotes between the databses.
    1. So make sure to edit the part after “Replicas” to Quote and Separate with a comma, each Replica has to be comma separated with quotes around the db

Checking your work

  1. Simply run the following:
    1. get-publicfolder –recurse |ft Name, Replicas –auto –wrap
    2. get-publicfolder “\Non_IPM_Subtree” –recurse |ft Name, Replicas –auto –wrap

Conclusion

I’m not really sure why this was so hard to find, but the solution is pretty simple.  There are other ways to inject the server names, but for a novice to use this guide and with them possibly not knowing where their Public Folders were located, I wanted to show the GUI part and then the commands using copy and paste on how to build the Replicas.

I hope this helps someone and somebody out there thinks… UTM.