I know changing a metadata field's type can result in this field's values for existing entries being lost depending on the old and new type so this always scares me and I always test first in my test environment. I've tested changing a template field's type from "List" to "Text" in my test environment and the existing field values were not lost for this modified field. I wanted to pose this question in Answers so I could get feedback from others before I pull the trigger in my Production repository. Note: I'm not changing the width of the field.
Question
Question
Existing field values when changing a template field's type from "List" to "Text"
Answer
My sample size is much smaller than yours, but I just tried converting a list field to a text field of the same width (on version 9.1), and I had no issues--the field was converted and all the existing values on documents remained intact. (But of course, doing this kind of thing with a good working backup on hand is always an excellent practice!)
Replies
Whenever you change a field type, the system will prompt you to let you know that there could be potential data loss. This means that you will lose the values in your fields if data in the field doesn't meet the criteria of the field type. For example, imagine that I have a field (type text) called "Name" and it had the value "Alan" in it. Now if I change this field type to "number" the values in my field will be lost because the value "Alan" isn't a number and you can't enter letters into a number field. In your example, you are going from a list to a text field type so the data in there should remain since a text field accepts both letters and numbers.
Of course there is always risk involved when making changes to metadata fields like that since it can affect multiple files. I would recommend to back up your files before you make the change if possible. Another thing you can try is to add a new field to the template. Have a workflow put the value of that list field into your new field as a placeholder. Then make the change to the field type. If for some reason data gets lost, you still have the original value in that new field that you created.
The Laserfiche Admin Console does do a good job of warning when field values will be affected (lost or truncated) and my testing made me feel good about making the change but like you said there is always risk involved when making any change. Since I'm dealing with 187,000 entries I can't ignore the "what if" factor. Thanks for the suggestions in your second paragraph as well. I will make sure to do this off-hours after a good DB backup.
My sample size is much smaller than yours, but I just tried converting a list field to a text field of the same width (on version 9.1), and I had no issues--the field was converted and all the existing values on documents remained intact. (But of course, doing this kind of thing with a good working backup on hand is always an excellent practice!)
I was just faced with this situation and had no other option but to do the change. The client had well over 100,000 documents utilizing only list values and everything converted fine, we were on version 9.1. Of course, always get a back up just in case. Everyone's set up is so different!
So I understand the logic that if you change field type from Text to Number, you would lose "Alan" because Alan is not a number...but what if the field was initially setup as a "Text" field...and all that were in there were numbers...would that info stay if you convert it to a "Number" field...or same issue?
Regardless of the data that's in the text field, it will be lost when you change the field type to number.
I have another question regarding this issue.
I have a template with a field value which is of "List" data type.
Lets say the List has values (Choice A, Choice B , Choice C) and many documents were indexed accordingly with this format.
After like 1 month , client says they want to change the List and add Choice D instead of Choice C. So the new List Values will be (Choice A, Choice B , Choice D).
My question is what will happen to documents which previously had field values as Choice C? Will it get deleted or automatically change into Choice D???
Thanks & Regards
Akhil
The documents that have "Choice C" will have the value retained in that list field. When modifying that field for other documents or assigning that field to new documents, "Choice C" will no longer be an option.
As a recommendation, it's always good to test this on a small scale with isolated documents. You can also take a backup of the repository before making a change like this. However, changing the list field options like this is safe and should behave like I stated above.