Drupal: Changing a text field to long text

Once you have data in a field, it is not easy to change the field type in Drupal. Looking at the database tables, I thought I could just change a couple things and it would work. Well, I was mostly right... the only thing that didn't seem to be working as the filtering not getting applied to the long text. By the end, I had to export and import the data for one table for it to fully work.So these are the steps I would do next time.

1. Let's say I have a field named field_greetings. This field is used in only one content type. If it's used in more than one, I suppose there might be some hiccups.

2. There's a table named field_data_field_greetings that contains all of the content. That's the table to export (using phpMyAdmin or what have you).

3. Delete the field from the content type using Drupal's UI.

4. Add in the new field using the same field name using Drupal.

5. Import the table that you exported previously.

6. Edit the column for each record so it's the format type you want.

Tags: