What:
Drupal 7
Problem:
You want to change fields machine names in Drupal 7.
Solution:
If you don't have any content then recommended way is to delete a field and crate a new one, but what if you have already some articles?
Export your database:
mysqldump -u [username] -p [database] > backup.sqlUse sed to replace your old field name with a new one, make sure that you use the same number of characters in a new name, otherwise it will not work.
sed -i 's/field_random_name/field_better_name/g' baskup.sqlImport it back:
mysql -u [username] -p [database] < backup.sql
No comments:
Post a Comment