I attended the Dreamforce '12 session Team Development and Release Management for ISVs and one segment of the session was about the tools FinancialForce use for blanking an org before deploying a fresh set of metadata.
The github repo with all the resources is here. These are terrific resources and have really given me a head start implementing this internally.
My problem is, I think the object structure of our application is too complicated to be deleted through the metadata api. The delete seems to failing because of Master Detail relationships and rollup summaries. To further complicate matters the rollups span 3 objects e.g Parent-{Child-{Grandchild where the parent rolls up a child-{grandchild rollup field. The implementation is rolling up the earliest date of the grandchildren onto the parent.
My question is, has anyone been able to use the ant migration tool to delete objects with rollup summaries? Or is my problem more sinister because of the error "An unknown exception has occurred."
Here is the debug log from the migration tool:
/var/lib/jenkins/build-tools/undeploy.xml:74: FAILURES:
Error: objects/Parent_c.object(Parent_c):An unknown exception has occurred.
Error: objects/Grandchild_c.object(Grandchild_c):This custom object is summarized by a field in another object. Remove the usage and try again. : Child Custom Fields: End (Rollup). This custom object is summarized by a field in another object. Remove the usage and try again. : Child Custom Fields: Start (Rollup).
Error: objects/Work_Type__c.object(Work_Type__c):An unknown exception has occurred.
Error: objects/Child_c.object(Child_c):This custom object is summarized by a field in another object. Remove the usage and try again. : Parent Custom Fields: Parent End Date. This custom object is summarized by a field in another object. Remove the usage and try again. : Parent Custom Fields: Parent Start Date.
Error: pages/child_view_override.page(parent_phase_view_override):The page you have tried to delete is currently being referenced by a page, custom link, button, web tab, dashboard, SoftPhone layout or custom sidebar component. Please delete the reference before deleting the page.