How do we migrate the changes in the API name of components. When I tried the usual deployment, it resulted in new components being created in my target org with the new api name while the ones with the old api were still still present. Suppose I wanted to change the api name of a field and migrate the change to another sandbox, could you please tell me how to do this? Thanks
2 Answers
API names are like the non-org-specific Identifier of a metadata element. Consider that you can also not update the primary key/id of a data record by another primary key/Id. That'd be an insert.
So if you must do this, you'll have to do it in 2 operations: remove old version + insert new version.
You can use Destructive Changes xml to remove first, and use your usual calls to insert again.
To my knowledge, not doing this always implies you'd have to manually remove and clean up.
-
1Thanks Samuel. I researched quite a bit on this one. Its either manual or your way , thats it!– PrajithCommented Feb 26, 2016 at 11:47
Looks like every API name change creates a new entry in the Metadata instead of replacing the existing one. The best option would be to update the API names in the migrating sandbox first and then move the related components which refer the fields via changeset to avoid failures.
-
Good move, but there are norms in several projects that prevent manual steps like you mentioned - any change to the target orgs shall be made only by deployment unless it is not supported by the metadata api. This is to keep a record in the repository of the changes. +1– PrajithCommented Feb 26, 2016 at 11:46