best way to change a field name?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamie
    Senior Member
    • Aug 2025
    • 308

    #1

    best way to change a field name?

    I need to change the names of many fields to comply with a new naming convention, and I was wondering if there is an official way to do this?

    deep wiki has recommended this to me
    1. Create New Field: Go to Administration > Entity Manager > [Your Entity] > Fields and create countrySales with the same type as shippingCountry FieldManager.php:50-55 .
    2. Migrate Data: Execute a SQL query via your database tool:UPDATE `your_entity_table` SET country_sales = shipping_country;
    3. Update Layouts: Add the new field to your Detail/Edit layouts in Administration > Entity Manager > [Your Entity] > Layouts Renamer.php:312-318 .
    4. Delete Old Field: Once verified, delete shippingCountry from the Field Manager.

    is there any way to search though all workflows/flowcharts to find where the old value might be used?
    Last edited by jamie; Yesterday, 01:02 PM.
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1875

    #2
    From my experience, the best way would be to recreate the entities. many fields mean also: many relationships, language files, dynamic conditions, layouts, many files, where there will be occurrences of the terms. I tried it, even created PHP scripts (forms) to recollect all the terms and manually change them, saving back to their locations. It took me many hours with the final result, that recreating would have been faster from the beginning. And I did not even start to "teach" all that to the database. I stopped, when it began to become a nightmare, before causing a desaster.

    Comment

    Working...