So you’re in the Public Folder migration mess? No matter if you’re going from Exchange 2003 to 2010 or between Exchangen 2010 servers, it’s always complicated.

Maybe you’ve followed Microsoft suggestion. In step 1 use .\AddReplicaToPFRecursive.ps1 to add the new server as a replica. Wait for a lot of time for it to finish… Great!

Step 2 starts with “after you confirmed that all the PF have been replicated you can move all replicas…” Ok, but how do you check if all data has been replicated? Sure, you could open up two Outlook clients on seperate computers where one is connected to the source server and the other one connected to the PF replica and then do it manually. But what if you have thousands of folders and thousands of folders? Not really practical! (Update July 21st 2013: Seems like Microsoft heard me because they written an article around it here and I suggest you read that in addition to mine)

So if you want to be very careful, you can compare the two folder structures and content. Here’s how…

What we will do here is that we will export public folder structure + number of items in each public folder to a tab-delimited file of both SOURCE and REPLICA server. Then we will use Excel to compare the two. Sure, it’s manual work and not 100% accurate since you will only see the number of items, not that it’s actually the same item – but still, better than nothing and you will definitely notice if a folder on the SOURCE side has hundres of items and the REPLICA has much fewer.

  1. When you have let the Public Folders replicate for a while, choose a period of the week where activity is quite low since replication of Public Folders does not occur that, minimum 15 minutes. So there might be occasions when you have an item added to the SOURCE, but it will take some time before it turns up in the REPLICA. By doing the export when you know activity is low, you minimize the risk of this happening.
  2. To export the Public Folder structure, you need to download a tool:
  3. Notes on running PFDAVAdmin:
    • You can download and extract it to almost any machine, including a client machine or the Exchange 2003 server itself.
  4. Notes on running ExFolders tool (from the Readme.txt):
    • Has to run on an Exchange server that has Microsoft Exchange Active Directory Topology service running, which means it will not currently run on a tools-only install.
    • ExFolders.exe must be placed in the server’s Exchange \bin folder.
    • This build is not signed. In order to allow it to run, you can import the included .reg file on the server where you want to run the tool
  5. In both tools, choose File -> Connect to connect to each Exchange server respectively. Make sure you select a user with full access to the whole Public Folder structure. Difference in the Connect dialog between PAFDAVAdmin and ExFolders. In ExFolders, make sure you connect to the correct Public Folder database.
  6.  It should connect and you should be able to browse the structure:
  7. Notice there’s one additional choice in the Tools menu of ExFolders:
  8. In both PFDAVAdmin and ExFolders, choose Tools -> Content Report. Here you can choose to export everything or just the selected folder. Maybe you con’t want to compare everything but just some important folders? It’s up to you but make sure to at compare the same folder(s).
  9. After the export you have two tab-delimited files that you can compare. And what is not better to use than Excel to compare them.

How to compare tab-delimited files using Excel

So you have PFDAVAdmin_export.txt and ExFolders_export.txt and you want to compare them. Excel is extremely powerful in situations like this. I will not go into details regarding Excel but please comment if you want me to clarify something.
  1. Open up Excel. Create two tabs, SOURCE and REPLICA.
  2. On the SOURCE tab, choose Data -> From Text and import PFDAVAdmin_export.txt. Choose Delimited, Next>, Tab, Finish.
  3. On the REPLICA tab, do the same but for ExFolders_export.txt.
  4. I tend to change the size of the columns and change font to size 8 to get a better overview.
  5. Also, you should select Column A and choose Sort A to Z and expand the selection so you have the same order to make it easier to browse.
  6. If you review the columns, you will figure out that the important columns are the following and those are the one you want to compare:
      There are a few other ones which might be good for troubleshooting but things like size tend not to always be exactly the same.
  7. But first, you must check the number of rows – are they the same? I have found that PFDAVAdmin sometimes export structures from content not on the local server and ExFolder doesn’t so before we do some comparison, check this so we don’t have some extreme differences here. But besides that, the number of folders should match – otherwise something is wrong (maybe some folders are not replicating at all?) and you need to fix that before continuing.
  8. So before each “interesting” column above, add another column to the left of that and there we should add a formula that compares the two tabs. Example:
  9. On both tabs, add columns left of the two important columns so it looks like this:
  10. On the REPLICA tab, perform the folloiwing:
  11. In B column, write the following formula and drag it to the bottom:
  12. In D column, write the following formula and drag it to the bottom:
    =IF(E2=SOURCE!E2;”SAME”;”***NOT SAME***”)
  13. Check B column – does all of them say EXIST. This check is only to double check that you did steps to sort the order and check the number of rows :).
  14. But the interesting part is column D where you can see if the number of items doesn’t match.

Now, you might get a lot of folders which are ***NOT SAME*** which could be perfectly normal. I’ve seen situations where if differs on a few items but when actually checking with Outlook, the number of items are the same. You could add a column F and add formula and drag it to the bottom to see number of items it differs and maybe just skip those with only 1-2 items difference:

If you notice some folders not updating – time to troubleshoot but that’s out of scope for this article. There are plenty of guides how to figure out which items are causing the folders not to be up to date.