As we discussed in previous article
We had to move public folder database out of CAS server to some other server that didn't had the CAS role.
So here is the approach that we have used for doing it, this approach can only be used if you have multiple replicas of Public folder database.
Open shell & change the directory where exchange scripts are present
.\MoveAllReplicas.ps1 -Server OldServer -NewServer NewServer
Note:- Public folder database must be created on the new server(than only above command will work)
Reference Shell command for creating Public folder database: New-PublicFolderDatabase Nameofdb -server nameofserver -EdbFilePath e:\pf\pf.edb -LogFolderPath e:\pf
MoveAllReplicas.ps1 --> will remove the old server name as replica & adds the new server in the list of replicas. It will take time for replication to complete & populate the new Public folder database.
In our case 45 GB of content took a complete day to get replicated.
You can use below command to check the status of new server & old server
Get-PublicFolderStatistics -Server servername
Old server should not display anything, it means replication has been moved to new server. (you can remove the old database after checking it)
If you found some public folders that are still using old server than fix them individually to use new server as replication partner & remove old server from replica list.
For replication to complete you have to wait & be patient.