How to change the field type of existing fields? Here is my case.


I've created a content type with few fields (all fields had type:
'text').
I've exported this content type using feature and then used feature on PROD website for few weeks.
Recently we decided to change type of 2 fields to: 'email' and
'link' (first we deleted these 2 fields, and then created them with
new type), I've updated feature with my content type again (since we
did changes to these 2 fields).
Now when I do deploy to my website it says that it can't convert
fields form current type to new type (and I can understand that).
However I also believe it is something that everybody does, so there
must be a normal solution to this.


Here is a message from my terminal:


  WD php: FieldException: Cannot change an existing field's type. in
  field_update_field() (line 234 of
  /Users/aaa/git/drupal/http/modules/field/field.crud.inc).
  [error] Drush command terminated abnormally due to an unrecoverable
  error.
  [error] FieldException: Cannot change an existing field&#039;s type.
  in field_update_field() (line 234 of
  /Users/aaa/git/drupal/http/modules/field/field.crud.inc).


Please advise what is the good approach to solve my issue (change type of field that is used already).
A possible approach to avoid running into this commonly known challenge, is to perform a mini-migration for each of both of your fields, on your PROD website.

Here are the highlights of such approach:


For your eMail field:


Assume your existing field (with type text) has machine name field_email.
Create a new field with type eMail (instead of text), say with machine name field_email_new.

For your Link field:


Assume your existing field (with type text) has machine name field_link.
Create a new field with type eMail (instead of text), say with machine name field_link_new.

Deploy both fields field_email_new and field_link_new to your PROD site, using Features (similar to what you tried to use, but which failed). Since these are new fields, that should not cause similar problems. Obviously, at that point the values of these fields will be empty.
For each of both fields, use an approach similar to what I described in my answer to "How do I move content from one field to another?", which (only) uses modules Rules and Views Bulk Operations. You should be able to reuse the Rules Component included there, after adapting the machine names of the used fields.
To the extend that would be needed, don't forget to adapt custom Rules, Views, etc to reference the new (instead of old) machine names of both fields.
Delete the original (old) eMail field and Link field.
Double check your custom Rules, Views, etc that you (should have) modified in 'Step 5' above, to ensure you don't have any of the typically "integrity" error messages (because you forget or skipped some of them). If any such errors show up, adapt the machine names to the new ones to fix them.


Obviously, steps 5, 6 and 7 can be refined by creating a clone from your PROD site, and prepare that kind of work in some none-PROD equivalent. Possibly combined with using a Features based deployment procedure to migrate your changes from that clone to your PROD site afterwards.

Note: NO custom coding, only some (rather basic) admin stuff, using robust contributed modules (and which can be uninstalled again afterwards).