Have you ever heard the words “the deployment into production failed because…”? I know I have, and nothing is more frustrating than having something new or some critical fix stuck in the deployment phase.
There are many sophisticated ways to simplify deployments and have continuos integrations. One of the simplest ways to help reduce frustration is by keeping your sandbox and production environment synced. All salesforce instances have many users and, more often than not, many developers and admins constantly making changes. One validation rule, or layout that is in production but not your sandbox can cause lots of little delays that add up to a big headache over time.
The most important thing for deployment is the timing you follow for refreshing your sandboxes. If you organize your work into specific projects and sprints, you can organize the time to refresh with the life cycle of a project. By doing a refresh every couple months you will help ensure development and deployment run smoothly. When scheduling a Salesforce sandbox refresh make sure you like the current state of your production and have a good opening available. Don’t make the mistake of running your refresh in the middle of development or testing. Get a good cadence going and schedule each refresh at a natural point in the project life cycle.
Besides figuring out the right timing, it is also critical to back up your data, including custom settings and metadata, regardless of the type of sandbox. A few lost hours of work here or there can take days to recover if they are wiped out in a sandbox. Run a salesforce export of all important data you need using a dataloader or the salesforce export even if you are using a full sandbox. You may think of it as just a sandbox, but sometimes you have some tweaked settings or record for testing you may have forgotten about, best to have it for reference just in case. The metadata is also very important to back up, due to the fact you are overwriting your sandbox with production metadata and don’t want to lose anything. Eclipse or Mavens Mate are two resources you can use sync your org and pull down all meta data, zip it up, and throw it in your dropbox for safe keeping.
Lastly, after running a refresh, make sure you have it set up into the working condition you want. Restore your test data, users, and settings if needed, and run all your unit tests and functional user stories. Check to make sure you get rid of any personal or company critical identifying data such as client emails, and any post configuration for messaging and batch jobs. A Stack Exchange Post, although a little dated, has some post install points that you can check to make sure your sandbox is not doing anything you don’t want it to.
By following these suggestions you will have a fresh new sandbox ready for round 2 of your new features and fixes. A few hours every couple of months can keep you from the headache of a botched up deployment down the road. It will ensure that your teams and deployments work smoothly and nothing is missed.