Hi,we are trying to change property type from ContentReference to IList<ContentReference> is there any way to do that in-place or do we need to create a new field and migrate the data?
I think you'll need to create a new property and migrate the data.
You could have a look at MigrationStep but I'm not sure it can be used here...
Thomas is right in suggesting the use of MigrationStep, I've used it to create and mutate content items on site start up. The great part is that they execute once per environment. You'd have to use the IContent Repository to mutate your old field values onto your new fields and you'd have to iterate over all of your content items with some form of recursive lookup. I would advise then when you save a content item within a MigrationStep that you use the following save command:
contentRepository.Save(writeablePage, SaveAction.Patch, AccessLevel.NoAccess);
SaveAction.Patch will bypass any validation errors when updating the content. During a migration step you won't want validation errors to prevent you from converting the field. The AccessLevel.NoAccess prevents the save event from needing a user with specific privileges to be the person triggering the save event.
An alternative tactic would be to retain both fields and use a method to access them. If the IList<ContentReference> field is null or empty then fall back to the old ContentReference. In the interim you could specify that the old version of the field should not be editable by decorating it with: