I have a production org to which i deployed metadata from dev sandbox using Ant. There is no connection between dev sandbox and production. How can i refresh the production org to a starting point ?


To delete components, use the same procedure as with deploying components, but also include a delete manifest file that’s named destructiveChanges.xml and list the components to delete in this manifest. The format of this manifest is the same as package.xml except that wildcards aren’t supported.

The following sample destructiveChanges.xml file names a single custom object to be deleted:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">

To deploy the destructive changes, you must also have a package.xml file that lists no components to deploy, includes the API version, and is in the same directory as destructiveChanges.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">

Source: https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/daas_destructive_changes.htm


You cannot do that, depending on what changes you pushed from the sandbox you either have to go manually and delete any configuration steps or use destructive changes with Ant in order to delete any Apex class or Apex trigger.


I think you can do this..!! (not tested)

As you mentioned that this is using ant deployment, you can perform an ant undeployment, so that whatever you specify in ant undeploy package xml it will be removed from the Production org, let me know if it helps.

The build xml for undeploy looks something like this

<!-- This will be used to undeploy any code base from an org. -->
    <!-- Please make sure desctructive folder is present with destructive xml -->
    <target name="undeploy">
        <sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" deployRoot="destructive"/>

Let me know if it helps.

Thanks. Ray

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.