How do I change the machine name of a field once it's been created
My procedure is to use drush to clone the field first, then copy the field data with DB queries into the new field table. After I verify the contents of the cloned field, I delete the original field. 

I do it this ways because I think the drush method of cloning fields will always be at least as reliable as any cloning code I might craft myself, the data copy query is pretty simple, and I get to check the new field before deleting the original.


drush field-clone field_my_field field_my_field_clone
Insert rows into field_my_field_clone, e.g., INSERT field_my_field_clone SELECT * FROM field_my_field;
Verify the contents of field_my_field_clone.
Delete the field using the UI, e.g., admin/structure/types/manage/my-content-type/fields