+ Start a Discussion
RaavipatiRaavipati 

how to move the code from sandbox to production using changesets

Hi,
Iam new to the sandbox please help to move changes or code i have made in sandbox to production

Thanks & Regards
Pratyusha K
Best Answer chosen by Raavipati
Anilkumar KotaAnilkumar Kota

Authorize a Deployment Connection

Before you can receive change sets from a sandbox or other organization, authorize a deployment connection in the organization that receives the changes.
  1. Log into the organization that’ll receive inbound change sets. Usually this is the production organization associated with your sandbox.
  2. From Setup, enter Deployment in the Quick Find box, then select Deployment Settings.
  3. Click Edit next to the organization from which you want to receive outbound change sets. Usually this is your sandbox.
  4. Select Allow Inbound Changes and click Save.

Create and Upload an Outbound Change Set

Typically, you create an outbound change set in a sandbox organization and deploy it to production. But depending on your development lifecycle, you might choose to migrate changes in either direction between related organizations.
  1. From Setup, enter Outbound Change Sets in the Quick Find box, then select Outbound Change Sets.
  2. Click New.
  3. Enter a name for your change set and click Save.
  4. In the Change Set Components section, click Add.
  5. Choose the type of component (for example, Custom Object or Custom Field), the components you want to add, and click Add To Change Set.
If you are experimenting with a test custom object and custom field, try adding just one of them to the change set first.
  1. Click View/Add Dependencies to see whether the components you’ve added to the change set are dependent on other customizations.
In the case of the test custom object and custom field, the related component and page layout will both be listed.
  1. Select the dependent components you want to add and click Add To Change Set.
  2. Click Upload and choose your target organization.
The outbound change set detail page displays a message and you get an email notification when the upload is complete.
Now log into the target organization, where you can see the inbound change set.

Validate an Inbound Change Set

Validating a change set allows you to see the success or failure messages without committing the changes.
  1. From Setup, enter Inbound Change Sets in the Quick Find box, then select Inbound Change Sets.
  2. Click the name of a change set.
  3. Click Validate.
  1. After the validation completes, click View Results.
If you receive any error messages, resolve them before you deploy. The most common causes of errors are dependent components that aren’t included in the change set and Apex test failures.

Deploy an Inbound Change Set

Deploying a change set commits the changes it contains to the target organization.
  1. From Setup, enter Inbound Change Sets in the Quick Find box, then select Inbound Change Sets.
  2. In the Change Sets Awaiting Deployment list, click the name of the change set you want to deploy.
  3. Click Deploy.
A change set is deployed in a single transaction. If the deployment is unable to complete for any reason, the entire transaction is rolled back. After a deployment completes successfully, all changes are committed to your org and the deployment can’t be rolled back.
 

All Answers

chaithra yelekere parameshchaithra yelekere paramesh
If the sandbox and production are in same instance means connected orgs, U can deploy using changesets otherwise u need to use Apache ANT tool or Eclipse Force.com IDE or aside.io tool.
Migrating from sandbox to production, follow the steps below.
1. In source org, select deploy.
2. Outbound change set, enter the name and description if required.
3. Add the components like apex classes, objects, workflows with associated components, triggers, forlders, test classes, reports, dashboards, etc  which needs to be deploy into the production.
4. Once components are added, click on deploy and select the destination org.
5. Better practice to move all the permissions using permission set along with the components.
6. Once change set is uploaded in source org, it will take some time to available in destination.
7. After few minutes of time, uploaded change set will be available to deploy.
8. Click on validate and deploy the change set.
9. If any components are missing or any error occurs can be checked in deploy status.
10. If no errors change set will be deployed in destination(production) org.

Let me know if u face any issues.
Anilkumar KotaAnilkumar Kota

Authorize a Deployment Connection

Before you can receive change sets from a sandbox or other organization, authorize a deployment connection in the organization that receives the changes.
  1. Log into the organization that’ll receive inbound change sets. Usually this is the production organization associated with your sandbox.
  2. From Setup, enter Deployment in the Quick Find box, then select Deployment Settings.
  3. Click Edit next to the organization from which you want to receive outbound change sets. Usually this is your sandbox.
  4. Select Allow Inbound Changes and click Save.

Create and Upload an Outbound Change Set

Typically, you create an outbound change set in a sandbox organization and deploy it to production. But depending on your development lifecycle, you might choose to migrate changes in either direction between related organizations.
  1. From Setup, enter Outbound Change Sets in the Quick Find box, then select Outbound Change Sets.
  2. Click New.
  3. Enter a name for your change set and click Save.
  4. In the Change Set Components section, click Add.
  5. Choose the type of component (for example, Custom Object or Custom Field), the components you want to add, and click Add To Change Set.
If you are experimenting with a test custom object and custom field, try adding just one of them to the change set first.
  1. Click View/Add Dependencies to see whether the components you’ve added to the change set are dependent on other customizations.
In the case of the test custom object and custom field, the related component and page layout will both be listed.
  1. Select the dependent components you want to add and click Add To Change Set.
  2. Click Upload and choose your target organization.
The outbound change set detail page displays a message and you get an email notification when the upload is complete.
Now log into the target organization, where you can see the inbound change set.

Validate an Inbound Change Set

Validating a change set allows you to see the success or failure messages without committing the changes.
  1. From Setup, enter Inbound Change Sets in the Quick Find box, then select Inbound Change Sets.
  2. Click the name of a change set.
  3. Click Validate.
  1. After the validation completes, click View Results.
If you receive any error messages, resolve them before you deploy. The most common causes of errors are dependent components that aren’t included in the change set and Apex test failures.

Deploy an Inbound Change Set

Deploying a change set commits the changes it contains to the target organization.
  1. From Setup, enter Inbound Change Sets in the Quick Find box, then select Inbound Change Sets.
  2. In the Change Sets Awaiting Deployment list, click the name of the change set you want to deploy.
  3. Click Deploy.
A change set is deployed in a single transaction. If the deployment is unable to complete for any reason, the entire transaction is rolled back. After a deployment completes successfully, all changes are committed to your org and the deployment can’t be rolled back.
 
This was selected as the best answer