• What is the best way to remove all the customization apex classes / pages from production. One way I know is using eclipse, delete the classes in sandbox and deploy the changes in productions. But its a lengthy process.
  • Is there a way to reset the whole production environment? Something like factory reset?

2 Answers 2


You can use the Metadata API or the sf:deploy task in Ant to write scripts to do this. Its not the same as a reset, but does allow you to effecetively undeploy customisations, by dynamically querying for customisations and build the destructiveChanges.xml file to list things to remove. At Dreamforce 2012 such a tool was presented, the code for it is here.


used to remove all metadata from the org.

usage: ant undeploy

  • woah, this is awesome that they went for tackling this, if only i could up-vote twice!! Mar 6, 2013 at 0:46

Unfortunately there currently isn't a factory reset to clear customizations, although I sure wish there was.

The best way to remove all customizations is through deployments. If it's a known set of classes and customizations you're removing you can script the various steps using the ANT.

  • seems like there are no such specific guidelines or best practices declared by SF
    – Avidev9
    Mar 5, 2013 at 21:28
  • it doesn't help that there isn't a way to get a clean org or change a lot of settings programmatically, looks like @AndrewFawcett has some pretty cool stuff to look at Mar 6, 2013 at 0:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .