Sandbox & Metadata Migrations or Deployments in Salesforce
What is sandbox?
Sandbox is a copy of your production organization. You can create multiple copies of your organization in separate environments for different purposes such as development, testing and training, without compromising the data and applications in your production organization. To know more about sandboxes see hollowing posts.
Metadata Migrations/Deployments in Salesforce
What is Metadata? metadata describes and gives the information about other data. Here in this page i will explain What is metadata in salesforce, What is the importance of metadata in salesforce and also how can we perform metadata migrations in salesforce.
In force.com platform every configuration/customization will store in the form of of metadata. Metadata migration means deploying your components from one instance to other instance. For example you are developing your project/application in one of your development sandbox. After completion of your development you need deploy that project/application form your development environment to TEST/PRODUCTION. In this scenario in salesforce what ever developed by you will store in the form of metadata in Force.com platform. If want deploy those components you can simply retrieve that data and you can deploy that data into your target environment.
In Salesforce we have different ways to do deployments. Those are
1. By Using changesets
2. By using Migration tool/ ANT tool
3. By using force.com IDE
You can use any one of the above ways to do deployments in salesforce. Apart from these three ways we can set up continuous integration to automate the deployments in salesforce.
Here i will explain above three ways to do deployments. Before going to that we will discuss about test class coverage. If you want deploy your code to production at least 75% of your apex code is covered by unit tests without fail.
Below are the important points yo have to take care before deployment in production.
– At least 75% of your Apex code must be covered by unit tests, and all of those tests must complete successfully.
– Every trigger must have some test coverage.
– All classes and triggers must compile successfully.
Now here in this page i will explain about three deployment methods.
1. Metadata Migration by using change sets:
In salesforce change set is used to deploy metadata between two instances (i.e. related sandboxes to sandbox, sandbox to production). Chanange set is very easy way to do deployments in salesforce. This is just point and click tool to do deployments.
Steps to use change sets:
1. Create connections between your source and target environments.
2. Create outbound change set and add components to that outbound change set in your source instance. And upload that outbound change set to your target instace.
3. Go to inbound change set in your target instance and deploy that change set.
For small set of components you can use change sets to do deployments in salesforce. For large set of deployments preparing change set will take more time.
2. Metadata migration by using Migration tool/ ANT tool
Migration tool is used to deploy metadata between two environment in salesforce. Basically it is a ant based tool. To use this tool you need have JDK, ANT & jar file provided by salesforce. Once you configure this in your system you can easily do deployments.
You can easily handle large set of components by using this migration tool.
3. About force.com IDE will post later…