Here is some notes from a recent issue error, I encountered at a client, doing a decommission of some Exchange 2007 servers.
We had followed the best practices for moving Public Folder database content to new Public Folder databases. But still could not remove the Public Folder databases on some of the Exchange 2007 servers.
The best practices for removing a Public Folder database is:
1. Move the public folder replicas to another server. See my previous post about Public Folder replica management.
2. Associate mailbox databases with another public folder database.
3. Remove the PF database and delete the database files manually.
This error you might see in step 3, when trying to remove the Public Folder database is:
Microsoft Exchange Error
The public folder database ‘Public Folder Database’ cannot be deleted.
Public Folder Database
The public folder database "SERVERNAMESecond Storage GroupPublic Folder Database" contains folder replicas. Before deleting the public folder database, remove the folders or move the replicas to another public folder database. For detailed instructions about how to remove a public folder database, see http://go.microsoft.com/fwlink/?linkid=81409.
If you have followed the best practices and you still cannot remove the Public Folder, check which folders still reside in the database, using:
Get-PublicFolderStatistics –Server SERVERNAME
If the folders left are folders you care about, you should continue troubleshooting replication issues. But if the folders are leftover that you know have been replicated or if it is system folders, such as OWAScratchPad, you can remove them using:
Get-PublicFolderStatistics –Server SERVERNAME | Remove-PublicFolder
Be careful with the above command, since it removes everything left within your Public Folder database.
Now you should be able to Remove the Public Folder database from you Exchange 2007 server.
Other great references on the issue: