How to Rename a Salesforce Aura Component

Sharing is Caring

Out of the box, Salesforce doesn’t provide an a way to rename a Salesforce Lightning Component (Aura), but don’t worry there is an easier way than creating a new one and copying everything over.

Previously, we would do all of the following steps:

  • create a new component named what we want it to be and then copy in all of our code.
  • update everywhere to use the new component
  • we would open up the Developer Console -> File -> and then click delete for the component
  • Test and make sure everything is still working.

We can now instead do this:

  • In the developer console or wherever we can run and update SOQL run this query: SELECT Id, DeveloperName, MasterLabel FROM AuraDefinitionBundle
  • Update the correct record’s “DeveloperName” to be what you want it to be. Click Save Rows or Update Record.
  • Test and make sure everything is still working.
Sharing is Caring

Brian is a software architect and technology leader living in Niagara Falls with 13+ years of development experience. He is passionate about automation, business process re-engineering, and building a better tomorrow.

Brian is a proud father of four: two boys, and two girls and has been happily married to Crystal for more than ten years. From time to time, Brian may post about his faith, his family, and definitely about technology.