When I do a deployment from sandbox to production is this action based on the component's API Name?

I'm curious because I've deployed some code to production and am now going to setup a portal and want some easy names. My question is if I deploy again will this replace the previous component or will Salesforce see it as new and create a second component?

2 Answers 2


If I understand your question correctly, you're asking if a deploy from sandbox to production of a class that was named A but is now named B will result in a renaming of A or the creation of a new class "B"?

If that is indeed your question, in my experience, the deploy will create NEW classes, rather than renaming the old ones.

  • Agree, Sandbox to Product is a copy over, not a reply of events that took place since the last deploy. Commented Nov 4, 2013 at 18:41

Yes, deployments are additive and keyed by API Name. Hence if you change the API Name of a component in a sandbox then deploy to production a new component will be created with the new API Name and the original will remain in place.

As a general rule of thumb, do NOT change API Names. This goes for fields, objects, email templates, apex classes, etc. There are good reasons to do this, but you have to be willing to handle refactoring all references to the old API Name to use the new one, which is NOT a trivial exercise. Instead you should focus on changing the labels as needed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .