Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Converting Field Data Type?
CalvinFold
How would I go about converting a String List field into a Text field?
I understand SQL doesn't "like" to convert between certain data types, but String List to Text seems fairly innocuous, and I can't seem to do it via the PC Client (Data Type greyed out).
Find more posts tagged with
Comments
lyman
What I am about to suggest is NOT for the faint of heart and should only be done after a back-up! However it can be accomplished (with MBAdmin rights) without resorting to direct manipulation of the DB.
Internally in MediaBin as you may have guessed, (single select) string lists have the same representation as free-form text fields. What differs is the metadata definition.
Also, removing a metadata definition doe snot remove the data associated with that definition even though it becomes invisible.
So the steps (see caveats above!!!) are:
1) Export your string list metadata definition to XML. Note that this export does not export and security you may have on it. You will need to remember this by hand.
2) Create a new metadata field with type "Text" and export that to XML.
3) Edit the new exported XML file to share the same name and ID as the old exported file.
4) Delete the old MD definition.
5) Import the new metadata definition.
Cheers,
Lyman Hurd
PS This will NOT work for value lists. If the original metadata field was a multiselect string list the corresponding type is an array of strings.
CalvinFold
Thanks! I see what you're doing, sneaky. While it makes me a tad nervous, not difficult. Have to run it by the rep from Business and the team and see if they are comfortable with me doing this.
lyman
Hence the comment about backups :-)! Also keep around the old metadata definition too.
Just as a reminder the XML import/export of metadata fields (same comment goes for tasks) will not preserve security descriptors.
It is a general principal that metadata definition edits do not touch the underlying data. Of course one can get oneself in trouble because there is no safeguard to unsafe changes in data type (i.e., if you chose to tell MediaBin that a string field is now a double).
Cheers,
Lyman Hurd
CalvinFold
I gave this a try in our QE environment and it seems to work, but I had a question about what exactly is going on...
In order to load the new definition, you have to delete the old one....which of course brings up the "you're about to lose your data" message. But when you load the new definition, the data is still there, safe and sound.
So what *exactly* is going on behind the scenes?