Rename Standard Field in Custom DocType

Is there an official way to rename a standard field while preserving its original data (change fieldname not just the label)?

I found the rename_field function in Frappe GitHub, but that requires creating a new fieldname while keeping the old one. I want an approach that allows for renaming a fieldname without keeping any reference to the old name in the desired doctype.

Anyone knows how ERPNext rename their fields if they needed to?

If you look at ERPNext/Frappe history on GitHub:

  1. They usually don’t rename existing fieldnames.
  2. Instead, they:
    Add a new field with the correct name.
    Write a patch that copies data from the old field to the new one.
    Update their codebase to use the new field.
    (Optionally, after a few versions) drop the old field via another migration.
2 Likes