Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

As we know there are two ways to deploy the code from Sandbox to Production

  1. Using Ecclipse
  2. Using ChangeSet - which is Unidirectional, once committed no changes can be rolled back from Production

Ref - : https://login.salesforce.com/help/doc/en/changesets_implementation_notes.htm

Can anybody advice, what the best practice if we want to roll back the commmitted changes in Prodcution and to make problem specifically more clear. I

share|improve this question
4  
It looks like your question got cut off and is missing some details. Can you edit it to complete the question? –  ca_peterson Sep 27 '12 at 3:47

6 Answers 6

A true rollback doesn't necessarily exist in Salesforce. Unfortunately, there are going to be certain aspects of the process that need to be a manual step as they do not currently exist in the API (Approval Process for instance).

However, there are a few steps you can take to mitigate problems you may run into. Obviously, you want to thoroughly test your entire application before you put anything into production. This is also true for your deployment. It is a good practice to do a dry run deploy before you do your final push to production. Make sure everything is fully working and tested in a Sandbox (preferably a recently refreshed Full Copy). It is important to note that once you do your refresh to the Full Copy sandbox that all Prod changes should be stopped. If they are absolute, must-have changes, these changes must also be done in the Sandbox. The goal is to make your sandbox replicate production to find any issues.

Once everything is fully tested, you need a backup of the previous version of the metadata. This can be done a few ways. If this is a long standing application, you may have a tagged version available. If you have an extra sandbox slot available, copying to a developer/config-only sandbox will store the meta data (this would be my preferred approach as not everything is available via the metadata API). You could also do a manual backup just pulling down all of the data using Ant and the Metadata API. Next, you need to make sure you back up your data. You can use the Data Management > Data Export functionality available through the Admin for a weekly export, or you can use the Data Loader. Either way, you are going to want to do a backup of your data.

So, you have everything backed up, but currently you don't have any way to really get the system back into a state that it previously was in. You can now make a destructive changes package file that you can run using Ant to remove all of the recently entered Metadata. Unfortunately, this is just going to remove things and not revert changes you made back to their original version. If you need to compare Metadata versions, you can use a piece of software like SnapShot. Unfortunately, this is all still a very manual process. You need to keep a strict log of all of the changes you are making to revert anything you do if needed.

Salesforce also provides a rollback of data only (NOTE: This is data only. Not Metadata!) for a fee for a 24 hr period as well.

So, the moral of the story is you really don't have a great way of doing rollbacks in Salesforce. At least not in the general sense of normal application development (like replacing a WAR file for a Java app). It is crucial to test heavily well before the production deploy. Regression test everything and keep a good set of unit/integration tests. Good luck!

share|improve this answer

If you upload a unmanaged package and install this unmanaged package into your production org then I think you can rollback by uninstalling this package.

share|improve this answer

Those familiar with ANT migration tool we can use to undeploy the classes ,pages and triggers atleast.

The following is a sample destructiveChanges.xml file that names a single custom object to be deleted: MyCustomObject__c CustomObject 26.0 In order to deploy the destructive changes, you must also have a package.xml file that lists no components to deploy and is in the same directory as destructiveChanges.xml: 26.0

1)Construct the destructive XML for reverting custom object 2)Also to undeploy the code there is a command in ANT tool

share|improve this answer

I don't think there's a way to roll back deployment at all. With the IDE or a Changeset.

share|improve this answer

Not sure completely but I think there is a option when you are working with IDE. Let's say I've deployed the complete source to target org, but now I want to delete some classes and pages.

First delete those classes and pages from IDE/Server(developer org) and then deploy the complete source again, it will show up the difference and classes and pages in red which are on production(target org) but not on sandbox(developer org). You can then select those and continue the deployment. it will delete all those components from production (if there is no dependencies).

Rolling back the changes is possible by deploying the source from last submitted code in repository.

share|improve this answer

Wondering - I believe salesforce should give at minimum one backup button for a changset. Let say, if I only want to rollback the changeset I just deployed, its a pain .

Best Practice Include

  1. When Deploying Apex components, deploy through SF IDE, check backup options before deploying

  2. As proposed, on the AppExchange, DreamFactory allows to snaps of the your existing classes and trigger, read more on it on the Appexchange page

Though we use a little expensive tool called - DreamFactory

http://appexchange.salesforce.com/listingDetail?listingId=a0N300000016cejEAA

Problem - Far as deploying with change-set is concerned, long as we deploy code, it is easier, but lets say i deploy reports in Salesforce with some configuration. This is pretty hard to manage without any concrete app or tool

share|improve this answer
    
This isn't really an answer to the question - would be better suited to the Idea Exchange –  metadaddy Jan 29 '13 at 20:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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