Converting Single Line Text to Multi-Line Text Using CRM SDK’s Configuration Migration Tool

It’s been quite often that I’m requested to change the text field from single-line to multi-line or vice-versa. To achieve this usually I would suggest the creation of a brand new multi-line text field with different names and the other interfaces/integration that referring to the single-line field need to be adjusted to refer to the new field.

Today, I made a short experiment to change the text field type of a field in CRM and found a way to backup the data of the text field and reload the data once the new multi-line field with the same name using the SDK’s Configuration Migration Tool.

To get started on how to use the tool, I’ve posted a simple post on how to use the tool here or more detailed one from Jukka here.

Disclaimer: USE THIS METHOD AT YOUR OWN RISK. PLEASE BE AWARE THAT ANY INFORMATION YOU FIND MAY CAUSE DATA LOSS, PLEASE TAKE A BACKUP OF YOUR DATA BEFORE PROCEEDS.

First this is the sample of a single line text field on account entityShortText

Open the Configuration Manager tool, select Create schema option and continue with login. Once logged-in and fetched the CRM metadata, include the fields that going to be converted:
Export

Then continue with Save and Export, save the schema and the exported zipped file of the record.

Once, the export finishes, delete the field from the entity and create the field with the same name with type of Multi-Line text (don’t forget to publish the customisation):
LongText

Then go back to the Configuration Manager and select Import Data option and load the previously extracted zip file:
Imported

Now I have the multiple-lines text field with the same field name without losing previous data
MultipleLines

Notes: I tested this method on other data types and apparently the schema validation do not work.

I hope this helps!

2 thoughts on “Converting Single Line Text to Multi-Line Text Using CRM SDK’s Configuration Migration Tool

Leave a comment